64 |
run() { |
run() { |
65 |
try { |
try { |
66 |
setResult(CC.getClient().addSamplerChannel()); |
setResult(CC.getClient().addSamplerChannel()); |
67 |
|
int chnId = getResult(); |
68 |
|
|
69 |
JSPrefs p = CC.getViewConfig().preferences(); |
JSPrefs p = CC.getViewConfig().preferences(); |
70 |
if(!p.getBoolProperty(USE_CHANNEL_DEFAULTS)) return; |
if(!p.getBoolProperty(USE_CHANNEL_DEFAULTS)) return; |
71 |
|
|
72 |
String s = p.getStringProperty(DEFAULT_ENGINE); |
String s = p.getStringProperty(DEFAULT_ENGINE); |
73 |
if(s != null && s.length() > 0) { |
if(s != null && s.length() > 0) { |
74 |
CC.getClient().loadSamplerEngine(s, getResult()); |
CC.getClient().loadSamplerEngine(s, chnId); |
75 |
} |
} |
76 |
|
|
77 |
s = p.getStringProperty(DEFAULT_MIDI_INPUT); |
s = p.getStringProperty(DEFAULT_MIDI_INPUT); |
85 |
if(s != null && s.equals("firstDevice")) { |
if(s != null && s.equals("firstDevice")) { |
86 |
assignFirstAudioDevice(); |
assignFirstAudioDevice(); |
87 |
} |
} |
88 |
|
|
89 |
|
s = p.getStringProperty(DEFAULT_MIDI_INSTRUMENT_MAP); |
90 |
|
if(s != null && s.equals("midiInstrumentMap.none")) { |
91 |
|
CC.getClient().setChannelMidiInstrumentMap(chnId, -1); |
92 |
|
} else if(s != null && s.equals("midiInstrumentMap.default")) { |
93 |
|
CC.getClient().setChannelMidiInstrumentMap(chnId, -2); |
94 |
|
} |
95 |
|
|
96 |
|
float volume = p.getIntProperty(DEFAULT_CHANNEL_VOLUME); |
97 |
|
volume /= 100; |
98 |
|
CC.getClient().setChannelVolume(chnId, volume); |
99 |
} catch(Exception x) { |
} catch(Exception x) { |
100 |
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
101 |
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |