JSampler
v0.8a

org.jsampler
Class CC

java.lang.Object
  extended by org.jsampler.CC

public class CC
extends java.lang.Object

This class serves as a 'Control Center' of the application. It also provides some fundamental routines and access to most used objects.


Method Summary
static void addReconnectListener(java.awt.event.ActionListener l)
          Registers the specified listener to be notified when reconnecting to LinuxSampler.
static void changeJSamplerHome(java.lang.String path)
          Changes the JSampler's home directory and moves all files from the old JSampler's home directory to the new one.
static void checkJSamplerHome()
          Checks whether the JSampler home directory is specified and exist.
static void cleanExit()
          The exit point of the application which ensures clean exit with default exit status 0.
static void cleanExit(int i)
          The exit point of the application which ensures clean exit.
static java.lang.String exportInstrMapsToLscpScript()
           
static java.lang.String exportSessionToLscpScript()
           
static Client getClient()
          Gets the Client object that is used to communicate with the backend.
static InstrumentsDbTreeModel getInstrumentsDbTreeModel()
          Gets the tree model of the instruments database.
static java.lang.String getJSamplerHome()
          Gets the absolute path to the JSampler's home location.
static java.util.logging.Logger getLogger()
          Returns the logger to be used for logging events.
static JSMainFrame getMainFrame()
          Returns the main window of this application.
static OrchestraListModel getOrchestras()
          Returns a list containing all available orchestras.
static JSProgress getProgressIndicator()
          Gets the progress indicator of this application.
static SamplerModel getSamplerModel()
          Gets the sampler model.
static TaskQueue getTaskQueue()
          Returns the task queue to be used for scheduling tasks for execution out of the event-dispatching thread.
static JSViewConfig getViewConfig()
          Gets the configuration of the current view.
protected static void initJSampler()
          This method does the initial preparation of the application.
static void initSamplerModel()
          This method updates the information about the backend state.
static void loadOrchestras()
          Loads the orchestras described in <jsampler_home>/orchestras.xml.
static void reconnect()
          Reconnects to LinuxSampler.
static void removeReconnectListener(java.awt.event.ActionListener l)
          Removes the specified listener.
static void scheduleTask(Task t)
          Adds the specified task to the task queue.
static void setJSamplerHome(java.lang.String path)
          Sets the location of the JSampler's home.
static void setMainFrame(JSMainFrame mainFrame)
          Sets the main window of this application.
static void setProgressIndicator(JSProgress progress)
          Sets the progress indicator to be used by this application.
static void setViewConfig(JSViewConfig viewConfig)
          Sets the configuration of the current view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogger

public static java.util.logging.Logger getLogger()
Returns the logger to be used for logging events.

Returns:
The logger to be used for logging events.

getTaskQueue

public static TaskQueue getTaskQueue()
Returns the task queue to be used for scheduling tasks for execution out of the event-dispatching thread.

Returns:
The task queue to be used for scheduling tasks for execution out of the event-dispatching thread.

scheduleTask

public static void scheduleTask(Task t)
Adds the specified task to the task queue. All task in the queue equal to the specified task are removed from the queue.


getViewConfig

public static JSViewConfig getViewConfig()
Gets the configuration of the current view.


setViewConfig

public static void setViewConfig(JSViewConfig viewConfig)
Sets the configuration of the current view.


getMainFrame

public static JSMainFrame getMainFrame()
Returns the main window of this application.

Returns:
The main window of this application.

setMainFrame

public static void setMainFrame(JSMainFrame mainFrame)
Sets the main window of this application.

Parameters:
mainFrame - The main window of this application.

getProgressIndicator

public static JSProgress getProgressIndicator()
Gets the progress indicator of this application.

Returns:
The progress indicator of this application.

setProgressIndicator

public static void setProgressIndicator(JSProgress progress)
Sets the progress indicator to be used by this application.

Parameters:
progress - The progress indicator to be used by this application.

getJSamplerHome

public static java.lang.String getJSamplerHome()
Gets the absolute path to the JSampler's home location.

Returns:
The absolute path to the JSampler's home location or null if the JSampler's home location is not specified yet.

setJSamplerHome

public static void setJSamplerHome(java.lang.String path)
Sets the location of the JSampler's home.

Parameters:
path - The new absolute path to the JSampler's home location.

initJSampler

protected static void initJSampler()
This method does the initial preparation of the application.


checkJSamplerHome

public static void checkJSamplerHome()
Checks whether the JSampler home directory is specified and exist. If the JSampler home directory is not specifed, or is specified but doesn't exist, a procedure of specifying a JSampler home directory is initiated.

See Also:
JSMainFrame.installJSamplerHome()

changeJSamplerHome

public static void changeJSamplerHome(java.lang.String path)
Changes the JSampler's home directory and moves all files from the old JSampler's home directory to the new one. If all files are moved succesfully, the old directory is deleted.

Parameters:
path - The location of the new JSampler's home directory. If the last directory in the path doesn't exist, it is created.

getOrchestras

public static OrchestraListModel getOrchestras()
Returns a list containing all available orchestras.

Returns:
A list containing all available orchestras.

getInstrumentsDbTreeModel

public static InstrumentsDbTreeModel getInstrumentsDbTreeModel()
Gets the tree model of the instruments database. If the currently used view doesn't have instruments database support the tree model is initialized on first use.

Returns:
The tree model of the instruments database or null if the backend doesn't have instruments database support.
See Also:
JSViewConfig.getInstrumentsDbSupport()

loadOrchestras

public static void loadOrchestras()
Loads the orchestras described in <jsampler_home>/orchestras.xml. If file with name orchestras.xml.bkp exist in the JSampler's home directory, this means that the last save has failed. In that case a recovery file orchestras.xml.rec is created and a recovery procedure will be initiated.


cleanExit

public static void cleanExit()
The exit point of the application which ensures clean exit with default exit status 0.

See Also:
cleanExit(int i)

cleanExit

public static void cleanExit(int i)
The exit point of the application which ensures clean exit.

Parameters:
i - The exit status.

getClient

public static Client getClient()
Gets the Client object that is used to communicate with the backend.

Returns:
The Client object that is used to communicate with the backend.

addReconnectListener

public static void addReconnectListener(java.awt.event.ActionListener l)
Registers the specified listener to be notified when reconnecting to LinuxSampler.

Parameters:
l - The ActionListener to register.

removeReconnectListener

public static void removeReconnectListener(java.awt.event.ActionListener l)
Removes the specified listener.

Parameters:
l - The ActionListener to remove.

getSamplerModel

public static SamplerModel getSamplerModel()
Gets the sampler model.

Returns:
The sampler model.

reconnect

public static void reconnect()
Reconnects to LinuxSampler.


initSamplerModel

public static void initSamplerModel()
This method updates the information about the backend state.


exportInstrMapsToLscpScript

public static java.lang.String exportInstrMapsToLscpScript()

exportSessionToLscpScript

public static java.lang.String exportSessionToLscpScript()

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.