dguitar.adaptors.midi
Class MidiAdaptor
java.lang.Object
dguitar.adaptors.midi.MidiAdaptor
- public class MidiAdaptor
- extends java.lang.Object
An adaptor to import MIDI files as a Song. This class is to be used mainly
for test case implementations (we can roundtrip MIDI-Adaptor-MIDI, and
compare MIDI-Adaptor to GPSong-Adaptor).
- Author:
- crnash
Method Summary |
private static void |
encodeTrack(Song song,
SongMeasure songMeasure,
java.util.List singleTrack,
int trackIndex)
|
(package private) static javax.sound.midi.MetaMessage |
findMetaMessage(javax.sound.midi.Track track,
long timestamp,
int metaType)
|
static Song |
makeSong(java.lang.String midiFile)
|
private static java.util.Collection |
splitTrack(javax.sound.midi.Track midiTrack)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MidiAdaptor
public MidiAdaptor()
makeSong
public static Song makeSong(java.lang.String midiFile)
throws javax.sound.midi.InvalidMidiDataException,
java.io.IOException
- Throws:
javax.sound.midi.InvalidMidiDataException
java.io.IOException
splitTrack
private static java.util.Collection splitTrack(javax.sound.midi.Track midiTrack)
- Parameters:
midiTrack
-
- Returns:
encodeTrack
private static void encodeTrack(Song song,
SongMeasure songMeasure,
java.util.List singleTrack,
int trackIndex)
findMetaMessage
static javax.sound.midi.MetaMessage findMetaMessage(javax.sound.midi.Track track,
long timestamp,
int metaType)