48 |
import org.jsampler.event.SamplerChannelListEvent; |
import org.jsampler.event.SamplerChannelListEvent; |
49 |
import org.jsampler.event.SamplerChannelListListener; |
import org.jsampler.event.SamplerChannelListListener; |
50 |
|
|
51 |
|
import org.jsampler.view.fantasia.basic.PixmapButton; |
52 |
|
import org.jsampler.view.fantasia.basic.PixmapPane; |
53 |
|
|
54 |
import org.jvnet.substance.utils.SubstanceImageCreator; |
import org.jvnet.substance.utils.SubstanceImageCreator; |
55 |
|
|
56 |
import org.linuxsampler.lscp.SamplerChannel; |
import org.linuxsampler.lscp.SamplerChannel; |
137 |
// Implementation of the ChannelView interface |
// Implementation of the ChannelView interface |
138 |
////////////////////////////////////////////// |
////////////////////////////////////////////// |
139 |
|
|
140 |
|
@Override |
141 |
public Type |
public Type |
142 |
getType() { return Type.SMALL; } |
getType() { return Type.SMALL; } |
143 |
|
|
144 |
|
@Override |
145 |
public JComponent |
public JComponent |
146 |
getComponent() { return this; } |
getComponent() { return this; } |
147 |
|
|
148 |
|
@Override |
149 |
public void |
public void |
150 |
installView() { |
installView() { |
151 |
String vmud = VOL_MEASUREMENT_UNIT_DECIBEL; |
String vmud = VOL_MEASUREMENT_UNIT_DECIBEL; |
163 |
addEnhancedMouseListener(getHandler()); |
addEnhancedMouseListener(getHandler()); |
164 |
} |
} |
165 |
|
|
166 |
|
@Override |
167 |
public void |
public void |
168 |
uninstallView() { |
uninstallView() { |
169 |
//removeEnhancedMouseListener(channel.getContextMenu()); |
//removeEnhancedMouseListener(channel.getContextMenu()); |
174 |
removeEnhancedMouseListener(getHandler()); |
removeEnhancedMouseListener(getHandler()); |
175 |
} |
} |
176 |
|
|
177 |
|
@Override |
178 |
public void |
public void |
179 |
installChannelOptionsView() { |
installChannelOptionsView() { |
180 |
if(channelOptionsView != null) return; |
if(channelOptionsView != null) return; |
184 |
|
|
185 |
} |
} |
186 |
|
|
187 |
|
@Override |
188 |
public void |
public void |
189 |
uninstallChannelOptionsView() { |
uninstallChannelOptionsView() { |
190 |
if(channelOptionsView == null) return; |
if(channelOptionsView == null) return; |
192 |
channelOptionsView = null; |
channelOptionsView = null; |
193 |
} |
} |
194 |
|
|
195 |
|
@Override |
196 |
public ChannelOptionsView |
public ChannelOptionsView |
197 |
getChannelOptionsView() { return channelOptionsView; } |
getChannelOptionsView() { return channelOptionsView; } |
198 |
|
|
199 |
|
@Override |
200 |
public void |
public void |
201 |
updateChannelInfo() { |
updateChannelInfo() { |
202 |
SamplerChannel sc = channel.getChannelInfo(); |
SamplerChannel sc = channel.getChannelInfo(); |
215 |
if(getChannelOptionsView() != null) getChannelOptionsView().updateChannelInfo(); |
if(getChannelOptionsView() != null) getChannelOptionsView().updateChannelInfo(); |
216 |
} |
} |
217 |
|
|
218 |
|
@Override |
219 |
public void |
public void |
220 |
updateStreamCount(int count) { screen.updateStreamCount(count); } |
updateStreamCount(int count) { screen.updateStreamCount(count); } |
221 |
|
|
222 |
|
@Override |
223 |
public void |
public void |
224 |
updateVoiceCount(int count) { screen.updateVoiceCount(count); } |
updateVoiceCount(int count) { screen.updateVoiceCount(count); } |
225 |
|
|
226 |
|
@Override |
227 |
public void |
public void |
228 |
expandChannel() { |
expandChannel() { |
229 |
if(btnOptions.isSelected()) return; |
if(btnOptions.isSelected()) return; |
230 |
btnOptions.doClick(); |
btnOptions.doClick(); |
231 |
} |
} |
232 |
|
|
233 |
|
@Override |
234 |
public boolean |
public boolean |
235 |
isOptionsButtonSelected() { return btnOptions.isSelected(); } |
isOptionsButtonSelected() { return btnOptions.isSelected(); } |
236 |
|
|
237 |
|
@Override |
238 |
public void |
public void |
239 |
setOptionsButtonSelected(boolean b) { |
setOptionsButtonSelected(boolean b) { |
240 |
btnOptions.setSelected(b); |
btnOptions.setSelected(b); |
241 |
} |
} |
242 |
|
|
243 |
|
@Override |
244 |
public void |
public void |
245 |
addEnhancedMouseListener(MouseListener l) { |
addEnhancedMouseListener(MouseListener l) { |
246 |
removeEnhancedMouseListener(l); |
removeEnhancedMouseListener(l); |
249 |
screen.addEnhancedMouseListener(l); |
screen.addEnhancedMouseListener(l); |
250 |
} |
} |
251 |
|
|
252 |
|
@Override |
253 |
public void |
public void |
254 |
removeEnhancedMouseListener(MouseListener l) { |
removeEnhancedMouseListener(MouseListener l) { |
255 |
for(JComponent c : components) c.removeMouseListener(l); |
for(JComponent c : components) c.removeMouseListener(l); |
289 |
getHandler() { return eventHandler; } |
getHandler() { return eventHandler; } |
290 |
|
|
291 |
private class EventHandler extends MouseAdapter implements SamplerChannelListListener { |
private class EventHandler extends MouseAdapter implements SamplerChannelListListener { |
292 |
|
@Override |
293 |
public void |
public void |
294 |
channelAdded(SamplerChannelListEvent e) { |
channelAdded(SamplerChannelListEvent e) { |
295 |
if(CC.getSamplerModel().getChannelListIsAdjusting()) return; |
if(CC.getSamplerModel().getChannelListIsAdjusting()) return; |
296 |
screen.channelInfoPane.updateChannelIndex(); |
screen.channelInfoPane.updateChannelIndex(); |
297 |
} |
} |
298 |
|
|
299 |
|
@Override |
300 |
public void |
public void |
301 |
channelRemoved(SamplerChannelListEvent e) { |
channelRemoved(SamplerChannelListEvent e) { |
302 |
//if(CC.getSamplerModel().getChannelListIsAdjusting()) return; //TODO: |
//if(CC.getSamplerModel().getChannelListIsAdjusting()) return; //TODO: |
304 |
screen.channelInfoPane.updateChannelIndex(); |
screen.channelInfoPane.updateChannelIndex(); |
305 |
} |
} |
306 |
|
|
307 |
|
@Override |
308 |
public void |
public void |
309 |
mouseClicked(MouseEvent e) { |
mouseClicked(MouseEvent e) { |
310 |
if(e.getButton() != e.BUTTON1) return; |
if(e.getButton() != e.BUTTON1) return; |
311 |
// TAG: channel selection system |
// TAG: channel selection system |
312 |
CC.getMainFrame().getChannelsPane(0).setSelectedChannel(channel); |
CC.getMainFrame().getSelectedChannelsPane().setSelectedChannel(channel); |
313 |
/////// |
/////// |
314 |
} |
} |
315 |
} |
} |
324 |
addActionListener(this); |
addActionListener(this); |
325 |
} |
} |
326 |
|
|
327 |
|
@Override |
328 |
public void |
public void |
329 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
330 |
SamplerChannel sc = channel.getChannelInfo(); |
SamplerChannel sc = channel.getChannelInfo(); |
359 |
addActionListener(this); |
addActionListener(this); |
360 |
} |
} |
361 |
|
|
362 |
|
@Override |
363 |
public void |
public void |
364 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
365 |
SamplerChannel sc = channel.getChannelInfo(); |
SamplerChannel sc = channel.getChannelInfo(); |
656 |
|
|
657 |
protected void |
protected void |
658 |
updateChannelIndex() { |
updateChannelIndex() { |
659 |
int i = CC.getSamplerModel().getChannelIndex(channel.getModel()); |
int i = CC.getMainFrame().getChannelNumber(channel.getModel()); |
660 |
|
|
661 |
boolean b = false; |
boolean b = false; |
662 |
if(i > 98 && channelIndex <= 98) b = true; |
if(i > 98 && channelIndex <= 98) b = true; |
707 |
addActionListener(this); |
addActionListener(this); |
708 |
} |
} |
709 |
|
|
710 |
|
@Override |
711 |
public void |
public void |
712 |
actionPerformed(ActionEvent e) { channel.showFxSendsDialog(); } |
actionPerformed(ActionEvent e) { channel.showFxSendsDialog(); } |
713 |
|
|
714 |
|
@Override |
715 |
public boolean |
public boolean |
716 |
contains(int x, int y) { return (x > 5 && x < 23) && (y > 5 && y < 16); } |
contains(int x, int y) { return (x > 5 && x < 23) && (y > 5 && y < 16); } |
717 |
} |
} |