com.softsynth.jmsl
Class JMSL

java.lang.Object
  extended by com.softsynth.jmsl.JMSL

public final class JMSL
extends java.lang.Object

Control JMSL global environment.

Author:
Phil Burk and Nick Didkovsky

Field Summary
static MusicClock clock
           
static STDOutFunction err
           
static int JMSL_BUILD
           
static java.lang.String JMSL_PUBLIC_KEY
           
static double JMSL_VERSION
           
static boolean LICENSED
           
static MidiIO midi
           
static STDOutFunction out
           
static boolean PRERELEASE
           
static EventScheduler scheduler
           
static int SILENT
           
static int TERSE
           
static int VERBOSE
           
static int verbosity
           
static java.lang.String version
           
 
Constructor Summary
JMSL()
           
 
Method Summary
static void addFileLoaderListener(FileLoaderListener listener)
           
static void addMusicDevice(MusicDevice dev)
           
static void closeMusicDevices()
          When a MusicDevice.open() is called, it should JMSL.addMusicDevice(itself) Then when programs terminate, one call to JMSL.closeMusicDevices() will close() it and all other MusicDevices that added themselves.
static java.lang.String doubleToString(double fval, int numAfter)
           
static java.net.URL getCodeBase()
           
static java.util.Enumeration getFileLoaderListeners()
           
static boolean getIsApplet()
           
static java.util.Properties getLicenseProperties()
           
static ViewFactory getViewFactory()
          ViewFactory can be used to build GUIs with components that can switch between AWT and Swing .
static double now()
           
static void openInstrumentMusicDevice(java.awt.Frame f, Instrument ins)
          Get the MusicDevice for an Instrument.
static void printDoubleArray(double[] dar)
           
static double realTime()
           
static void removeFileLoaderListener(FileLoaderListener listener)
           
static void removeMusicDevice(MusicDevice dev)
           
static void requestVersion(int requestedVersion)
          If the existing version is earlier than the requested version, then the user will be instructed to upgrade to the latest version of JMSL
static void setCodeBase(java.net.URL codeBase)
          Set this in your applet's init() method if you want to make the applet's codebase available to misc support classes.
static void setERROut(STDOutFunction fn)
          vector JMSL.err printing to a custom function
static void setIsApplet(boolean flag)
          Flag whether or not Score is operating in an applet or application.
static void setSTDOut(STDOutFunction fn)
          vector JMSL.out printing to a custom function
static void setViewFactory(ViewFactory viewFactory)
          Alias for PortView.setViewFactory(viewFactory);
static void sleepUntil(double time)
           
static void useSystemOut()
          send JMSL.out and JMSL.err to System.out
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JMSL_VERSION

public static final double JMSL_VERSION
See Also:
Constant Field Values

JMSL_BUILD

public static final int JMSL_BUILD
See Also:
Constant Field Values

LICENSED

public static final boolean LICENSED
See Also:
Constant Field Values

PRERELEASE

public static final boolean PRERELEASE
See Also:
Constant Field Values

clock

public static MusicClock clock

out

public static STDOutFunction out

err

public static STDOutFunction err

midi

public static MidiIO midi

scheduler

public static EventScheduler scheduler

verbosity

public static int verbosity

SILENT

public static final int SILENT
See Also:
Constant Field Values

TERSE

public static final int TERSE
See Also:
Constant Field Values

VERBOSE

public static final int VERBOSE
See Also:
Constant Field Values

version

public static final java.lang.String version
See Also:
Constant Field Values

JMSL_PUBLIC_KEY

public static final java.lang.String JMSL_PUBLIC_KEY
See Also:
Constant Field Values
Constructor Detail

JMSL

public JMSL()
Method Detail

getLicenseProperties

public static final java.util.Properties getLicenseProperties()
                                                       throws java.io.IOException
Throws:
java.io.IOException

addMusicDevice

public static void addMusicDevice(MusicDevice dev)

removeMusicDevice

public static void removeMusicDevice(MusicDevice dev)

addFileLoaderListener

public static void addFileLoaderListener(FileLoaderListener listener)

removeFileLoaderListener

public static void removeFileLoaderListener(FileLoaderListener listener)

getFileLoaderListeners

public static java.util.Enumeration getFileLoaderListeners()

closeMusicDevices

public static void closeMusicDevices()
When a MusicDevice.open() is called, it should JMSL.addMusicDevice(itself) Then when programs terminate, one call to JMSL.closeMusicDevices() will close() it and all other MusicDevices that added themselves. List of MusicDevices is empty after this call.


openInstrumentMusicDevice

public static void openInstrumentMusicDevice(java.awt.Frame f,
                                             Instrument ins)
Get the MusicDevice for an Instrument. If it is editenabled, edit() then open(), else open(). Then set editEnabled (false)


setCodeBase

public static void setCodeBase(java.net.URL codeBase)
Set this in your applet's init() method if you want to make the applet's codebase available to misc support classes. For example, com.softsynth.jmsl.jsyn.SimpleSamplePlayingInstrument checks JMSL.getIsApplet(), and if true, loads sound files using JMSL.getCodeBase()


getCodeBase

public static java.net.URL getCodeBase()

requestVersion

public static void requestVersion(int requestedVersion)
If the existing version is earlier than the requested version, then the user will be instructed to upgrade to the latest version of JMSL


setSTDOut

public static void setSTDOut(STDOutFunction fn)
vector JMSL.out printing to a custom function


setERROut

public static void setERROut(STDOutFunction fn)
vector JMSL.err printing to a custom function


useSystemOut

public static void useSystemOut()
send JMSL.out and JMSL.err to System.out


sleepUntil

public static void sleepUntil(double time)
                       throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

now

public static double now()
Returns:
JMSL.clock.now(), which is a timestamp slightly in the future [clock.realTime() + clock.advanceTime ]

realTime

public static double realTime()
Returns:
JMSL.clock.realtime(). The current, absolutely present time

doubleToString

public static java.lang.String doubleToString(double fval,
                                              int numAfter)

printDoubleArray

public static void printDoubleArray(double[] dar)

setIsApplet

public static final void setIsApplet(boolean flag)
Flag whether or not Score is operating in an applet or application. Used by Sample loaders for example, who want to decide whether to load trumpet.aiff from local drive or from URL. Also used by MidiIO_JavaSound to decide whether to load a soundbank from File or URL if JRE has no soundbank installed.


getIsApplet

public static final boolean getIsApplet()
Returns:
whether or not JMSL is operating in an applet environment or application. Used by sampleLoaders for example, who want to decide whether to load a file from disk or url

getViewFactory

public static ViewFactory getViewFactory()
ViewFactory can be used to build GUIs with components that can switch between AWT and Swing . This method is an alias for return com.didkovsky.portview.PortView.getViewFactory();

Returns:
Returns the viewFactory.

setViewFactory

public static void setViewFactory(ViewFactory viewFactory)
Alias for PortView.setViewFactory(viewFactory);

Parameters:
viewFactory - The viewFactory to set.