29 |
|
|
30 |
import org.jsampler.CC; |
import org.jsampler.CC; |
31 |
import org.jsampler.HF; |
import org.jsampler.HF; |
32 |
|
import org.jsampler.view.JSChannel; |
33 |
import org.jsampler.view.std.JSNewAudioDeviceDlg; |
import org.jsampler.view.std.JSNewAudioDeviceDlg; |
34 |
import org.jsampler.view.std.JSNewMidiDeviceDlg; |
import org.jsampler.view.std.JSNewMidiDeviceDlg; |
35 |
import org.jsampler.view.std.StdA4n; |
import org.jsampler.view.std.StdA4n; |
52 |
//exportMidiInstrumentMaps.putValue(Action.SMALL_ICON, Res.icon); |
//exportMidiInstrumentMaps.putValue(Action.SMALL_ICON, Res.icon); |
53 |
} |
} |
54 |
|
|
55 |
|
@Override |
56 |
protected FantasiaPrefs |
protected FantasiaPrefs |
57 |
preferences() { |
preferences() { return FantasiaPrefs.preferences(); } |
|
return FantasiaPrefs.preferences(); |
|
|
} |
|
58 |
|
|
59 |
public final Action samplerInfo = new SamplerInfo(); |
public final Action samplerInfo = new SamplerInfo(); |
60 |
|
|
66 |
putValue(Action.SMALL_ICON, Res.iconSamplerInfo32); |
putValue(Action.SMALL_ICON, Res.iconSamplerInfo32); |
67 |
} |
} |
68 |
|
|
69 |
|
@Override |
70 |
public void |
public void |
71 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
72 |
new SamplerInfoDlg(CC.getMainFrame()).setVisible(true); |
new SamplerInfoDlg(CC.getMainFrame()).setVisible(true); |
83 |
putValue(Action.SMALL_ICON, Res.iconOpen32); |
putValue(Action.SMALL_ICON, Res.iconOpen32); |
84 |
} |
} |
85 |
|
|
86 |
|
@Override |
87 |
public void |
public void |
88 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
89 |
if(!((MainFrame)CC.getMainFrame()).runScript()) return; |
if(!((MainFrame)CC.getMainFrame()).runScript()) return; |
105 |
//putValue(Action.SMALL_ICON, Res.iconNew16); |
//putValue(Action.SMALL_ICON, Res.iconNew16); |
106 |
} |
} |
107 |
|
|
108 |
|
@Override |
109 |
public void |
public void |
110 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
111 |
if(!CC.verifyConnection()) return; |
if(!CC.verifyConnection()) return; |
124 |
//putValue(Action.SMALL_ICON, Res.iconNew16); |
//putValue(Action.SMALL_ICON, Res.iconNew16); |
125 |
} |
} |
126 |
|
|
127 |
|
@Override |
128 |
public void |
public void |
129 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
130 |
if(!CC.verifyConnection()) return; |
if(!CC.verifyConnection()) return; |
144 |
putValue(Action.SMALL_ICON, Res.iconPreferences32); |
putValue(Action.SMALL_ICON, Res.iconPreferences32); |
145 |
} |
} |
146 |
|
|
147 |
|
@Override |
148 |
public void |
public void |
149 |
actionPerformed(ActionEvent e) { new PrefsDlg(CC.getMainFrame()).setVisible(true); } |
actionPerformed(ActionEvent e) { new PrefsDlg(CC.getMainFrame()).setVisible(true); } |
150 |
} |
} |
151 |
|
|
152 |
|
|
153 |
|
// CHANNELS |
154 |
|
|
155 |
|
public final Action setSmallView = new SetView(ChannelView.Type.SMALL); |
156 |
|
public final Action setNormalView = new SetView(ChannelView.Type.NORMAL); |
157 |
|
|
158 |
|
public static class SetView extends AbstractAction { |
159 |
|
private ChannelView.Type type; |
160 |
|
|
161 |
|
SetView(ChannelView.Type type) { |
162 |
|
this.type = type; |
163 |
|
|
164 |
|
switch(type) { |
165 |
|
case SMALL: |
166 |
|
putValue(Action.NAME, i18n.getMenuLabel("channels.smallView")); |
167 |
|
break; |
168 |
|
case NORMAL: |
169 |
|
putValue(Action.NAME, i18n.getMenuLabel("channels.normalView")); |
170 |
|
break; |
171 |
|
} |
172 |
|
} |
173 |
|
|
174 |
|
@Override |
175 |
|
public void |
176 |
|
actionPerformed(ActionEvent e) { |
177 |
|
JSChannel[] channels = |
178 |
|
CC.getMainFrame().getSelectedChannelsPane().getSelectedChannels(); |
179 |
|
|
180 |
|
for(JSChannel c : channels) { |
181 |
|
Channel c2 = (Channel)c; |
182 |
|
if(c2.getViewTracker().getOriginalView().getType() == type) { |
183 |
|
continue; |
184 |
|
} |
185 |
|
|
186 |
|
c2.getViewTracker().setView(createView(type, c2)); |
187 |
|
} |
188 |
|
|
189 |
|
MenuManager.getMenuManager().updateChannelViewGroups(); |
190 |
|
} |
191 |
|
|
192 |
|
public static int |
193 |
|
getViewCount(ChannelView.Type type) { |
194 |
|
int count = 0; |
195 |
|
|
196 |
|
JSChannel[] channels = |
197 |
|
CC.getMainFrame().getSelectedChannelsPane().getSelectedChannels(); |
198 |
|
|
199 |
|
for(JSChannel c : channels) { |
200 |
|
Channel c2 = (Channel)c; |
201 |
|
if(c2.getViewTracker().getOriginalView().getType() == type) { |
202 |
|
count++; |
203 |
|
} |
204 |
|
} |
205 |
|
|
206 |
|
return count; |
207 |
|
} |
208 |
|
|
209 |
|
public ChannelView |
210 |
|
createView(ChannelView.Type type, Channel channel) { |
211 |
|
switch(type) { |
212 |
|
case SMALL: return new SmallChannelView(channel); |
213 |
|
case NORMAL: return new NormalChannelView(channel); |
214 |
|
} |
215 |
|
|
216 |
|
throw new IllegalArgumentException("Unknown channel type"); |
217 |
|
} |
218 |
|
} |
219 |
|
|
220 |
// WINDOW |
// WINDOW |
221 |
public final Action windowLSConsole = new WindowLSConsole(); |
public final Action windowLSConsole = new WindowLSConsole(); |
222 |
|
|
227 |
putValue(Action.SMALL_ICON, Res.iconLSConsole32); |
putValue(Action.SMALL_ICON, Res.iconLSConsole32); |
228 |
} |
} |
229 |
|
|
230 |
|
@Override |
231 |
public void |
public void |
232 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
233 |
LSConsoleFrame console = ((MainFrame)CC.getMainFrame()).getLSConsoleFrame(); |
LSConsoleFrame console = ((MainFrame)CC.getMainFrame()).getLSConsoleFrame(); |
249 |
putValue(Action.SMALL_ICON, Res.iconDb32); |
putValue(Action.SMALL_ICON, Res.iconDb32); |
250 |
} |
} |
251 |
|
|
252 |
|
@Override |
253 |
public void |
public void |
254 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
255 |
if(!CC.verifyConnection()) return; |
if(!CC.verifyConnection()) return; |
279 |
super(i18n.getMenuLabel("help.about", "Fantasia")); |
super(i18n.getMenuLabel("help.about", "Fantasia")); |
280 |
} |
} |
281 |
|
|
282 |
|
@Override |
283 |
public void |
public void |
284 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
285 |
new HelpAboutDlg(CC.getMainFrame()).setVisible(true); |
new HelpAboutDlg(CC.getMainFrame()).setVisible(true); |