403 |
try { |
try { |
404 |
String s = getJSamplerHome(); |
String s = getJSamplerHome(); |
405 |
if(s == null) return; |
if(s == null) return; |
406 |
|
getOrchestras().addOrchestraListListener(getHandler()); |
407 |
|
|
408 |
File f = new File(s + File.separator + "orchestras.xml.bkp"); |
File f = new File(s + File.separator + "orchestras.xml.bkp"); |
409 |
if(f.isFile()) HF.createBackup("orchestras.xml.bkp", "orchestras.xml.rec"); |
if(f.isFile()) HF.createBackup("orchestras.xml.bkp", "orchestras.xml.rec"); |
432 |
for(int i = 0; i < getOrchestras().getOrchestraCount(); i++) { |
for(int i = 0; i < getOrchestras().getOrchestraCount(); i++) { |
433 |
getOrchestras().getOrchestra(i).addOrchestraListener(getHandler()); |
getOrchestras().getOrchestra(i).addOrchestraListener(getHandler()); |
434 |
} |
} |
|
getOrchestras().addOrchestraListListener(getHandler()); |
|
435 |
} |
} |
436 |
|
|
437 |
private static void |
private static void |
729 |
SamplerChannelModel[] channels = getSamplerModel().getChannels(); |
SamplerChannelModel[] channels = getSamplerModel().getChannels(); |
730 |
|
|
731 |
for(int i = 0; i < channels.length; i++) { |
for(int i = 0; i < channels.length; i++) { |
732 |
SamplerChannelModel scm = getSamplerModel().getChannelById(i); |
SamplerChannelModel scm = channels[i]; |
733 |
exportChannelToLscpScript(scm.getChannelInfo(), i, lscpClient); |
exportChannelToLscpScript(scm.getChannelInfo(), i, lscpClient); |
734 |
sb.append(out.toString()); |
sb.append(out.toString()); |
735 |
out.reset(); |
out.reset(); |
797 |
try { |
try { |
798 |
lscpCLient.addSamplerChannel(); |
lscpCLient.addSamplerChannel(); |
799 |
|
|
800 |
int i = chn.getMidiInputDevice(); |
SamplerModel sm = CC.getSamplerModel(); |
801 |
if(i != -1) lscpCLient.setChannelMidiInputDevice(chnId, i); |
int id = chn.getMidiInputDevice(); |
802 |
|
if(id != -1) { |
803 |
|
for(int i = 0; i < sm.getMidiDeviceCount(); i++) { |
804 |
|
if(sm.getMidiDevice(i).getDeviceId() == id) { |
805 |
|
lscpCLient.setChannelMidiInputDevice(chnId, i); |
806 |
|
break; |
807 |
|
} |
808 |
|
} |
809 |
|
} |
810 |
lscpCLient.setChannelMidiInputPort(chnId, chn.getMidiInputPort()); |
lscpCLient.setChannelMidiInputPort(chnId, chn.getMidiInputPort()); |
811 |
lscpCLient.setChannelMidiInputChannel(chnId, chn.getMidiInputChannel()); |
lscpCLient.setChannelMidiInputChannel(chnId, chn.getMidiInputChannel()); |
812 |
|
|
813 |
i = chn.getAudioOutputDevice(); |
id = chn.getAudioOutputDevice(); |
814 |
if(i != -1) { |
if(id != -1) { |
815 |
lscpCLient.setChannelAudioOutputDevice(chnId, i); |
for(int i = 0; i < sm.getAudioDeviceCount(); i++) { |
816 |
|
if(sm.getAudioDevice(i).getDeviceId() == id) { |
817 |
|
lscpCLient.setChannelAudioOutputDevice(chnId, i); |
818 |
|
break; |
819 |
|
} |
820 |
|
} |
821 |
|
|
822 |
Integer[] routing = chn.getAudioOutputRouting(); |
Integer[] routing = chn.getAudioOutputRouting(); |
823 |
|
|
824 |
for(int j = 0; j < routing.length; j++) { |
for(int j = 0; j < routing.length; j++) { |
835 |
} |
} |
836 |
|
|
837 |
String s = chn.getInstrumentFile(); |
String s = chn.getInstrumentFile(); |
838 |
i = chn.getInstrumentIndex(); |
int i = chn.getInstrumentIndex(); |
839 |
if(s != null) lscpCLient.loadInstrument(s, i, chnId, true); |
if(s != null) lscpCLient.loadInstrument(s, i, chnId, true); |
840 |
|
|
841 |
if(chn.isMuted()) lscpCLient.setChannelMute(chnId, true); |
if(chn.isMuted()) lscpCLient.setChannelMute(chnId, true); |