36 |
import javax.swing.AbstractAction; |
import javax.swing.AbstractAction; |
37 |
import javax.swing.Action; |
import javax.swing.Action; |
38 |
import javax.swing.ImageIcon; |
import javax.swing.ImageIcon; |
|
import javax.swing.JOptionPane; |
|
39 |
|
|
40 |
import org.jsampler.CC; |
import org.jsampler.CC; |
41 |
import org.jsampler.HF; |
import org.jsampler.HF; |
76 |
} |
} |
77 |
|
|
78 |
public void |
public void |
79 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { CC.reconnect(); } |
|
CC.initSamplerModel(); |
|
|
} |
|
80 |
} |
} |
81 |
|
|
82 |
public final static Action samplerInfo = new SamplerInfo(); |
public final static Action samplerInfo = new SamplerInfo(); |
153 |
super(""); |
super(""); |
154 |
|
|
155 |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttAddMidiDevice")); |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttAddMidiDevice")); |
156 |
|
putValue(Action.SMALL_ICON, Res.iconNew16); |
|
try { |
|
|
URL url = ClassLoader.getSystemClassLoader().getResource ( |
|
|
"org/jsampler/view/classic/res/icons/New16.gif" |
|
|
); |
|
|
|
|
|
ImageIcon icon = new ImageIcon(url); |
|
|
if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) |
|
|
putValue(Action.SMALL_ICON, icon); |
|
|
} catch(Exception x) { |
|
|
CC.getLogger().log(Level.INFO, HF.getErrorMessage(x), x); |
|
|
} |
|
157 |
} |
} |
158 |
|
|
159 |
public void |
public void |
170 |
super(""); |
super(""); |
171 |
|
|
172 |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttAddAudioDevice")); |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttAddAudioDevice")); |
173 |
|
putValue(Action.SMALL_ICON, Res.iconNew16); |
|
try { |
|
|
URL url = ClassLoader.getSystemClassLoader().getResource ( |
|
|
"org/jsampler/view/classic/res/icons/New16.gif" |
|
|
); |
|
|
|
|
|
ImageIcon icon = new ImageIcon(url); |
|
|
if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) |
|
|
putValue(Action.SMALL_ICON, icon); |
|
|
} catch(Exception x) { |
|
|
CC.getLogger().log(Level.INFO, HF.getErrorMessage(x), x); |
|
|
} |
|
174 |
} |
} |
175 |
|
|
176 |
public void |
public void |
188 |
super(i18n.getMenuLabel("edit.preferences")); |
super(i18n.getMenuLabel("edit.preferences")); |
189 |
|
|
190 |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttPrefs")); |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttPrefs")); |
191 |
|
putValue(Action.SMALL_ICON, Res.iconPreferences24); |
|
try { |
|
|
URL url = ClassLoader.getSystemClassLoader().getResource ( |
|
|
"org/jsampler/view/classic/res/icons/toolbar/Preferences24.gif" |
|
|
); |
|
|
|
|
|
ImageIcon icon = new ImageIcon(url); |
|
|
if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) |
|
|
putValue(Action.SMALL_ICON, icon); |
|
|
} catch(Exception x) { |
|
|
CC.getLogger().log(Level.INFO, HF.getErrorMessage(x), x); |
|
|
} |
|
192 |
} |
} |
193 |
|
|
194 |
public void |
public void |
195 |
actionPerformed(ActionEvent e) { new PrefsDlg(CC.getMainFrame()).setVisible(true); } |
actionPerformed(ActionEvent e) { new PrefsDlg(CC.getMainFrame()).setVisible(true); } |
196 |
} |
} |
197 |
|
|
198 |
|
// VIEW |
199 |
|
|
200 |
|
|
201 |
|
|
202 |
// CHANNELS |
// CHANNELS |
203 |
public final static Action newChannel = new NewChannel(); |
public final static Action newChannel = new NewChannel(); |
220 |
super(i18n.getMenuLabel("channels.new")); |
super(i18n.getMenuLabel("channels.new")); |
221 |
|
|
222 |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttNewChannel")); |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttNewChannel")); |
223 |
|
putValue(Action.SMALL_ICON, Res.iconNew24); |
|
try { |
|
|
URL url = ClassLoader.getSystemClassLoader().getResource ( |
|
|
"org/jsampler/view/classic/res/icons/toolbar/New24.gif" |
|
|
); |
|
|
|
|
|
ImageIcon icon = new ImageIcon(url); |
|
|
if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) |
|
|
putValue(Action.SMALL_ICON, icon); |
|
|
} catch(Exception x) { |
|
|
CC.getLogger().log(Level.INFO, HF.getErrorMessage(x), x); |
|
|
} |
|
224 |
} |
} |
225 |
|
|
226 |
public void |
public void |
248 |
super(i18n.getMenuLabel("channels.duplicate")); |
super(i18n.getMenuLabel("channels.duplicate")); |
249 |
|
|
250 |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttDuplicateChannels")); |
putValue(SHORT_DESCRIPTION, i18n.getMenuLabel("ttDuplicateChannels")); |
251 |
|
putValue(Action.SMALL_ICON, Res.iconCopy24); |
|
try { |
|
|
URL url = ClassLoader.getSystemClassLoader().getResource ( |
|
|
"org/jsampler/view/classic/res/icons/toolbar/Copy24.gif" |
|
|
); |
|
|
|
|
|
ImageIcon icon = new ImageIcon(url); |
|
|
if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) |
|
|
putValue(Action.SMALL_ICON, icon); |
|
|
} catch(Exception x) { |
|
|
CC.getLogger().log(Level.INFO, HF.getErrorMessage(x), x); |
|
|
} |
|
252 |
|
|
253 |
setEnabled(false); |
setEnabled(false); |
254 |
} |
} |
462 |
removeChannel(final JSChannel c) { |
removeChannel(final JSChannel c) { |
463 |
final JSChannelsPane p = CC.getMainFrame().getSelectedChannelsPane(); |
final JSChannelsPane p = CC.getMainFrame().getSelectedChannelsPane(); |
464 |
int id = c.getChannelInfo().getChannelID(); |
int id = c.getChannelInfo().getChannelID(); |
|
final org.jsampler.task.RemoveChannel rc = |
|
|
new org.jsampler.task.RemoveChannel(id); |
|
|
|
|
|
rc.addTaskListener(new TaskListener() { |
|
|
public void |
|
|
taskPerformed(TaskEvent e) { |
|
|
if(rc.doneWithErrors()) return; |
|
|
|
|
|
p.removeChannel(c); |
|
|
} |
|
|
}); |
|
465 |
|
|
466 |
CC.getTaskQueue().add(rc); |
CC.getTaskQueue().add(new org.jsampler.task.RemoveChannel(id)); |
467 |
} |
} |
468 |
} |
} |
469 |
|
|