openpiano.midi
Class MidiLoader

java.lang.Object
  extended by openpiano.midi.MidiLoader

public class MidiLoader
extends Object

The MidiLoader class loads the MIDI events of a MIDI file. The MIDI formats 0 and 1 are supported

Version:
1.0, 07/30/08
Author:
Sascha Westermann

Constructor Summary
MidiLoader(Controller controller, SlidePanel slidePanel, Settings settings, File midiFile)
          Constructs a new list of MIDI events based on a MIDI files.
 
Method Summary
 LinkedList<Bpm> getBpmList()
          Returns the MIDI file's list of beats per minute events
 long getEndTick()
          Returns the last tick of the MIDI file
 MidiTimer getMidiTimer()
          Returns the clock
 LinkedList<MidiTrack> getMidiTracks()
          Returns the list of MIDI events per MIDI track
 int getTicksPerBeat()
          Returns the ticks per beat of the MIDI file
 Boolean initFailed()
          Returns true if loading of a MIDI file failed
 int isFileKnown()
          Returns true if the MIDI file is already known
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiLoader

public MidiLoader(Controller controller,
                  SlidePanel slidePanel,
                  Settings settings,
                  File midiFile)
Constructs a new list of MIDI events based on a MIDI files. If the MIDI file is already known, the pre-settings will be adapted

Parameters:
controller - the main controller of the application
slidePanel - the panel containing the position slider
settings - a reference to the settings object
midiFile - the MIDI file to load
Method Detail

getBpmList

public LinkedList<Bpm> getBpmList()
Returns the MIDI file's list of beats per minute events

Returns:
the list of beats per minute events

getEndTick

public long getEndTick()
Returns the last tick of the MIDI file

Returns:
the last tick of the MIDI file

getMidiTracks

public LinkedList<MidiTrack> getMidiTracks()
Returns the list of MIDI events per MIDI track

Returns:
the list of MIDI events

getTicksPerBeat

public int getTicksPerBeat()
Returns the ticks per beat of the MIDI file

Returns:
the ticks per beat

initFailed

public Boolean initFailed()
Returns true if loading of a MIDI file failed

Returns:
true if loading of a MIDI file failed

isFileKnown

public int isFileKnown()
Returns true if the MIDI file is already known

Returns:
true if the MIDI file is already known

getMidiTimer

public MidiTimer getMidiTimer()
Returns the clock

Returns:
the clock