22 |
|
|
23 |
package org.jsampler; |
package org.jsampler; |
24 |
|
|
25 |
|
import java.awt.event.ActionEvent; |
26 |
|
import java.awt.event.ActionListener; |
27 |
|
|
28 |
|
import javax.swing.SwingUtilities; |
29 |
|
|
30 |
import org.jsampler.view.JSViews; |
import org.jsampler.view.JSViews; |
31 |
|
|
32 |
/** |
/** |
40 |
/** The application version. */ |
/** The application version. */ |
41 |
public final static String VERSION = "0.8a"; |
public final static String VERSION = "0.8a"; |
42 |
|
|
43 |
|
public static String[] scripts; |
44 |
|
|
45 |
|
|
46 |
/** |
/** |
47 |
* The entry point of the application. |
* The entry point of the application. |
50 |
*/ |
*/ |
51 |
public static void |
public static void |
52 |
main(String[] args) { |
main(String[] args) { |
53 |
|
scripts = args; |
54 |
CC.initJSampler(); |
CC.initJSampler(); |
55 |
initGUI(); |
initGUI(); |
56 |
} |
} |
60 |
JSViews.parseManifest(); |
JSViews.parseManifest(); |
61 |
JSViews.setView(JSViews.getDefaultView()); |
JSViews.setView(JSViews.getDefaultView()); |
62 |
|
|
63 |
javax.swing.SwingUtilities.invokeLater(new Runnable() { |
SwingUtilities.invokeLater(new Runnable() { |
64 |
public void |
public void |
65 |
run() { |
run() { initGUI0(); } |
|
CC.checkJSamplerHome(); |
|
|
CC.loadOrchestras(); |
|
|
CC.loadServerList(); |
|
|
CC.connect(); |
|
|
} |
|
66 |
}); |
}); |
67 |
} |
} |
68 |
|
|
69 |
|
private static void |
70 |
|
initGUI0() { |
71 |
|
CC.addConnectionEstablishedListener(new ConnectionEstablishedListener()); |
72 |
|
|
73 |
|
CC.checkJSamplerHome(); |
74 |
|
CC.loadOrchestras(); |
75 |
|
CC.loadServerList(); |
76 |
|
CC.connect(); |
77 |
|
} |
78 |
|
|
79 |
|
private static class ConnectionEstablishedListener implements ActionListener, Runnable { |
80 |
|
@Override |
81 |
|
public void |
82 |
|
actionPerformed(ActionEvent e) { |
83 |
|
if(scripts == null) return; |
84 |
|
for(String s : scripts) CC.getMainFrame().runScript(s); |
85 |
|
SwingUtilities.invokeLater(this); |
86 |
|
} |
87 |
|
|
88 |
|
@Override |
89 |
|
public void |
90 |
|
run() { CC.removeConnectionEstablishedListener(this); } |
91 |
|
} |
92 |
} |
} |