com.softsynth.jmsl
Class EventScheduler

java.lang.Object
  extended by com.softsynth.jmsl.EventScheduler
All Implemented Interfaces:
java.lang.Runnable

public class EventScheduler
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
static java.io.PrintWriter evLog
           
static boolean log
           
 
Constructor Summary
EventScheduler()
           
 
Method Summary
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()
           
 int qa_1()
           
static int qa()
           
 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 Detail

evLog

public static java.io.PrintWriter evLog

log

public static boolean log
Constructor Detail

EventScheduler

public EventScheduler()
Method Detail

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)