22 |
|
|
23 |
package org.jsampler.view.std; |
package org.jsampler.view.std; |
24 |
|
|
25 |
|
import javax.swing.SwingUtilities; |
26 |
|
|
27 |
import org.jsampler.CC; |
import org.jsampler.CC; |
28 |
import org.jsampler.SamplerChannelModel; |
import org.jsampler.SamplerChannelModel; |
29 |
|
|
43 |
private JSFxSendsPane mainPane; |
private JSFxSendsPane mainPane; |
44 |
private final SamplerChannelListListener channelListListener; |
private final SamplerChannelListListener channelListListener; |
45 |
|
|
|
private int channelIndex; |
|
|
|
|
46 |
/** Creates a new instance of <code>JSFxSendsDlg</code> */ |
/** Creates a new instance of <code>JSFxSendsDlg</code> */ |
47 |
public |
public |
48 |
JSFxSendsDlg(SamplerChannelModel model) { |
JSFxSendsDlg(SamplerChannelModel model) { |
56 |
|
|
57 |
mainPane = pane; |
mainPane = pane; |
58 |
|
|
59 |
channelIndex = CC.getSamplerModel().getChannelIndex(pane.getChannelModel()) + 1; |
String s = CC.getMainFrame().getChannelPath(pane.getChannelModel()); |
60 |
setTitle(i18n.getLabel("JSFxSendsDlg.title", channelIndex)); |
setTitle(i18n.getLabel("JSFxSendsDlg.title", s)); |
61 |
setModal(false); |
setModal(false); |
62 |
showCloseButton(false); |
showCloseButton(false); |
63 |
|
|
65 |
public void |
public void |
66 |
channelAdded(SamplerChannelListEvent e) { |
channelAdded(SamplerChannelListEvent e) { |
67 |
if(CC.getSamplerModel().getChannelListIsAdjusting()) return; |
if(CC.getSamplerModel().getChannelListIsAdjusting()) return; |
68 |
updateChannelIndex(); |
updateTitle(); |
69 |
} |
} |
70 |
|
|
71 |
public void |
public void |
72 |
channelRemoved(SamplerChannelListEvent e) { |
channelRemoved(SamplerChannelListEvent e) { |
73 |
//if(CC.getSamplerModel().getChannelListIsAdjusting()) return; //TODO: |
//if(CC.getSamplerModel().getChannelListIsAdjusting()) return; //TODO: |
74 |
|
|
75 |
updateChannelIndex(); |
updateTitle(); |
76 |
} |
} |
77 |
}; |
}; |
78 |
|
|
80 |
} |
} |
81 |
|
|
82 |
protected void |
protected void |
83 |
updateChannelIndex() { |
updateTitle() { |
84 |
int i = CC.getSamplerModel().getChannelIndex(mainPane.getChannelModel()); |
SwingUtilities.invokeLater(new Runnable() { |
85 |
if(channelIndex == i) return; |
public void |
86 |
|
run() { |
87 |
|
String s = CC.getMainFrame().getChannelPath(mainPane.getChannelModel()); |
88 |
|
setTitle(i18n.getLabel("JSFxSendsDlg.title", s)); |
89 |
|
} |
90 |
|
}); |
91 |
|
|
|
channelIndex = i; |
|
|
setTitle(i18n.getLabel("JSFxSendsDlg.title", channelIndex + 1)); |
|
92 |
} |
} |
93 |
} |
} |