Package | com.yoambulante.midifiles |
Class | public class MidiFilesReader |
Inheritance | MidiFilesReader flash.events.EventDispatcher |
Property | Defined By | ||
---|---|---|---|
loader : URLLoader [read-only]
This is the URLLoader instance used when loading external files. | MidiFilesReader | ||
resolution : uint [read-only]
resolution normally means how many ticks per quater note
| MidiFilesReader | ||
subResolution : uint [read-only]
subResolution used when the midi file time is in frames per second
| MidiFilesReader | ||
totalTracks : uint [read-only]
returns total amount of available tracks after loading. | MidiFilesReader | ||
tracksType : int [read-only]
MIDI file track type, 0: single track file format. | MidiFilesReader |
Method | Defined By | ||
---|---|---|---|
MidiFilesReader | |||
gets a track from list
| MidiFilesReader | ||
getTrackTypeDescription():String
MIDI file track type, 0: single track file format. | MidiFilesReader | ||
loadFile(filename:String):void
Loads externally a binary file with a MIDI standard estructure
| MidiFilesReader | ||
loadFromBytes(bin_file:ByteArray):void
Load a MIDI file structure from a ByteArray
| MidiFilesReader | ||
nextEvent():Boolean
You control the workflow and when the events are read. | MidiFilesReader |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched if during the reading process there was any unexpected byte or error. | MidiFilesReader | |||
Dispatched when the midi file was read successfully and content valid data. | MidiFilesReader | |||
Dispatched as soon as the midi header file was found when reading the binary content. | MidiFilesReader |
Constant | Defined By | ||
---|---|---|---|
ON_DATA_ERROR : String = ON_DATA_ERROR [static]
| MidiFilesReader | ||
ON_DATA_LOADED : String = ON_DATA_LOADED [static]
| MidiFilesReader | ||
ON_HEADER_LOADED : String = ON_HEADER_LOADED [static]
| MidiFilesReader |
loader | property |
loader:URLLoader
[read-only]
This is the URLLoader
instance used when loading external files. Use this property to attach your own event listeners and have more control about the loading process workflow.
public function get loader():URLLoader
resolution | property |
resolution:uint
[read-only] resolution normally means how many ticks per quater note
public function get resolution():uint
subResolution | property |
subResolution:uint
[read-only] subResolution used when the midi file time is in frames per second
public function get subResolution():uint
totalTracks | property |
totalTracks:uint
[read-only] returns total amount of available tracks after loading.
public function get totalTracks():uint
tracksType | property |
tracksType:int
[read-only] MIDI file track type, 0: single track file format. 1:multiple track file format. 2:multiple song file format.
public function get tracksType():int
MidiFilesReader | () | Constructor |
public function MidiFilesReader()
getTrack | () | method |
public function getTrack(index:uint):MidiTrack
gets a track from list
Parameters
index:uint — must be a uint >= 0 and < totalTracks
|
MidiTrack — return null if index is equal or higher than totalTracks
|
getTrackTypeDescription | () | method |
public function getTrackTypeDescription():String
MIDI file track type, 0: single track file format. 1:multiple track file format. 2:multiple song file format.
ReturnsString — String telling a detailed description
|
loadFile | () | method |
public function loadFile(filename:String):void
Loads externally a binary file with a MIDI standard estructure
Parameters
filename:String — url of the .mid file, it can be both a local file or a remote location from a web server (see security limitations)
|
loadFromBytes | () | method |
public function loadFromBytes(bin_file:ByteArray):void
Load a MIDI file structure from a ByteArray
Parameters
bin_file:ByteArray — ByteArray file, note that you must specify the starting position of the file, this function doesn't set bin_file.position = 0
|
nextEvent | () | method |
public function nextEvent():Boolean
You control the workflow and when the events are read. As long as you're ready for carry on reading the file just call nextEvent
Boolean — returns true if any data was read, otherwise false , normally when it reaches the end of the file.
|
ON_DATA_ERROR | Event |
flash.events.Event
com.yoambulante.midifiles.MidiFilesReader.ON_DATA_ERROR
Dispatched if during the reading process there was any unexpected byte or error.
ON_DATA_LOADED | Event |
flash.events.Event
com.yoambulante.midifiles.MidiFilesReader.ON_DATA_LOADED
Dispatched when the midi file was read successfully and content valid data.
ON_HEADER_LOADED | Event |
flash.events.Event
com.yoambulante.midifiles.MidiFilesReader.ON_HEADER_LOADED
Dispatched as soon as the midi header file was found when reading the binary content.
ON_DATA_ERROR | Constant |
public static const ON_DATA_ERROR:String = ON_DATA_ERROR
ON_DATA_LOADED | Constant |
public static const ON_DATA_LOADED:String = ON_DATA_LOADED
ON_HEADER_LOADED | Constant |
public static const ON_HEADER_LOADED:String = ON_HEADER_LOADED