27 |
|
|
28 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
29 |
import java.awt.event.ActionListener; |
import java.awt.event.ActionListener; |
|
import java.awt.event.MouseAdapter; |
|
|
import java.awt.event.MouseEvent; |
|
30 |
|
|
31 |
import javax.swing.AbstractAction; |
import javax.swing.AbstractAction; |
32 |
import javax.swing.Action; |
import javax.swing.Action; |
43 |
import javax.swing.JSplitPane; |
import javax.swing.JSplitPane; |
44 |
import javax.swing.JTable; |
import javax.swing.JTable; |
45 |
import javax.swing.JToolBar; |
import javax.swing.JToolBar; |
|
import javax.swing.JToolTip; |
|
|
import javax.swing.Popup; |
|
|
import javax.swing.PopupFactory; |
|
46 |
|
|
47 |
import javax.swing.event.ChangeEvent; |
import javax.swing.event.ChangeEvent; |
48 |
import javax.swing.event.ChangeListener; |
import javax.swing.event.ChangeListener; |
58 |
|
|
59 |
import org.jsampler.AudioDeviceModel; |
import org.jsampler.AudioDeviceModel; |
60 |
import org.jsampler.CC; |
import org.jsampler.CC; |
61 |
|
import org.jsampler.HF; |
62 |
|
import org.jsampler.JSPrefs; |
63 |
import org.jsampler.SamplerChannelModel; |
import org.jsampler.SamplerChannelModel; |
64 |
|
|
65 |
import org.jsampler.event.EffectSendsAdapter; |
import org.jsampler.event.EffectSendsAdapter; |
88 |
protected final Action actionRemoveFxSend = new RemoveFxSendAction(); |
protected final Action actionRemoveFxSend = new RemoveFxSendAction(); |
89 |
|
|
90 |
private final JComboBox cbMidiCtrls = new JComboBox(); |
private final JComboBox cbMidiCtrls = new JComboBox(); |
91 |
private final JSlider slVolume = new JSlider(0, 100, 100); |
private final JSlider slVolume = StdUtils.createVolumeSlider(); |
|
private Popup popup = null; |
|
|
private final JToolTip tip = new JToolTip(); |
|
92 |
|
|
93 |
private final JLabel lMidiCtrl = new JLabel(i18n.getLabel("JSFxSendsPane.lMidiCtrl")); |
private final JLabel lMidiCtrl = new JLabel(i18n.getLabel("JSFxSendsPane.lMidiCtrl")); |
94 |
private final JLabel lVolume = new JLabel(i18n.getLabel("JSFxSendsPane.lVolume")); |
private final JLabel lVolume = new JLabel(i18n.getLabel("JSFxSendsPane.lVolume")); |
143 |
int h = d.height > 300 ? d.height : 300; |
int h = d.height > 300 ? d.height : 300; |
144 |
setPreferredSize(new Dimension(w, h)); |
setPreferredSize(new Dimension(w, h)); |
145 |
splitPane.setDividerLocation(200); |
splitPane.setDividerLocation(200); |
|
|
|
|
// Setting the tooltip size |
|
|
tip.setTipText(i18n.getLabel("JSFxSendsPane.volume", 100)); |
|
|
tip.setMinimumSize(tip.getPreferredSize()); |
|
|
tip.setPreferredSize(tip.getPreferredSize()); // workaround for preserving that size |
|
|
tip.setComponent(slVolume); |
|
|
/////// |
|
|
|
|
|
slVolume.addMouseListener(new MouseAdapter() { |
|
|
public void |
|
|
mousePressed(MouseEvent e) { |
|
|
if(popup != null) { |
|
|
popup.hide(); |
|
|
popup = null; |
|
|
} |
|
|
|
|
|
java.awt.Point p = slVolume.getLocationOnScreen(); |
|
|
PopupFactory pf = PopupFactory.getSharedInstance(); |
|
|
popup = pf.getPopup(slVolume, tip, p.x, p.y - 22); |
|
|
popup.show(); |
|
|
} |
|
|
|
|
|
public void |
|
|
mouseReleased(MouseEvent e) { |
|
|
if(popup != null) { |
|
|
popup.hide(); |
|
|
popup = null; |
|
|
} |
|
|
} |
|
|
}); |
|
146 |
} |
} |
147 |
|
|
148 |
|
protected JSPrefs |
149 |
|
preferences() { return CC.getViewConfig().preferences(); } |
150 |
|
|
151 |
protected JToolBar |
protected JToolBar |
152 |
createToolBar() { |
createToolBar() { |
153 |
JToolBar tb = new JToolBar(); |
JToolBar tb = new JToolBar(); |
231 |
|
|
232 |
private void |
private void |
233 |
setVolume() { |
setVolume() { |
|
String s = i18n.getLabel("JSFxSendsPane.volume", slVolume.getValue()); |
|
|
slVolume.setToolTipText(s); |
|
|
tip.setTipText(s); |
|
|
tip.repaint(); |
|
234 |
if(fxSend == null || slVolume.getValueIsAdjusting()) return; |
if(fxSend == null || slVolume.getValueIsAdjusting()) return; |
235 |
|
|
236 |
int i = (int)(fxSend.getLevel() * 100); |
int i = (int)(fxSend.getLevel() * 100); |