Package com.softsynth.jmsl
Class JMSL
java.lang.Object
com.softsynth.jmsl.JMSL
public final class JMSL
extends java.lang.Object
Control JMSL global environment.
- Author:
- Phil Burk and Nick Didkovsky
-
Field Summary
Fields Modifier and Type Field Description static MusicClock
clock
static STDOutFunction
err
static int
JMSL_BUILD
static java.lang.String
JMSL_BUILD_TIME
static java.lang.String
JMSL_PUBLIC_KEY
static double
JMSL_VERSION
static boolean
LICENSED
static MidiIO
midi
MidiIO_JavaSound by default as of 4/14/09static 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
Constructors Constructor Description JMSL()
-
Method Summary
Modifier and Type Method Description static void
addFileLoaderListener(FileLoaderListener listener)
static void
addMusicDevice(MusicDevice dev)
static javax.swing.JDialog
alert(java.lang.String msg)
static java.io.File
algomusicUserHome()
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 int
getDaysUntilExpiration()
static java.util.Enumeration
getFileLoaderListeners()
static boolean
getIsApplet()
static java.util.Properties
getLicenseProperties()
static java.lang.String
getLicenseType()
static java.lang.String
getPreference(java.lang.String property)
retrieve a preference value for a property.static ViewFactory
getViewFactory()
ViewFactory can be used to build GUIs with components that can switch between AWT and Swing .static boolean
isGhawanmeh()
static boolean
isLicensed()
static boolean
isLiveLiteButNotLiveEnvironment()
static boolean
isMac()
static boolean
isWindows()
static boolean
licenseSupportsJSyn()
static boolean
licenseSupportsJSyn2()
static boolean
licenseSupportsMidi()
static boolean
licenseSupportsScoreStandalone()
static boolean
mayRunInMaxWithoutJMSLLicense()
static double
now()
static void
openInstrumentMusicDevice(java.awt.Frame f, Instrument ins)
Get the MusicDevice for an Instrument.static void
printDoubleArray(double[] dar)
static void
printIntArray(int[] 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 JMSLstatic 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 functionstatic void
setIsApplet(boolean flag)
Flag whether or not Score is operating in an applet or application.static void
setPreference(java.lang.String property, java.lang.String value)
Set a global preference for a property, saves to/.algomusic/JMSL_preferences.props static void
setPreference(java.lang.String property, java.lang.String value, boolean storeImmediate)
Set a global preference for a property, saves to/.algomusic/JMSL_preferences.props storeImmediate true makes prop file write static void
setSTDOut(STDOutFunction fn)
vector JMSL.out printing to a custom functionstatic 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.outstatic void
z(java.lang.String s)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
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
-
JMSL_BUILD_TIME
public static final java.lang.String JMSL_BUILD_TIME- 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
-
out
-
err
-
midi
MidiIO_JavaSound by default as of 4/14/09 -
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 Details
-
JMSL
public JMSL()
-
-
Method Details
-
isMac
public static final boolean isMac() -
isWindows
public static final boolean isWindows() -
z
public static void z(java.lang.String s) -
isLiveLiteButNotLiveEnvironment
public static final boolean isLiveLiteButNotLiveEnvironment() -
getLicenseProperties
public static final java.util.Properties getLicenseProperties() throws java.io.IOException- Throws:
java.io.IOException
-
isLicensed
public static final boolean isLicensed() -
licenseSupportsJSyn2
public static final boolean licenseSupportsJSyn2() -
licenseSupportsJSyn
public static final boolean licenseSupportsJSyn() -
licenseSupportsMidi
public static final boolean licenseSupportsMidi() -
licenseSupportsScoreStandalone
public static final boolean licenseSupportsScoreStandalone() -
mayRunInMaxWithoutJMSLLicense
public static final boolean mayRunInMaxWithoutJMSLLicense() -
getDaysUntilExpiration
public static int getDaysUntilExpiration() -
isGhawanmeh
public static final boolean isGhawanmeh() -
getPreference
public static java.lang.String getPreference(java.lang.String property)retrieve a preference value for a property. These properties are stored in/.algomusic/JMSL_preferences.props - Parameters:
property
-- Returns:
- propertyValue
-
setPreference
public static void setPreference(java.lang.String property, java.lang.String value, boolean storeImmediate)Set a global preference for a property, saves to/.algomusic/JMSL_preferences.props storeImmediate true makes prop file write - Parameters:
property
-value
-storeImmediate
-
-
setPreference
public static void setPreference(java.lang.String property, java.lang.String value)Set a global preference for a property, saves to/.algomusic/JMSL_preferences.props - Parameters:
property
-value
-
-
getLicenseType
public static final java.lang.String getLicenseType() -
algomusicUserHome
public static java.io.File algomusicUserHome() -
alert
public static final javax.swing.JDialog alert(java.lang.String msg) -
addMusicDevice
-
removeMusicDevice
-
addFileLoaderListener
-
removeFileLoaderListener
-
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
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
vector JMSL.out printing to a custom function -
setERROut
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) -
printIntArray
public static void printIntArray(int[] 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
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
Alias for PortView.setViewFactory(viewFactory);- Parameters:
viewFactory
- The viewFactory to set.
-