54 |
import net.sf.juife.Dial; |
import net.sf.juife.Dial; |
55 |
|
|
56 |
import org.jsampler.CC; |
import org.jsampler.CC; |
57 |
|
import org.jsampler.view.fantasia.basic.PixmapPane; |
58 |
|
import org.jsampler.view.fantasia.basic.PixmapButton; |
59 |
|
|
60 |
import org.jvnet.substance.utils.SubstanceImageCreator; |
import org.jvnet.substance.utils.SubstanceImageCreator; |
61 |
|
|
211 |
// Implementation of the ChannelView interface |
// Implementation of the ChannelView interface |
212 |
////////////////////////////////////////////// |
////////////////////////////////////////////// |
213 |
|
|
214 |
|
@Override |
215 |
public Type |
public Type |
216 |
getType() { return Type.NORMAL; } |
getType() { return Type.NORMAL; } |
217 |
|
|
218 |
|
@Override |
219 |
public JComponent |
public JComponent |
220 |
getComponent() { return this; } |
getComponent() { return this; } |
221 |
|
|
222 |
|
@Override |
223 |
public void |
public void |
224 |
installView() { |
installView() { |
225 |
String vmud = VOL_MEASUREMENT_UNIT_DECIBEL; |
String vmud = VOL_MEASUREMENT_UNIT_DECIBEL; |
238 |
addEnhancedMouseListener(getHandler()); |
addEnhancedMouseListener(getHandler()); |
239 |
} |
} |
240 |
|
|
241 |
|
@Override |
242 |
public void |
public void |
243 |
uninstallView() { |
uninstallView() { |
244 |
screen.onDestroy(); |
screen.onDestroy(); |
248 |
removeEnhancedMouseListener(getHandler()); |
removeEnhancedMouseListener(getHandler()); |
249 |
} |
} |
250 |
|
|
251 |
|
@Override |
252 |
public void |
public void |
253 |
installChannelOptionsView() { |
installChannelOptionsView() { |
254 |
if(channelOptionsView != null) return; |
if(channelOptionsView != null) return; |
258 |
|
|
259 |
} |
} |
260 |
|
|
261 |
|
@Override |
262 |
public void |
public void |
263 |
uninstallChannelOptionsView() { |
uninstallChannelOptionsView() { |
264 |
if(channelOptionsView == null) return; |
if(channelOptionsView == null) return; |
266 |
channelOptionsView = null; |
channelOptionsView = null; |
267 |
} |
} |
268 |
|
|
269 |
|
@Override |
270 |
public ChannelOptionsView |
public ChannelOptionsView |
271 |
getChannelOptionsView() { return channelOptionsView; } |
getChannelOptionsView() { return channelOptionsView; } |
272 |
|
|
273 |
|
@Override |
274 |
public void |
public void |
275 |
updateChannelInfo() { |
updateChannelInfo() { |
276 |
SamplerChannel sc = channel.getChannelInfo(); |
SamplerChannel sc = channel.getChannelInfo(); |
292 |
if(getChannelOptionsView() != null) getChannelOptionsView().updateChannelInfo(); |
if(getChannelOptionsView() != null) getChannelOptionsView().updateChannelInfo(); |
293 |
} |
} |
294 |
|
|
295 |
|
@Override |
296 |
public void |
public void |
297 |
updateStreamCount(int count) { screen.updateStreamCount(count); } |
updateStreamCount(int count) { screen.updateStreamCount(count); } |
298 |
|
|
299 |
|
@Override |
300 |
public void |
public void |
301 |
updateVoiceCount(int count) { screen.updateVoiceCount(count); } |
updateVoiceCount(int count) { screen.updateVoiceCount(count); } |
302 |
|
|
303 |
|
@Override |
304 |
public void |
public void |
305 |
expandChannel() { |
expandChannel() { |
306 |
if(btnOptions.isSelected()) return; |
if(btnOptions.isSelected()) return; |
307 |
btnOptions.doClick(); |
btnOptions.doClick(); |
308 |
} |
} |
309 |
|
|
310 |
|
@Override |
311 |
public boolean |
public boolean |
312 |
isOptionsButtonSelected() { return btnOptions.isSelected(); } |
isOptionsButtonSelected() { return btnOptions.isSelected(); } |
313 |
|
|
314 |
|
@Override |
315 |
public void |
public void |
316 |
setOptionsButtonSelected(boolean b) { |
setOptionsButtonSelected(boolean b) { |
317 |
btnOptions.setSelected(b); |
btnOptions.setSelected(b); |
318 |
} |
} |
319 |
|
|
320 |
|
@Override |
321 |
public void |
public void |
322 |
addEnhancedMouseListener(MouseListener l) { |
addEnhancedMouseListener(MouseListener l) { |
323 |
removeEnhancedMouseListener(l); |
removeEnhancedMouseListener(l); |
326 |
screen.addEnhancedMouseListener(l); |
screen.addEnhancedMouseListener(l); |
327 |
} |
} |
328 |
|
|
329 |
|
@Override |
330 |
public void |
public void |
331 |
removeEnhancedMouseListener(MouseListener l) { |
removeEnhancedMouseListener(MouseListener l) { |
332 |
for(JComponent c : components) c.removeMouseListener(l); |
for(JComponent c : components) c.removeMouseListener(l); |
430 |
addActionListener(this); |
addActionListener(this); |
431 |
} |
} |
432 |
|
|
433 |
|
@Override |
434 |
public void |
public void |
435 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
436 |
SamplerChannel sc = channel.getChannelInfo(); |
SamplerChannel sc = channel.getChannelInfo(); |
451 |
channel.getModel().setBackendMute(b); |
channel.getModel().setBackendMute(b); |
452 |
} |
} |
453 |
|
|
454 |
|
@Override |
455 |
public boolean |
public boolean |
456 |
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); } |
457 |
} |
} |
466 |
addActionListener(this); |
addActionListener(this); |
467 |
} |
} |
468 |
|
|
469 |
|
@Override |
470 |
public void |
public void |
471 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
472 |
SamplerChannel sc = channel.getChannelInfo(); |
SamplerChannel sc = channel.getChannelInfo(); |
488 |
channel.getModel().setBackendSolo(b); |
channel.getModel().setBackendSolo(b); |
489 |
} |
} |
490 |
|
|
491 |
|
@Override |
492 |
public boolean |
public boolean |
493 |
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); } |
494 |
} |
} |
499 |
getHandler() { return eventHandler; } |
getHandler() { return eventHandler; } |
500 |
|
|
501 |
private class EventHandler extends MouseAdapter { |
private class EventHandler extends MouseAdapter { |
502 |
|
@Override |
503 |
public void |
public void |
504 |
mouseClicked(MouseEvent e) { |
mouseClicked(MouseEvent e) { |
505 |
if(e.getButton() != e.BUTTON1) return; |
if(e.getButton() != e.BUTTON1) return; |
506 |
// TAG: channel selection system |
// TAG: channel selection system |
507 |
CC.getMainFrame().getChannelsPane(0).setSelectedChannel(channel); |
CC.getMainFrame().getSelectedChannelsPane().setSelectedChannel(channel); |
508 |
/////// |
/////// |
509 |
} |
} |
510 |
} |
} |
815 |
setPreferredSize(new Dimension(getPreferredSize().width, 13)); |
setPreferredSize(new Dimension(getPreferredSize().width, 13)); |
816 |
} |
} |
817 |
|
|
818 |
|
@Override |
819 |
public Dimension |
public Dimension |
820 |
getPreferredSize() { |
getPreferredSize() { |
821 |
return new Dimension(super.getPreferredSize().width, 13); |
return new Dimension(super.getPreferredSize().width, 13); |
829 |
getHandler() { return eventHandler; } |
getHandler() { return eventHandler; } |
830 |
|
|
831 |
private class EventHandler extends MouseAdapter implements HierarchyListener { |
private class EventHandler extends MouseAdapter implements HierarchyListener { |
832 |
|
@Override |
833 |
public void |
public void |
834 |
mouseEntered(MouseEvent e) { |
mouseEntered(MouseEvent e) { |
835 |
if(channel.getChannelInfo().getInstrumentStatus() != 100) return; |
if(channel.getChannelInfo().getInstrumentStatus() != 100) return; |
840 |
} |
} |
841 |
} |
} |
842 |
|
|
843 |
|
@Override |
844 |
public void |
public void |
845 |
mouseExited(MouseEvent e) { |
mouseExited(MouseEvent e) { |
846 |
if(getMousePosition(true) != null) return; |
if(getMousePosition(true) != null) return; |
851 |
} |
} |
852 |
|
|
853 |
/** Called when the hierarchy has been changed. */ |
/** Called when the hierarchy has been changed. */ |
854 |
|
@Override |
855 |
public void |
public void |
856 |
hierarchyChanged(HierarchyEvent e) { |
hierarchyChanged(HierarchyEvent e) { |
857 |
if((e.getChangeFlags() & e.SHOWING_CHANGED) == e.SHOWING_CHANGED) { |
if((e.getChangeFlags() & e.SHOWING_CHANGED) == e.SHOWING_CHANGED) { |