test.tools
Class MockMidiPlayer

java.lang.Object
  extended bytest.tools.MockMidiPlayer
All Implemented Interfaces:
EventSettings, EventSoundPlayer, RealtimeSoundPlayer, java.lang.Runnable, SoundPlayer, TimerSettings

public class MockMidiPlayer
extends java.lang.Object
implements SoundPlayer, RealtimeSoundPlayer, EventSoundPlayer, java.lang.Runnable

Author:
crnash

Field Summary
private  java.lang.String className
           
(package private)  java.util.List listeners
           
(package private)  PerformanceLive live
           
private  java.util.logging.Logger logger
           
private  boolean noteEventsEnabled
           
(package private)  java.lang.Thread playerThread
           
private  int timerFrequency
           
 
Constructor Summary
MockMidiPlayer()
           
 
Method Summary
 void addEventListener(PerformanceEventListener listener)
           
 void addTimerListener(PerformanceTimerListener listener)
           
 void close()
           
 Performance createPerformance(int tracks, Tempo tempo, int resolution)
          Create a performance object that is compatible with this class of SoundPlayer.
 void enableNoteEvents(boolean enable)
           
 void run()
           
 void setPerformance(Performance performance)
           
 void setTimerFrequency(int ppq)
           
 void start()
           
 void stop()
           
 void waitForCompletion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

private java.lang.String className

logger

private java.util.logging.Logger logger

live

PerformanceLive live

listeners

java.util.List listeners

playerThread

java.lang.Thread playerThread

timerFrequency

private int timerFrequency

noteEventsEnabled

private boolean noteEventsEnabled
Constructor Detail

MockMidiPlayer

public MockMidiPlayer()
Method Detail

createPerformance

public Performance createPerformance(int tracks,
                                     Tempo tempo,
                                     int resolution)
Description copied from interface: SoundPlayer
Create a performance object that is compatible with this class of SoundPlayer.

Specified by:
createPerformance in interface SoundPlayer
Parameters:
tracks - the number of physical tracks in this performance
tempo - the tempo at which to play it
resolution - the resolution (in ticks per quarter note)
Returns:
the Performance object that was created

start

public void start()
Specified by:
start in interface SoundPlayer

stop

public void stop()
Specified by:
stop in interface RealtimeSoundPlayer

waitForCompletion

public void waitForCompletion()
Specified by:
waitForCompletion in interface RealtimeSoundPlayer

setPerformance

public void setPerformance(Performance performance)
Specified by:
setPerformance in interface SoundPlayer
Parameters:
performance -

close

public void close()
Specified by:
close in interface SoundPlayer

addTimerListener

public void addTimerListener(PerformanceTimerListener listener)
Specified by:
addTimerListener in interface RealtimeSoundPlayer
Parameters:
listener -

addEventListener

public void addEventListener(PerformanceEventListener listener)
Specified by:
addEventListener in interface EventSoundPlayer
Parameters:
listener -

run

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

setTimerFrequency

public void setTimerFrequency(int ppq)
Specified by:
setTimerFrequency in interface TimerSettings

enableNoteEvents

public void enableNoteEvents(boolean enable)
Specified by:
enableNoteEvents in interface EventSettings