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 Details

  • 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

      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)
    • 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

      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.