25 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
26 |
import java.awt.event.ActionListener; |
import java.awt.event.ActionListener; |
27 |
|
|
|
import java.io.ByteArrayInputStream; |
|
28 |
import java.io.ByteArrayOutputStream; |
import java.io.ByteArrayOutputStream; |
29 |
import java.io.File; |
import java.io.File; |
30 |
import java.io.FileInputStream; |
import java.io.FileInputStream; |
79 |
import org.w3c.dom.Node; |
import org.w3c.dom.Node; |
80 |
|
|
81 |
import static org.jsampler.JSI18n.i18n; |
import static org.jsampler.JSI18n.i18n; |
|
import static org.jsampler.JSPrefs.MANUAL_SERVER_SELECT_ON_STARTUP; |
|
82 |
|
|
83 |
|
|
84 |
/** |
/** |
134 |
scheduleTask(Task t) { |
scheduleTask(Task t) { |
135 |
while(getTaskQueue().removeTask(t)) { } |
while(getTaskQueue().removeTask(t)) { } |
136 |
|
|
|
if(getTaskQueue().getPendingTaskCount() == 0) { |
|
|
if(t.equals(getTaskQueue().getRunningTask())) return; |
|
|
} |
|
|
|
|
137 |
getTaskQueue().add(t); |
getTaskQueue().add(t); |
138 |
} |
} |
139 |
|
|
140 |
/** |
/** |
141 |
|
* Adds the specified task to the task queue only if the last |
142 |
|
* task in the is not equal to <code>t</code>. |
143 |
|
*/ |
144 |
|
public static void |
145 |
|
addTask(Task t) { |
146 |
|
Task[] tasks = getTaskQueue().getPendingTasks(); |
147 |
|
if(tasks.length > 0 && tasks[tasks.length - 1].equals(t)) return; |
148 |
|
getTaskQueue().add(t); |
149 |
|
} |
150 |
|
|
151 |
|
/** |
152 |
* Gets the configuration of the current view. |
* Gets the configuration of the current view. |
153 |
*/ |
*/ |
154 |
public static JSViewConfig |
public static JSViewConfig |
409 |
*/ |
*/ |
410 |
public static InstrumentsDbTreeModel |
public static InstrumentsDbTreeModel |
411 |
getInstrumentsDbTreeModel() { |
getInstrumentsDbTreeModel() { |
412 |
|
if(CC.getSamplerModel().getServerInfo() == null) return null; |
413 |
if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null; |
if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null; |
414 |
|
|
415 |
if(instrumentsDbTreeModel == null) { |
if(instrumentsDbTreeModel == null) { |
430 |
idtmListeners.remove(l); |
idtmListeners.remove(l); |
431 |
} |
} |
432 |
|
|
433 |
|
private static final LostFilesModel lostFilesModel = new LostFilesModel(); |
434 |
|
|
435 |
|
public static LostFilesModel |
436 |
|
getLostFilesModel() { return lostFilesModel; } |
437 |
|
|
438 |
/** |
/** |
439 |
* Loads the orchestras described in <code><jsampler_home>/orchestras.xml</code>. |
* Loads the orchestras described in <code><jsampler_home>/orchestras.xml</code>. |
440 |
* If file with name <code>orchestras.xml.bkp</code> exist in the JSampler's home |
* If file with name <code>orchestras.xml.bkp</code> exist in the JSampler's home |
793 |
getTaskQueue().add(mgim); |
getTaskQueue().add(mgim); |
794 |
getTaskQueue().add(new Midi.UpdateDevices()); |
getTaskQueue().add(new Midi.UpdateDevices()); |
795 |
getTaskQueue().add(new Audio.UpdateDevices()); |
getTaskQueue().add(new Audio.UpdateDevices()); |
796 |
getTaskQueue().add(uc); |
addTask(uc); |
797 |
} |
} |
798 |
}); |
}); |
799 |
|
|
927 |
exportInstrMapsToLscpScript(lscpClient); |
exportInstrMapsToLscpScript(lscpClient); |
928 |
sb.append(out.toString()); |
sb.append(out.toString()); |
929 |
out.reset(); |
out.reset(); |
930 |
|
sb.append("\r\n"); |
931 |
|
|
932 |
SamplerChannelModel[] channels = getSamplerModel().getChannels(); |
SamplerChannelModel[] channels = getSamplerModel().getChannels(); |
933 |
|
|
1103 |
/** Invoked when the number of channels has changed. */ |
/** Invoked when the number of channels has changed. */ |
1104 |
public void |
public void |
1105 |
channelCountChanged( ChannelCountEvent e) { |
channelCountChanged( ChannelCountEvent e) { |
1106 |
getTaskQueue().add(new UpdateChannels()); |
addTask(new UpdateChannels()); |
1107 |
} |
} |
1108 |
|
|
1109 |
/** Invoked when changes to the sampler channel has occured. */ |
/** Invoked when changes to the sampler channel has occured. */ |
1217 |
/** Invoked when the number of MIDI instruments in a MIDI instrument map is changed. */ |
/** Invoked when the number of MIDI instruments in a MIDI instrument map is changed. */ |
1218 |
public void |
public void |
1219 |
instrumentCountChanged(MidiInstrumentCountEvent e) { |
instrumentCountChanged(MidiInstrumentCountEvent e) { |
1220 |
getTaskQueue().add(new Midi.UpdateInstruments(e.getMapId())); |
scheduleTask(new Midi.UpdateInstruments(e.getMapId())); |
1221 |
} |
} |
1222 |
|
|
1223 |
/** Invoked when a MIDI instrument in a MIDI instrument map is changed. */ |
/** Invoked when a MIDI instrument in a MIDI instrument map is changed. */ |