136 |
scheduleTask(Task t) { |
scheduleTask(Task t) { |
137 |
while(getTaskQueue().removeTask(t)) { } |
while(getTaskQueue().removeTask(t)) { } |
138 |
|
|
|
if(getTaskQueue().getPendingTaskCount() == 0) { |
|
|
if(t.equals(getTaskQueue().getRunningTask())) return; |
|
|
} |
|
|
|
|
139 |
getTaskQueue().add(t); |
getTaskQueue().add(t); |
140 |
} |
} |
141 |
|
|
142 |
/** |
/** |
143 |
|
* Adds the specified task to the task queue only if the last |
144 |
|
* task in the is not equal to <code>t</code>. |
145 |
|
*/ |
146 |
|
public static void |
147 |
|
addTask(Task t) { |
148 |
|
Task[] tasks = getTaskQueue().getPendingTasks(); |
149 |
|
if(tasks.length > 0 && tasks[tasks.length - 1].equals(t)) return; |
150 |
|
getTaskQueue().add(t); |
151 |
|
} |
152 |
|
|
153 |
|
/** |
154 |
* Gets the configuration of the current view. |
* Gets the configuration of the current view. |
155 |
*/ |
*/ |
156 |
public static JSViewConfig |
public static JSViewConfig |
411 |
*/ |
*/ |
412 |
public static InstrumentsDbTreeModel |
public static InstrumentsDbTreeModel |
413 |
getInstrumentsDbTreeModel() { |
getInstrumentsDbTreeModel() { |
414 |
|
if(CC.getSamplerModel().getServerInfo() == null) return null; |
415 |
if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null; |
if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null; |
416 |
|
|
417 |
if(instrumentsDbTreeModel == null) { |
if(instrumentsDbTreeModel == null) { |
432 |
idtmListeners.remove(l); |
idtmListeners.remove(l); |
433 |
} |
} |
434 |
|
|
435 |
|
private static final LostFilesModel lostFilesModel = new LostFilesModel(); |
436 |
|
|
437 |
|
public static LostFilesModel |
438 |
|
getLostFilesModel() { return lostFilesModel; } |
439 |
|
|
440 |
/** |
/** |
441 |
* Loads the orchestras described in <code><jsampler_home>/orchestras.xml</code>. |
* Loads the orchestras described in <code><jsampler_home>/orchestras.xml</code>. |
442 |
* 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 |
795 |
getTaskQueue().add(mgim); |
getTaskQueue().add(mgim); |
796 |
getTaskQueue().add(new Midi.UpdateDevices()); |
getTaskQueue().add(new Midi.UpdateDevices()); |
797 |
getTaskQueue().add(new Audio.UpdateDevices()); |
getTaskQueue().add(new Audio.UpdateDevices()); |
798 |
getTaskQueue().add(uc); |
addTask(uc); |
799 |
} |
} |
800 |
}); |
}); |
801 |
|
|
926 |
sb.append("\r\n"); |
sb.append("\r\n"); |
927 |
} |
} |
928 |
|
|
929 |
|
exportInstrMapsToLscpScript(lscpClient); |
930 |
|
sb.append(out.toString()); |
931 |
|
out.reset(); |
932 |
|
sb.append("\r\n"); |
933 |
|
|
934 |
SamplerChannelModel[] channels = getSamplerModel().getChannels(); |
SamplerChannelModel[] channels = getSamplerModel().getChannels(); |
935 |
|
|
936 |
for(int i = 0; i < channels.length; i++) { |
for(int i = 0; i < channels.length; i++) { |
948 |
sb.append("\r\n"); |
sb.append("\r\n"); |
949 |
} |
} |
950 |
|
|
|
exportInstrMapsToLscpScript(lscpClient); |
|
|
sb.append(out.toString()); |
|
|
out.reset(); |
|
|
|
|
951 |
return sb.toString(); |
return sb.toString(); |
952 |
} |
} |
953 |
|
|
1014 |
if(chn.getEngine() != null) { |
if(chn.getEngine() != null) { |
1015 |
lscpCLient.loadSamplerEngine(chn.getEngine().getName(), chnId); |
lscpCLient.loadSamplerEngine(chn.getEngine().getName(), chnId); |
1016 |
lscpCLient.setChannelVolume(chnId, chn.getVolume()); |
lscpCLient.setChannelVolume(chnId, chn.getVolume()); |
1017 |
|
int mapId = chn.getMidiInstrumentMapId(); |
1018 |
|
lscpCLient.setChannelMidiInstrumentMap(chnId, mapId); |
1019 |
} |
} |
1020 |
|
|
1021 |
id = chn.getAudioOutputDevice(); |
id = chn.getAudioOutputDevice(); |
1105 |
/** Invoked when the number of channels has changed. */ |
/** Invoked when the number of channels has changed. */ |
1106 |
public void |
public void |
1107 |
channelCountChanged( ChannelCountEvent e) { |
channelCountChanged( ChannelCountEvent e) { |
1108 |
getTaskQueue().add(new UpdateChannels()); |
addTask(new UpdateChannels()); |
1109 |
} |
} |
1110 |
|
|
1111 |
/** Invoked when changes to the sampler channel has occured. */ |
/** Invoked when changes to the sampler channel has occured. */ |
1219 |
/** 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. */ |
1220 |
public void |
public void |
1221 |
instrumentCountChanged(MidiInstrumentCountEvent e) { |
instrumentCountChanged(MidiInstrumentCountEvent e) { |
1222 |
getTaskQueue().add(new Midi.UpdateInstruments(e.getMapId())); |
scheduleTask(new Midi.UpdateInstruments(e.getMapId())); |
1223 |
} |
} |
1224 |
|
|
1225 |
/** Invoked when a MIDI instrument in a MIDI instrument map is changed. */ |
/** Invoked when a MIDI instrument in a MIDI instrument map is changed. */ |