Save This Page
Home » openjdk-7 » com.sun.media » sound » [javadoc | source]
com.sun.media.sound
class: EventDispatcher [javadoc | source]
java.lang.Object
   com.sun.media.sound.EventDispatcher

All Implemented Interfaces:
    Runnable

EventDispatcher. Used by various classes in the Java Sound implementation to send events.
Nested Class Summary:
interface  EventDispatcher.LineMonitor  Interface that a class that wants to get regular line monitor events implements 
Field Summary
static final  int LINE_MONITOR_TIME    Approximate interval between calls to LineMonitor.checkLine 
Method from com.sun.media.sound.EventDispatcher Summary:
addLineMonitor,   autoClosingClipClosed,   autoClosingClipOpened,   dispatchEvents,   processEvent,   removeLineMonitor,   run,   sendAudioEvents,   start
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.media.sound.EventDispatcher Detail:
  void addLineMonitor(LineMonitor lm) 
    Add this LineMonitor instance to the list of monitors
  void autoClosingClipClosed(AutoClosingClip clip) 
    called from auto-closing clips when their closed() method is called
  void autoClosingClipOpened(AutoClosingClip clip) 
    called from auto-closing clips when one of their open() method is called
 protected  void dispatchEvents() 
    Wait until there is something in the event queue to process. Then dispatch the event to the listeners.The entire method does not need to be synchronized since this includes taking the event out from the queue and processing the event. We only need to provide exclusive access over the code where an event is removed from the queue.
 protected  void processEvent(EventInfo eventInfo) 
    Invoked when there is at least one event in the queue. Implement this as a callback to process one event.
  void removeLineMonitor(LineMonitor lm) 
    Remove this LineMonitor instance from the list of monitors
 public  void run() 
    A loop to dispatch events.
  void sendAudioEvents(Object event,
    List listeners) 
    Send audio and MIDI events.
 synchronized  void start() 
    This start() method starts an event thread if one is not already active.