com.frinika.sequencer
Class Metronome

java.lang.Object
  extended by com.frinika.sequencer.Metronome
All Implemented Interfaces:
SongPositionListener, uk.org.toot.audio.core.AudioProcess

public class Metronome
extends java.lang.Object
implements uk.org.toot.audio.core.AudioProcess, SongPositionListener


Field Summary
 
Fields inherited from interface uk.org.toot.audio.core.AudioProcess
AUDIO_DISCONNECT, AUDIO_OK
 
Constructor Summary
Metronome(ProjectContainer project)
           
 
Method Summary
 void close()
           
 void notifyTickPosition(long tick)
          This method is called each time a new tick is played by the sequencer.
 void open()
           
 int processAudio(uk.org.toot.audio.core.AudioBuffer buffer)
           
 boolean requiresNotificationOnEachTick()
          Your implementation should return true if your listener requires to be notified for each and every tick.
 void setVelocity(int velocity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Metronome

public Metronome(ProjectContainer project)
          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setVelocity

public void setVelocity(int velocity)

notifyTickPosition

public void notifyTickPosition(long tick)
Description copied from interface: SongPositionListener
This method is called each time a new tick is played by the sequencer. Note that this method should return as soon as possible (immediately).

Specified by:
notifyTickPosition in interface SongPositionListener

requiresNotificationOnEachTick

public boolean requiresNotificationOnEachTick()
Description copied from interface: SongPositionListener
Your implementation should return true if your listener requires to be notified for each and every tick. Otherwise (which is in most cases) return false. WARNING: If you return true on this method, you MUST return absolutely immediately everytime. Otherwise it may result in a halting song.

Specified by:
requiresNotificationOnEachTick in interface SongPositionListener
Returns:

processAudio

public int processAudio(uk.org.toot.audio.core.AudioBuffer buffer)
Specified by:
processAudio in interface uk.org.toot.audio.core.AudioProcess

open

public void open()
Specified by:
open in interface uk.org.toot.audio.core.AudioProcess

close

public void close()
Specified by:
close in interface uk.org.toot.audio.core.AudioProcess