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 MusicClockclockstatic STDOutFunctionerrstatic intJMSL_BUILDstatic java.lang.StringJMSL_BUILD_TIMEstatic java.lang.StringJMSL_PUBLIC_KEYstatic doubleJMSL_VERSIONstatic booleanLICENSEDstatic MidiIOmidiMidiIO_JavaSound by default as of 4/14/09static STDOutFunctionoutstatic booleanPRERELEASEstatic EventSchedulerschedulerstatic intSILENTstatic intTERSEstatic intVERBOSEstatic intverbositystatic java.lang.Stringversion -
Constructor Summary
Constructors Constructor Description JMSL() -
Method Summary
Modifier and Type Method Description static voidaddFileLoaderListener(FileLoaderListener listener)static voidaddMusicDevice(MusicDevice dev)static javax.swing.JDialogalert(java.lang.String msg)static java.io.FilealgomusicUserHome()static voidcloseMusicDevices()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.StringdoubleToString(double fval, int numAfter)static java.net.URLgetCodeBase()static intgetDaysUntilExpiration()static java.util.EnumerationgetFileLoaderListeners()static booleangetIsApplet()static java.util.PropertiesgetLicenseProperties()static java.lang.StringgetLicenseType()static java.lang.StringgetPreference(java.lang.String property)retrieve a preference value for a property.static ViewFactorygetViewFactory()ViewFactory can be used to build GUIs with components that can switch between AWT and Swing .static booleanisGhawanmeh()static booleanisLicensed()static booleanisLiveLiteButNotLiveEnvironment()static booleanisMac()static booleanisWindows()static booleanlicenseSupportsJSyn()static booleanlicenseSupportsJSyn2()static booleanlicenseSupportsMidi()static booleanlicenseSupportsScoreStandalone()static booleanmayRunInMaxWithoutJMSLLicense()static doublenow()static voidopenInstrumentMusicDevice(java.awt.Frame f, Instrument ins)Get the MusicDevice for an Instrument.static voidprintDoubleArray(double[] dar)static voidprintIntArray(int[] dar)static doublerealTime()static voidremoveFileLoaderListener(FileLoaderListener listener)static voidremoveMusicDevice(MusicDevice dev)static voidrequestVersion(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 voidsetCodeBase(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 voidsetERROut(STDOutFunction fn)vector JMSL.err printing to a custom functionstatic voidsetIsApplet(boolean flag)Flag whether or not Score is operating in an applet or application.static voidsetPreference(java.lang.String property, java.lang.String value)Set a global preference for a property, saves to/.algomusic/JMSL_preferences.props static voidsetPreference(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 voidsetSTDOut(STDOutFunction fn)vector JMSL.out printing to a custom functionstatic voidsetViewFactory(ViewFactory viewFactory)Alias for PortView.setViewFactory(viewFactory);static voidsleepUntil(double time)static voiduseSystemOut()send JMSL.out and JMSL.err to System.outstatic voidz(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.
-