Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java7
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java3
4 files changed, 12 insertions, 4 deletions
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java
index 5f4e4fbe6..d11341de4 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java
@@ -19,6 +19,7 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.Launch;
import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.examples.core.midi.model.Quantizer;
/**
* A launch containing a MIDI sequencer.
@@ -106,6 +107,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
getSequencer().stop();
getSequencer().close();
fireTerminate();
+ DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent(getSequencer(), DebugEvent.TERMINATE)});
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java
index 363718233..a09df84d3 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java
@@ -14,8 +14,8 @@ import java.util.Timer;
import java.util.TimerTask;
import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch;
import org.eclipse.debug.examples.core.midi.launcher.ClockControl;
+import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler;
@@ -93,7 +93,7 @@ public class ControlEventHandler extends DebugEventHandler {
fTimer.schedule(new TimerTask() {
public void run() {
ModelDelta delta = new ModelDelta(fLaunch, IModelDelta.NO_CHANGE);
- delta = delta.addNode(new ClockControl(fLaunch), IModelDelta.STATE);
+ delta = delta.addNode(new ClockControl(fLaunch), IModelDelta.STATE | IModelDelta.CONTENT);
fireDelta(delta);
}
}, 0, 100);
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java
index 1f57c9b1a..348e854e2 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java
@@ -14,11 +14,11 @@ import javax.sound.midi.Sequencer;
import javax.sound.midi.Track;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.examples.core.midi.launcher.ClockControl;
import org.eclipse.debug.examples.core.midi.launcher.LengthControl;
import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch;
import org.eclipse.debug.examples.core.midi.launcher.SequencerControl;
import org.eclipse.debug.examples.core.midi.launcher.TempoControl;
-import org.eclipse.debug.examples.core.midi.launcher.ClockControl;
import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
@@ -38,6 +38,9 @@ public class SequencerContentProvider extends ElementContentProvider {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
return getTracks((MidiLaunch) element).length;
} else if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId())) {
+ if (((MidiLaunch)element).isTerminated()) {
+ return 0;
+ }
return 3;
}
return 0;
@@ -77,7 +80,7 @@ public class SequencerContentProvider extends ElementContentProvider {
*/
public Track[] getTracks(MidiLaunch launch) {
Sequencer sequencer = launch.getSequencer();
- if (sequencer != null) {
+ if (sequencer != null && sequencer.isOpen()) {
return sequencer.getSequence().getTracks();
}
return new Track[0];
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java
index e200493fe..3faf1c4f0 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java
@@ -83,6 +83,9 @@ public class SequencerControlsModelProxy extends EventHandlerModelProxy {
if (event.getSource() instanceof Sequencer) {
return fLaunch.getSequencer().equals(event.getSource());
}
+ if (event.getSource().equals(fLaunch)) {
+ return true;
+ }
return false;
}

Back to the top