dguitar.players.sound
Class MasterPlayer

java.lang.Object
  extended bydguitar.players.sound.MasterPlayer
All Implemented Interfaces:
EventSettings, EventSoundPlayer, RealtimeSoundPlayer, SoundPlayer, TimerSettings

public class MasterPlayer
extends java.lang.Object
implements RealtimeSoundPlayer, EventSoundPlayer

Author:
crnash

Field Summary
(package private)  boolean noteEventsEnabled
           
(package private)  SoundPlayer soundPlayer
           
(package private)  int timerFrequency
           
 
Constructor Summary
MasterPlayer()
           
 
Method Summary
 void addEventListener(PerformanceEventListener listener)
           
 void addTimerListener(PerformanceTimerListener listener)
           
 Performance arrange(Song song, Arrangement passedArrangement)
           
 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 setPerformance(Performance performance)
           
 void setSoundPlayer(SoundPlayer soundPlayer)
           
 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

timerFrequency

int timerFrequency

noteEventsEnabled

boolean noteEventsEnabled

soundPlayer

SoundPlayer soundPlayer
Constructor Detail

MasterPlayer

public MasterPlayer()
Method Detail

setTimerFrequency

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

enableNoteEvents

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

setSoundPlayer

public void setSoundPlayer(SoundPlayer soundPlayer)

addEventListener

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

addTimerListener

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

arrange

public Performance arrange(Song song,
                           Arrangement passedArrangement)
Parameters:
song -
passedArrangement -

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

close

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

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

setPerformance

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