com.frinika.project
Class RecordingManager

java.lang.Object
  extended by com.frinika.project.RecordingManager
All Implemented Interfaces:
MidiMessageListener, SequencerListener, SongPositionListener
Direct Known Subclasses:
SimphoneyRecordManager

public class RecordingManager
extends java.lang.Object
implements SongPositionListener, MidiMessageListener, SequencerListener

This is added as a message listener to the FrinikaSequencer

Author:
pjl

Nested Class Summary
protected  class RecordingManager.Event
           
protected  class RecordingManager.Stack
           
 
Field Summary
protected  java.util.Vector<MultiEvent> currentRecordingTake
           
protected  java.util.HashMap<java.lang.Integer,NoteEvent> pendingNoteEvents
           
protected  ProjectContainer project
           
protected  FrinikaSequencer sequencer
           
protected  RecordingManager.Stack stack
           
 
Constructor Summary
RecordingManager(ProjectContainer proj, int buffSize)
           
 
Method Summary
protected  void addEventToRecordingTracks(ChannelEvent event)
           
 void beforeStart()
          This event is sent on before sequencer start
 void midiMessage(javax.sound.midi.MidiMessage message)
           
 void notifyTickPosition(long tick)
          This method is called each time a new tick is played by the sequencer.
 boolean requiresNotificationOnEachTick()
          Your implementation should return true if your listener requires to be notified for each and every tick.
protected  void reset()
           
 void start()
          This event is sent on after sequencer start
 void stop()
          This event is sent on sequencer stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentRecordingTake

protected java.util.Vector<MultiEvent> currentRecordingTake

pendingNoteEvents

protected java.util.HashMap<java.lang.Integer,NoteEvent> pendingNoteEvents

sequencer

protected FrinikaSequencer sequencer

stack

protected RecordingManager.Stack stack

project

protected ProjectContainer project
Constructor Detail

RecordingManager

public RecordingManager(ProjectContainer proj,
                        int buffSize)
Method Detail

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:

midiMessage

public void midiMessage(javax.sound.midi.MidiMessage message)
Specified by:
midiMessage in interface MidiMessageListener

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

addEventToRecordingTracks

protected void addEventToRecordingTracks(ChannelEvent event)

reset

protected void reset()

beforeStart

public void beforeStart()
Description copied from interface: SequencerListener
This event is sent on before sequencer start

Specified by:
beforeStart in interface SequencerListener

start

public void start()
Description copied from interface: SequencerListener
This event is sent on after sequencer start

Specified by:
start in interface SequencerListener

stop

public void stop()
Description copied from interface: SequencerListener
This event is sent on sequencer stop

Specified by:
stop in interface SequencerListener