dguitar.players.sound.midi
Class PerformanceLive

java.lang.Object
  extended byjavax.sound.midi.Sequence
      extended bydguitar.players.sound.midi.PerformanceCore
          extended bydguitar.players.sound.midi.PerformanceLive
All Implemented Interfaces:
EventSettings, MetaContainer, Performance, TimerSettings

public class PerformanceLive
extends PerformanceCore
implements MetaContainer, EventSettings, TimerSettings

Author:
crnash

Field Summary
private static java.lang.String className
           
(package private)  javax.sound.midi.Track eventTrack
           
private static java.util.logging.Logger logger
           
(package private)  java.util.List metaItems
           
(package private)  int timerFrequency
           
(package private)  EventStream timerStream
           
 
Fields inherited from class dguitar.players.sound.midi.PerformanceCore
tempo
 
Fields inherited from class javax.sound.midi.Sequence
divisionType, PPQ, resolution, SMPTE_24, SMPTE_25, SMPTE_30, SMPTE_30DROP, tracks
 
Constructor Summary
PerformanceLive(int tracks, Tempo tempo, int resolution)
           
 
Method Summary
 void addTimerEvents(SongMeasure measure, int location)
          Generate timer events for the given measure, which will be at the specified location.
 javax.sound.midi.MidiEvent create(PerformanceEvent item)
           
 void enableNoteEvents(boolean enable)
           
 int getTimerFrequency()
           
 PerformanceEvent lookup(int key)
           
protected  void recordPerformanceEvent(PerformanceEvent item)
           
 void setTimerFrequency(int timerFrequency)
          Set the frequency of timer events, in clicks per beat.
 
Methods inherited from class dguitar.players.sound.midi.PerformanceCore
addMusicalEvents, getTempo, initializeTrack, setTimeSignature
 
Methods inherited from class javax.sound.midi.Sequence
createTrack, deleteTrack, getDivisionType, getMicrosecondLength, getPatchList, getResolution, getTickLength, getTracks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

private static java.lang.String className

logger

private static java.util.logging.Logger logger

timerFrequency

int timerFrequency

eventTrack

javax.sound.midi.Track eventTrack

timerStream

EventStream timerStream

metaItems

java.util.List metaItems
Constructor Detail

PerformanceLive

public PerformanceLive(int tracks,
                       Tempo tempo,
                       int resolution)
                throws javax.sound.midi.InvalidMidiDataException
Parameters:
tracks -
tempo -
resolution -
Throws:
javax.sound.midi.InvalidMidiDataException
Method Detail

getTimerFrequency

public int getTimerFrequency()
Returns:
Returns the timerFrequency.

setTimerFrequency

public void setTimerFrequency(int timerFrequency)
Description copied from interface: Performance
Set the frequency of timer events, in clicks per beat.

Specified by:
setTimerFrequency in interface TimerSettings
Parameters:
timerFrequency - The timerFrequency to set.

create

public javax.sound.midi.MidiEvent create(PerformanceEvent item)
Specified by:
create in interface MetaContainer
Parameters:
item -
Returns:
a MidiEvent based on the item

lookup

public PerformanceEvent lookup(int key)
Specified by:
lookup in interface MetaContainer
Parameters:
key -
Returns:
the PerformanceEvent associadte with the key

addTimerEvents

public void addTimerEvents(SongMeasure measure,
                           int location)
Description copied from interface: Performance
Generate timer events for the given measure, which will be at the specified location. It is up to the implementor to ensure that at least one event (corresponding to the measure start) is generated by this call.

Specified by:
addTimerEvents in interface Performance
Parameters:
measure - the measure for which to add information
location - the time offset, measured in timing pulses

recordPerformanceEvent

protected void recordPerformanceEvent(PerformanceEvent item)
Specified by:
recordPerformanceEvent in class PerformanceCore
Parameters:
item -

enableNoteEvents

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