1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2010 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2011 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
22 |
|
|
23 |
package org.jsampler; |
package org.jsampler; |
24 |
|
|
25 |
import java.awt.event.ActionEvent; |
import net.sf.juife.PDUtils; |
26 |
import java.awt.event.ActionListener; |
import net.sf.juife.event.GenericEvent; |
27 |
|
import net.sf.juife.event.GenericListener; |
|
import javax.swing.SwingUtilities; |
|
28 |
|
|
29 |
import org.jsampler.view.JSViews; |
import org.jsampler.view.JSViews; |
30 |
|
|
37 |
public final static String NAME = "JSampler"; |
public final static String NAME = "JSampler"; |
38 |
|
|
39 |
/** The application version. */ |
/** The application version. */ |
40 |
public final static String VERSION = "0.9cvs1"; |
public final static String VERSION = "0.9cvs2"; |
41 |
|
|
42 |
public static String[] scripts; |
public static String[] scripts; |
43 |
|
|
85 |
initGUI() { |
initGUI() { |
86 |
JSViews.parseManifest(); |
JSViews.parseManifest(); |
87 |
|
|
88 |
SwingUtilities.invokeLater(new Runnable() { |
PDUtils.runOnUiThread(new Runnable() { |
89 |
public void |
public void |
90 |
run() { initGUI0(); } |
run() { initGUI0(); } |
91 |
}); |
}); |
104 |
CC.connect(); |
CC.connect(); |
105 |
} |
} |
106 |
|
|
107 |
private static class ConnectionEstablishedListener implements ActionListener, Runnable { |
private static class ConnectionEstablishedListener implements GenericListener, Runnable { |
|
@Override |
|
108 |
public void |
public void |
109 |
actionPerformed(ActionEvent e) { |
jobDone(GenericEvent e) { |
110 |
if(scripts == null) return; |
if(scripts == null) return; |
111 |
for(String s : scripts) CC.getMainFrame().runScript(s); |
for(String s : scripts) CC.getMainFrame().runScript(s); |
112 |
scripts = null; |
scripts = null; |
113 |
SwingUtilities.invokeLater(this); |
PDUtils.runOnUiThread(this); |
114 |
} |
} |
115 |
|
|
|
@Override |
|
116 |
public void |
public void |
117 |
run() { CC.removeConnectionEstablishedListener(this); } |
run() { CC.removeConnectionEstablishedListener(this); } |
118 |
} |
} |