65 |
import org.linuxsampler.lscp.AudioOutputChannel; |
import org.linuxsampler.lscp.AudioOutputChannel; |
66 |
import org.linuxsampler.lscp.AudioOutputDevice; |
import org.linuxsampler.lscp.AudioOutputDevice; |
67 |
import org.linuxsampler.lscp.Parameter; |
import org.linuxsampler.lscp.Parameter; |
68 |
|
import org.linuxsampler.lscp.ParameterFactory; |
69 |
|
|
70 |
import static org.jsampler.view.fantasia.FantasiaI18n.i18n; |
import static org.jsampler.view.fantasia.FantasiaI18n.i18n; |
71 |
import static org.jsampler.view.fantasia.FantasiaPrefs.preferences; |
import static org.jsampler.view.fantasia.FantasiaPrefs.preferences; |
90 |
setOptionsPane(optionsPane); |
setOptionsPane(optionsPane); |
91 |
|
|
92 |
int id = model.getDeviceId(); |
int id = model.getDeviceId(); |
93 |
setDeviceName(i18n.getLabel("AudioDevicePane.lDevName", id)); |
String s = model.getDeviceInfo().getDriverName(); |
94 |
|
setDeviceName(i18n.getLabel("AudioDevicePane.lDevName", id, s)); |
95 |
} |
} |
96 |
|
|
97 |
protected void |
protected void |
214 |
cbChannel.addItem(chn); |
cbChannel.addItem(chn); |
215 |
} |
} |
216 |
|
|
217 |
Parameter[] pS = audioDeviceModel.getDeviceInfo().getAdditionalParameters(); |
updateParams(audioDeviceModel.getDeviceInfo()); |
|
additionalParamsTable.getModel().setParameters(pS); |
|
218 |
additionalParamsTable.getModel().addParameterListener(new ParameterListener() { |
additionalParamsTable.getModel().addParameterListener(new ParameterListener() { |
219 |
public void |
public void |
220 |
parameterChanged(ParameterEvent e) { |
parameterChanged(ParameterEvent e) { |
277 |
if(a != na) checkActive.setSelected(na); |
if(a != na) checkActive.setSelected(na); |
278 |
|
|
279 |
AudioOutputDevice d = e.getAudioDeviceModel().getDeviceInfo(); |
AudioOutputDevice d = e.getAudioDeviceModel().getDeviceInfo(); |
280 |
|
updateParams(d); |
|
Parameter[] params = d.getAdditionalParameters(); |
|
|
additionalParamsTable.getModel().setParameters(params); |
|
281 |
|
|
282 |
int idx = cbChannel.getSelectedIndex(); |
int idx = cbChannel.getSelectedIndex(); |
283 |
cbChannel.removeAllItems(); |
cbChannel.removeAllItems(); |
298 |
|
|
299 |
audioDeviceModel.setBackendChannelParameter(c, e.getParameter()); |
audioDeviceModel.setBackendChannelParameter(c, e.getParameter()); |
300 |
} |
} |
301 |
|
|
302 |
|
private void |
303 |
|
updateParams(AudioOutputDevice d) { |
304 |
|
Parameter[] params = d.getAdditionalParameters(); |
305 |
|
Parameter[] p2s = new Parameter[params.length + 1]; |
306 |
|
|
307 |
|
for(int i = 0; i < params.length; i++) p2s[i] = params[i]; |
308 |
|
|
309 |
|
p2s[params.length] = d.getSampleRateParameter(); |
310 |
|
|
311 |
|
additionalParamsTable.getModel().setParameters(p2s); |
312 |
|
} |
313 |
} |
} |
314 |
|
|
315 |
} |
} |