Class EventSchedulerWithThreadSleep

java.lang.Object
com.softsynth.jmsl.oldcode.EventSchedulerWithThreadSleep
All Implemented Interfaces:
java.lang.Runnable

public class EventSchedulerWithThreadSleep
extends java.lang.Object
implements java.lang.Runnable
EventScheduler.java General purpose scheduler for events. This can be used for scheduling note off events, or other musical events.
Any object that implements ScheduledEvent can be posted to the event scheduler. JMSL has a static shared EventScheduler. Here is an example of posting a custom event.
 JMSL.scheduler.post(new CustomEvent(futureTime, data));
 

At futureTime the custom events play() method will be called.

MOD ND build 20060418 IMPORTANT BUG FIX! the timestamp of scheduled events is now compared to JMSL.realTime() not JMSL.now() for scheduling!

Author:
Phil Burk and Nick Didkovsky
See Also:
ScheduledEvent
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.io.PrintWriter evLog  
    static boolean log  
  • Constructor Summary

    Constructors
    Constructor Description
    EventSchedulerWithThreadSleep()  
  • Method Summary

    Modifier and Type Method Description
    static void main​(java.lang.String[] args)  
    void post​(ScheduledEvent sEvent)
    Insert the new event into a list of events in time-sorted order.
    void printTimes()  
    static int qa()  
    int qa_1()  
    void run()  
    void start()
    Start EventScheduler thread.
    void stop()
    Stop EventScheduler thread.
    void testDebug()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • evLog

      public static java.io.PrintWriter evLog
    • log

      public static boolean log
  • Constructor Details

    • EventSchedulerWithThreadSleep

      public EventSchedulerWithThreadSleep()
  • Method Details

    • start

      public void start()
      Start EventScheduler thread. To prevent race conditions between threads, this object can only be started and stopped once. You must make a new EventSheduler if you need to restart.
    • stop

      public void stop()
      Stop EventScheduler thread.
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
    • post

      public void post​(ScheduledEvent sEvent)
      Insert the new event into a list of events in time-sorted order.
    • printTimes

      public void printTimes()
    • qa_1

      public int qa_1()
    • qa

      public static int qa()
    • testDebug

      public void testDebug()
    • main

      public static void main​(java.lang.String[] args)