81 |
private SamplerChannelModel channelModel; |
private SamplerChannelModel channelModel; |
82 |
private final FxSendTable fxSendsTable; |
private final FxSendTable fxSendsTable; |
83 |
|
|
84 |
private final ToolbarButton btnNewFxSend = new ToolbarButton(new AddFxSend()); |
private final AddFxSend addFxSend = new AddFxSend(); |
85 |
|
private final ToolbarButton btnNewFxSend = new ToolbarButton(addFxSend); |
86 |
private final ToolbarButton btnRemoveFxSend = new ToolbarButton(new RemoveFxSend()); |
private final ToolbarButton btnRemoveFxSend = new ToolbarButton(new RemoveFxSend()); |
87 |
private final JComboBox cbMidiCtrls = new JComboBox(); |
private final JComboBox cbMidiCtrls = new JComboBox(); |
88 |
private final JSlider slVolume = new JSlider(0, 100); |
private final JSlider slVolume = new JSlider(0, 100); |
245 |
} |
} |
246 |
|
|
247 |
class AddFxSend extends AbstractAction { |
class AddFxSend extends AbstractAction { |
248 |
|
private int fxSendId = -1; |
249 |
|
|
250 |
AddFxSend() { |
AddFxSend() { |
251 |
super(i18n.getLabel("FxSendPane.AddFxSend")); |
super(i18n.getLabel("FxSendPane.AddFxSend")); |
252 |
|
|
257 |
|
|
258 |
public void |
public void |
259 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
|
//channelModel.addBackendFxSend(0, "New effect send"); |
|
260 |
int id = channelModel.getChannelId(); |
int id = channelModel.getChannelId(); |
261 |
final Channel.AddFxSend t = new Channel.AddFxSend(id, 0, "New effect send"); |
final Channel.AddFxSend t = new Channel.AddFxSend(id, 0, "New effect send"); |
262 |
|
|
263 |
t.addTaskListener(new TaskListener() { |
t.addTaskListener(new TaskListener() { |
264 |
public void |
public void |
265 |
taskPerformed(TaskEvent e) { |
taskPerformed(TaskEvent e) { |
266 |
if(t.doneWithErrors()) return; |
if(t.doneWithErrors()) { |
267 |
|
fxSendId = -1; |
268 |
int i = t.getResult(); |
return; |
269 |
//channelModel.get |
} |
270 |
|
setFxSendId(t.getResult()); |
271 |
} |
} |
272 |
}); |
}); |
273 |
CC.getTaskQueue().add(t); |
CC.getTaskQueue().add(t); |
274 |
} |
} |
275 |
|
|
276 |
|
public int |
277 |
|
getFxSendId() { return fxSendId; } |
278 |
|
|
279 |
|
public void |
280 |
|
setFxSendId(int id) { fxSendId = id; } |
281 |
} |
} |
282 |
|
|
283 |
class RemoveFxSend extends AbstractAction { |
class RemoveFxSend extends AbstractAction { |
308 |
|
|
309 |
JComboBox cb = new JComboBox(); |
JComboBox cb = new JComboBox(); |
310 |
int devId = channelModel.getChannelInfo().getAudioOutputDevice(); |
int devId = channelModel.getChannelInfo().getAudioOutputDevice(); |
311 |
AudioDeviceModel adm = CC.getSamplerModel().getAudioDeviceModel(devId); |
AudioDeviceModel adm = CC.getSamplerModel().getAudioDeviceById(devId); |
312 |
|
|
313 |
int chns; |
int chns; |
314 |
if(adm == null) { |
if(adm == null) { |
427 |
/** Invoked when a new effect send is added to a sampler channel. */ |
/** Invoked when a new effect send is added to a sampler channel. */ |
428 |
public void |
public void |
429 |
effectSendAdded(EffectSendsEvent e) { |
effectSendAdded(EffectSendsEvent e) { |
430 |
e.getFxSend(); |
FxSend fxs = fxSendsTable.getSelectedFxSend(); |
431 |
|
if(fxs == null) return; |
432 |
|
if(fxs.getFxSendId() != addFxSend.getFxSendId()) return; |
433 |
|
|
434 |
fxSendsTable.requestFocus(); |
fxSendsTable.requestFocus(); |
435 |
fxSendsTable.editSelectedFxSend(); |
fxSendsTable.editSelectedFxSend(); |
436 |
|
addFxSend.setFxSendId(-1); |
437 |
} |
} |
438 |
|
|
439 |
/** Invoked when an effect send is removed from a sampler channel. */ |
/** Invoked when an effect send is removed from a sampler channel. */ |