com.frinika.sequencer.model.tempo
Class TempoList

java.lang.Object
  extended by com.frinika.sequencer.model.tempo.TempoList
All Implemented Interfaces:
java.io.Serializable

public class TempoList
extends java.lang.Object
implements java.io.Serializable

Maintains a list of tempo changes. Tempo changes occur at midi ticks ( an tempo changed is fixed to a tick) Inserting a new tempo change sets a dirty flag. If need be the real time of the events are reconstructed if the dirty flag is true.

Author:
pjl
See Also:
Serialized Form

Nested Class Summary
 class TempoList.MyTempoEvent
           
 
Constructor Summary
TempoList(double ticksPerBeat, ProjectContainer project)
           
 
Method Summary
 void add(long tick, double bpm)
          Add a tempo event
 void addTempoListListener(TempoListListener o)
           
 void display()
           
 TempoList.MyTempoEvent elementAt(int row)
           
 float getTempoAt(long tick)
          Get tempo at tick.
 TempoList.MyTempoEvent getTempoEventAt(long tick)
          get tempo event before tick.
 double getTickAtTime(double time)
          return the tick at the given time Slow (do not use if speed is required)
 double getTimeAtTick(double tick)
           
static void main(java.lang.String[] args)
           
 void notifyListeners()
           
 void reco()
           
 void remove(long tick1, long tick2)
          Remove tempo events between tick1 and tick2
 void removeTempoListListener(TempoListListener o)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempoList

public TempoList(double ticksPerBeat,
                 ProjectContainer project)
Method Detail

addTempoListListener

public void addTempoListListener(TempoListListener o)

removeTempoListListener

public void removeTempoListListener(TempoListListener o)

notifyListeners

public void notifyListeners()

add

public void add(long tick,
                double bpm)
Add a tempo event

Parameters:
tick -
bpm -

remove

public void remove(long tick1,
                   long tick2)
Remove tempo events between tick1 and tick2

Parameters:
tick1 -
tick2 -

reco

public void reco()

getTempoEventAt

public TempoList.MyTempoEvent getTempoEventAt(long tick)
get tempo event before tick.

Parameters:
tick -
Returns:

getTempoAt

public float getTempoAt(long tick)
Get tempo at tick.

Parameters:
tick -
Returns:

getTickAtTime

public double getTickAtTime(double time)
return the tick at the given time Slow (do not use if speed is required)

Parameters:
time -
Returns:
tick

getTimeAtTick

public double getTimeAtTick(double tick)
Parameters:
tick -
Returns:
real time at this tick in seconds

display

public void display()

main

public static void main(java.lang.String[] args)

size

public int size()

elementAt

public TempoList.MyTempoEvent elementAt(int row)