/[svn]/jsampler/trunk/src/org/jsampler/JSampler.java
ViewVC logotype

Contents of /jsampler/trunk/src/org/jsampler/JSampler.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1786 - (show annotations) (download)
Wed Oct 8 22:38:15 2008 UTC (15 years, 6 months ago) by iliev
File size: 2293 byte(s)
* Implemented option to launch the backend if it is not yet started
  (choose Edit/Preferences, then click the `Backend' tab)
* LSCP scripts can now be run by passing them to jsampler
  as command-line arguments
* The scripts in the `scripts' directory now pass the command-line
  arguments to the respective jsampler distribution
* ant: the default target is now build-fantasia
* bugfix: backend address was always set to 127.0.0.1 when adding
  backend to the backend list

1 /*
2 * JSampler - a java front-end for LinuxSampler
3 *
4 * Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>
5 *
6 * This file is part of JSampler.
7 *
8 * JSampler is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 *
12 * JSampler is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with JSampler; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23 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;
31
32 /**
33 * The main class of the application.
34 * @author Grigor Iliev
35 */
36 public class JSampler {
37 /** The application name. */
38 public final static String NAME = "JSampler";
39
40 /** The application version. */
41 public final static String VERSION = "0.8a";
42
43 public static String[] scripts;
44
45
46 /**
47 * The entry point of the application.
48 * @param args The command line arguments.
49 * @see CC#cleanExit
50 */
51 public static void
52 main(String[] args) {
53 scripts = args;
54 CC.initJSampler();
55 initGUI();
56 }
57
58 private static void
59 initGUI() {
60 JSViews.parseManifest();
61 JSViews.setView(JSViews.getDefaultView());
62
63 SwingUtilities.invokeLater(new Runnable() {
64 public void
65 run() { initGUI0(); }
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 }

  ViewVC Help
Powered by ViewVC