162 |
CC.getClient().enableAudioOutputDevice(dev, enable); |
CC.getClient().enableAudioOutputDevice(dev, enable); |
163 |
|
|
164 |
// Not needed, but eventually speeds up the change. |
// Not needed, but eventually speeds up the change. |
165 |
CC.getSamplerModel().getAudioDeviceModel(dev).setActive(enable); |
CC.getSamplerModel().getAudioDeviceById(dev).setActive(enable); |
166 |
} catch(Exception x) { |
} catch(Exception x) { |
167 |
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
168 |
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |
261 |
run() { |
run() { |
262 |
try { |
try { |
263 |
AudioOutputDevice d = CC.getClient().getAudioOutputDeviceInfo(dev); |
AudioOutputDevice d = CC.getClient().getAudioOutputDeviceInfo(dev); |
264 |
CC.getSamplerModel().getAudioDeviceModel(dev).setDeviceInfo(d); |
CC.getSamplerModel().getAudioDeviceById(dev).setDeviceInfo(d); |
265 |
} catch(Exception x) { |
} catch(Exception x) { |
266 |
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
267 |
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |
289 |
|
|
290 |
boolean found = false; |
boolean found = false; |
291 |
|
|
292 |
for(AudioDeviceModel m : sm.getAudioDeviceModels()) { |
for(AudioDeviceModel m : sm.getAudioDevices()) { |
293 |
for(int i = 0; i < devIDs.length; i++) { |
for(int i = 0; i < devIDs.length; i++) { |
294 |
if(m.getDeviceId() == devIDs[i]) { |
if(m.getDeviceId() == devIDs[i]) { |
295 |
devIDs[i] = -1; |
devIDs[i] = -1; |
297 |
} |
} |
298 |
} |
} |
299 |
|
|
300 |
if(!found) sm.removeAudioDevice(m.getDeviceId()); |
if(!found) sm.removeAudioDeviceById(m.getDeviceId()); |
301 |
found = false; |
found = false; |
302 |
} |
} |
303 |
|
|