|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.audio.Sequence
public abstract class Sequence
Sequences types are: midi, xmf, rmf, sms, smaf, imedoly, mono ringtone formats.
You can get more information from www.midi.org
To load a Sequence object do:
mSeq = AudioManager.createSequence();
mSeq.load(byte[]);
or
mSeq = Sequence.load(byte[]);
Then to start do:
mSeq.start(ToneFilter.BUZZER | ToneFilter.FLASHER);
| Field Summary | |
|---|---|
static byte |
BANK
Bank controller. |
static byte |
CONTROL_CHANGE
MIDI controller change command use with parseMidiData(byte, byte, byte, byte, int) |
static byte |
DATA_LSB
|
static byte |
DATA_MSB
|
static byte |
DEFAULT_BANK
Default bank: 0 |
static byte |
DEFAULT_PROGRAM
Default program: 0 |
static byte |
EXPRESSION
Volume expression controller. |
static byte |
LED_BRIGHTNESS
Danger specific control. |
static byte |
LED_HUE
Danger specific control. |
static byte |
LED_MOOD_BOTTOM_LEFT_BRIGHTNESS
Danger specific control. |
static byte |
LED_MOOD_BOTTOM_RIGHT_BRIGHTNESS
Danger specific control. |
static byte |
LED_MOOD_TOP_LEFT_BRIGHTNESS
Danger specific control. |
static byte |
LED_MOOD_TOP_RIGHT_BRIGHTNESS
Danger specific control. |
static byte |
LED_PURITY
Danger specific control. |
static byte |
MAX_BANKS
three GM banks; three user banks |
static int |
MAX_INSTRUMENTS
MIDI number of programs per patch bank |
static byte |
MAX_MIDI_CHANNELS
Max MIDI channels |
static byte |
MAX_MIDI_TRACKS
64 MIDI tracks, plus 1 tempo track |
static byte |
MAX_MIDI_VOLUME
Max channel volume |
static int |
MAX_NOTE_NUMBER
There are 128 notes on the midi scale. |
static int |
MAX_TRANSPOSE_DOWN
Max transpose down is 64 semitones |
static int |
MAX_TRANSPOSE_UP
Max transpose up is 63 semitones |
protected Object |
mLock
|
static byte |
MODULATION
Modulation controller. |
static byte |
NOTE_OFF
MIDI note off command use with parseMidiData(byte, byte, byte, byte, int) |
static byte |
NOTE_ON
MIDI note on command use with parseMidiData(byte, byte, byte, byte, int) |
static byte |
NPRN_BUZZER_LSB
Danger specific NRPN's |
static byte |
NPRN_BUZZER_MSB
|
static byte |
NPRN_FLASHER_LSB
|
static byte |
NPRN_FLASHER_MSB
|
static byte |
NRPN_LSB
Controller values. |
static byte |
NRPN_MSB
|
static byte |
PERCUSSION_CHANNEL
MIDI percussion channel, zero based |
static byte |
PITCH_BEND
MIDI pitch bend command use with parseMidiData(byte, byte, byte, byte, int) |
static byte |
PROGRAM_CHANGE
MIDI program change command use with parseMidiData(byte, byte, byte, byte, int) |
static byte |
RPN_LSB
|
static byte |
RPN_MSB
|
static byte |
SUSTAIN
Sustain controller. |
static byte |
VIBRATE
Danger specific control. |
static byte |
VIBRATE_70MS
Danger specific control. |
static byte |
VOLUME
Volume controller. |
| Fields inherited from interface danger.media.PlayableMedia |
|---|
DEFAULT_PRIORITY, PRIORITY_1, PRIORITY_2, PRIORITY_3, PRIORITY_4, PRIORITY_5 |
| Method Summary | |
|---|---|
void |
allNotesOff()
Stop at notes currently playing ASAP. |
void |
allNotesOff(int time)
Stop at notes currently playing at a specific time. |
void |
allowChannelTranspose(byte channel,
boolean allowPitch)
Set a specific channel ability to transpose when PlayableAudio.setTranspose(int) is used. |
boolean |
areMidiEventsPending()
Returns true if any MIDI events pending in the event queue. |
void |
controlChange(byte channel,
byte controlNumber,
byte controlValue)
Controller event. |
void |
controlChange(byte channel,
byte controlNumber,
byte controlValue,
int time)
Controller event. |
void |
destroy()
Free internal resources for this object. |
boolean |
doesChannelAllowTranspose(byte channel)
Get the tranpose allow state of a specific channel. |
void |
fadeFromToInTime(int sourceVolume,
int destVolume,
int timeInMilliseconds)
Fade from source volume, to dest volume in time milliseconds. |
byte |
getBank(byte channel)
Deprecated. - use getBankLSB(byte) instead |
byte |
getBankLSB(byte channel)
Get the LSB for the currently selected GM2 bank |
byte |
getBankMSB(byte channel)
Get the MSB for the currently selected GM2 bank |
void |
getChannelMuteStatus(boolean[] pChannels)
Get all channel mute status at once. |
void |
getChannelSoloStatus(boolean[] pChannels)
Get all channel solo status at once. |
byte |
getControlValue(byte channel,
byte controller)
Get the current MIDI controler value. |
int |
getCurrentLoopNumber()
Gets the number of times the looped media has looped back to the loop start. |
byte[] |
getData()
Return MIDI/SMS sequence data once loaded |
int |
getLoopCount()
Gets the loop count; which is the total number of times an object is played. |
int |
getLoops()
Deprecated. use getLoopCount() instead. |
int |
getMarkerCount()
Gets the number of markers contained by the currently loaded media. |
int |
getMarkerID(int index)
Return the integer ID associated with the marker at the given index. |
int |
getMarkerIDByIndex(int index)
Return the integer ID associated with the marker at the given index. |
String |
getMarkerName(int index)
Return the name associated with the marker at the given index. |
String |
getMarkerNameByID(int markerID)
Return the name associated with the marker with the given markerID. |
String |
getMarkerNameByIndex(int index)
Return the name associated with the marker at the given index. |
int |
getMarkerPosition(int index)
Return the position in milliseconds of the marker at the given index. |
int |
getMarkerPositionByID(int markerID)
Return the position in milliseconds of the marker with the given markerID. |
int |
getMarkerPositionByIndex(int index)
Return the position in milliseconds of the marker at the given index. |
int |
getMasterTempo()
Get song master tempo. |
int |
getMediaType()
Returns file type of media. |
int |
getMicrosecondLength()
Deprecated. - use getMillisecondLength() instead. |
int |
getMicrosecondPosition()
Deprecated. - use getMillisecondPosition() instead. |
int |
getMillisecondLength()
Get length in milliseconds of object's media. |
int |
getMillisecondPosition()
Get the current playback position of a object in milliseconds. |
byte |
getPitchBendLSB(byte channel)
Get pitch bend LSB. |
byte |
getPitchBendMSB(byte channel)
Get pitch bend MSB. |
int |
getPlaybackRate()
Get the playback rate. |
int |
getPriority()
Get media priority level. |
byte |
getProgram(byte channel)
Get the current MIDI program |
void |
getSoloTrackStatus(boolean[] pTracks)
Get all track solo status at once. |
int |
getStereoPosition()
Returns current stereo position. |
int |
getTempo()
Get song current tempo |
String |
getTitle()
Return title, if available of Sequence |
void |
getTrackMuteStatus(boolean[] pTracks)
Get all track mute status at once. |
int |
getTranspose()
Get tuning in semitones. |
int |
getTuning()
Get tuning in cents. |
int |
getType()
Get type of sequence. |
int |
getUniqueID()
Return runtime ID. |
int |
getVolume()
Get volume. |
int |
getVolumeClass()
Get the current volume class. |
boolean |
isDone()
Returns true if object is finished playing. |
boolean |
isInstrumentLoaded(byte patch,
byte bankLSB,
byte bankMSB)
Determine if a GM2 instrument is loaded via patch number and bank LSB/MSB. |
boolean |
isInstrumentLoaded(int instrument)
Deprecated. Use isInstrumentLoaded(byte, byte, byte) |
boolean |
isLoaded()
Returns true if object is loaded and ready to be played. |
boolean |
isLoopingEnabled()
Return whether looping is enabled (set by a call to PlayableMedia.setLoopingEnabled(boolean)). |
boolean |
isMuted()
Get mute status. |
boolean |
isPaused()
Returns true if paused. |
boolean |
isPlaying()
Returns true if object is playing. |
static Sequence |
load(byte[] data)
Given an array of bytes, try and load a Sequence (Can be a MIDI, RMF, or XMF file) Will return null if data is invalid. |
static Sequence |
load(byte[] data,
boolean autoDelete)
Deprecated. As of 4.0, replaced by load(byte []) |
static Sequence |
load(File f)
Given a sequence file, try and load it (Can be a MIDI, RMF, or XMF file) Will return null if file data is invalid. |
static Sequence |
load(File f,
boolean autoDelete)
Deprecated. As of 4.0, replaced by load(File) |
boolean |
loadFromData(byte[] data)
Load data and return true if ok |
boolean |
loadFromFile(byte[] data)
Given a block of data, figure out if it is a sequence file format, and load it if so. |
boolean |
loadFromMidi(byte[] data)
Deprecated. - use loadFromFile(byte[]) instead |
boolean |
loadFromMIDPToneSeq(byte[] data)
Parse a byte array that is in the Midp Tone control spec and turns it into a Sequence. |
boolean |
loadFromResource(int id)
Pass an ID, and read data from the application resource file or the system resource file. |
boolean |
loadFromResource(int id,
Application app)
Pass an ID, and read data from the application resource file or the system resource file. |
boolean |
loadFromRingtone(byte[] data)
Deprecated. - use loadFromFile(byte[]) instead |
boolean |
loadFromRingtone(String ringtone)
Load a Nokia SMS formatted String that is encoded as ascii hex into a Sequence. |
boolean |
loadFromRmf(byte[] data)
Deprecated. - use loadFromFile(byte[]) instead |
boolean |
loadInstrument(byte patch,
byte bankLSB,
byte bankMSB)
Load a GM2 instrument via patch number and bank LSB/MSB. |
boolean |
loadInstrument(int instrument)
Deprecated. Use loadInstrument(byte, byte, byte) |
void |
muteChannel(byte channel)
Mute a specific channel. |
void |
muteTrack(byte track)
Mute a specific track. |
void |
noteOff(byte channel,
byte note,
byte velocity)
Note off event. |
void |
noteOff(byte channel,
byte note,
byte velocity,
int time)
Note off event. |
void |
noteOn(byte channel,
byte note,
byte velocity)
Note on event. |
void |
noteOn(byte channel,
byte note,
byte velocity,
int time)
Note on event. |
void |
noteOnWithLoad(byte channel,
byte note,
byte velocity)
Note on event. |
void |
noteOnWithLoad(byte channel,
byte note,
byte velocity,
int time)
Note on event. |
void |
NRPN(byte channel,
byte lsb,
byte msb,
byte value)
Non registered parameters |
void |
NRPN(byte channel,
byte lsb,
byte msb,
byte value,
int time)
Non registered parameters |
void |
parseMidiData(byte commandByte,
byte data1Byte,
byte data2Byte,
byte data3Byte)
Given a midi stream, parse it out to the various midi functions for example: 0x92 0x50 0x7F 0x00 comandByte data1Byte data2Byte data3Byte Note 80 on with a velocity of 127 on channel 2 |
void |
parseMidiData(byte commandByte,
byte data1Byte,
byte data2Byte,
byte data3Byte,
int time)
Given a midi stream, parse it out to the various midi functions for example: 0x92 0x50 0x7F 0x00 comandByte data1Byte data2Byte data3Byte Note 80 on with a velocity of 127 on channel 2 |
void |
parseSysex(byte[] sysex)
Send sysex message to sequencer immediately. |
void |
parseSysex(byte[] sysex,
int time)
Send sysex message to sequencer at a particular time. |
void |
pause()
Will pause object. |
void |
pitchBend(byte channel,
byte lsb,
byte msb)
Pitch bend event. |
void |
pitchBend(byte channel,
byte lsb,
byte msb,
int time)
Pitch bend event. |
void |
play()
Given a sequence file, start it playing, and auto delete it when done playing. |
static Sequence |
play(byte[] data)
Given an array of bytes load a sequence file, start it playing, and auto delete it when done playing. |
static Sequence |
play(byte[] data,
boolean autoDelete)
Deprecated. As of 4.0, replaced by play(byte []) |
static Sequence |
play(File f)
Given a sequence file, start it playing, and auto delete it when done playing. |
static Sequence |
play(File f,
boolean autoDelete)
Deprecated. As of 4.0, replaced by play(File) |
static Sequence |
play(int resourceID)
Method to load a sequence file from a resource, start it playing, and auto delete it when done playing. |
static Sequence |
play(int resourceID,
boolean autoDelete)
Deprecated. As of 4.0, replaced by play(int) |
void |
programBankChange(byte channel,
byte programNumber,
byte bankNumber)
Deprecated. Use programBankChange(byte, byte, byte, byte, int) |
void |
programBankChange(byte channel,
byte programNumber,
byte bankLSB,
byte bankMSB,
int time)
Select GM2 MIDI program for the specified channel using program number and bank LSB/MSB |
void |
programBankChange(byte channel,
byte programNumber,
byte bankNumber,
int time)
Deprecated. Use programBankChange(byte, byte, byte, byte, int) |
void |
programChange(byte channel,
byte programNumber)
Select MIDI program for the specified channel using program number. |
void |
programChange(byte channel,
byte programNumber,
int time)
Select MIDI program for the specified channel using program number. |
void |
resume()
Will resume object if paused. |
void |
RPN(byte channel,
byte lsb,
byte msb,
byte value)
GM Registered parameters |
void |
RPN(byte channel,
byte lsb,
byte msb,
byte value,
int time)
GM Registered parameters |
void |
setBuzzFlash(boolean buzzOn,
boolean flashOn)
Set auto generate buzz/flash on or off. |
void |
setBuzzFlashEnable(boolean buzzOn,
boolean flashOn)
Set buzz/flash enable on or off. |
void |
setDoneCallbackEvent(Event done)
Set the event that is called when this media is finished. |
void |
setDoneCallbackEvent(Event done,
boolean doEventOnce)
Set the event that is called when this media is finished. |
void |
setFlashOnlyEnable(boolean flashOnly)
Enable/disable Mood Lights. |
void |
setLoopCount(int loopCount)
Sets the loop count; which is the total number of times an object is played. |
void |
setLoopingEnabled(boolean on)
Enable looping. |
void |
setLoops(int loops)
Deprecated. use setLoopCount(int) instead. |
void |
setMasterTempo(int tempoFactor)
Set song master tempo. |
void |
setMicrosecondPosition(int ticks)
Deprecated. - use setMillisecondPosition(int) instead. |
void |
setMillisecondPosition(int position)
Set the current playback position of object in milliseconds. |
void |
setMute(boolean mute)
Mute or unmute the audio. |
void |
setPlaybackRate(int rate)
Set the playback rate |
void |
setPositionCallbackEvent(Event event,
int position)
Set an event that is called when this media reaches the given position during playback. |
void |
setPositionToMarker(int markerID)
Set the media playback position to the position associated with the marker with the given markerID. |
void |
setPositionToMarkerByID(int markerID)
Set the media playback position to the position associated with the marker with the given markerID. |
void |
setPositionToMarkerByIndex(int index)
Set the media playback position to the position associated with the marker at the give index. |
void |
setPriority(int priority)
Set media priority level. |
void |
setRouteBus(int routeBus)
Set audio route. |
void |
setStereoPosition(int position)
Set the stereo position of sound. |
void |
setStoppedCallbackEvent(Event stopped)
Set the event that is called when this media is stopped by stop(). |
void |
setStoppedCallbackEvent(Event stopped,
boolean doEventOnce)
Set the event that is called when this media is stopped by stop(). |
void |
setTempo(int beatsPerMinute)
Set song current tempo. |
void |
setTranspose(int semitones)
Set tuning in semitones. |
void |
setTuning(int cents)
Set tuning in cents. |
void |
setVolume(int volume)
Set volume. |
void |
setVolumeClass(int volumeClass)
Set the volume class. |
void |
soloChannel(byte channel)
Solo a specific channel. |
void |
soloTrack(byte track)
Solo a specific track. |
void |
start()
Start sequence. |
void |
start(int filter)
Start a sequence, but filter content types from ToneFilter. |
void |
start(int filter,
int volume)
Start a sequence, but filter content types by ToneFilter and
set a volume level prior to starting. |
boolean |
startAtOffset(int startOffset)
Start object at an offset. |
boolean |
startDefault()
Start Sequence with defaults. |
void |
startPlaying()
Start media playback with default attributes. |
void |
startPlaying(int attributes)
Start media playback with specified attributes. |
boolean |
startWithFilter(int filter)
Start Sequence with a filter. |
void |
stop()
Will stop the object and reset to begining. |
void |
stopPlaying()
Stop media playback. |
int |
translateBankProgramToInstrument(byte bank,
byte program,
byte channel,
byte note)
Deprecated. Use only with loadInstrument(int) and unloadInstrument(int) |
boolean |
unloadInstrument(byte patch,
byte bankLSB,
byte bankMSB)
Unload a GM2 instrument via patch number and bank LSB/MSB. |
boolean |
unloadInstrument(int instrument)
Deprecated. Use unloadInstrument(byte, byte, byte) |
void |
unmuteChannel(byte channel)
Unmute a specific channel. |
void |
unmuteTrack(byte track)
Unmute a specific track. |
void |
unSoloChannel(byte channel)
Unsolo a specific channel. |
void |
unSoloTrack(byte track)
Unsolo a specific track. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte NOTE_ON
parseMidiData(byte, byte, byte, byte, int)
public static final byte NOTE_OFF
parseMidiData(byte, byte, byte, byte, int)
public static final byte CONTROL_CHANGE
parseMidiData(byte, byte, byte, byte, int)
public static final byte PROGRAM_CHANGE
parseMidiData(byte, byte, byte, byte, int)
public static final byte PITCH_BEND
parseMidiData(byte, byte, byte, byte, int)
public static final byte NRPN_LSB
controlChange(byte, byte, byte, int)
public static final byte NRPN_MSB
public static final byte RPN_LSB
public static final byte RPN_MSB
public static final byte DATA_LSB
public static final byte DATA_MSB
public static final byte VOLUME
controlChange(byte, byte, byte, int)
public static final byte BANK
controlChange(byte, byte, byte, int)
public static final byte MODULATION
controlChange(byte, byte, byte, int)
public static final byte EXPRESSION
controlChange(byte, byte, byte, int)
public static final byte SUSTAIN
controlChange(byte, byte, byte, int)
public static final byte VIBRATE
controlChange(byte, byte, byte, int)A value >0 will turn on the vibration, until a value of 0 is set.
mSeq->controlChange((byte)1, VIBRATE, (byte)1);
public static final byte LED_HUE
controlChange(byte, byte, byte, int)This value changes the LED's hue.
mSeq->controlChange((byte)1, LED_HUE, (byte)43);
public static final byte LED_PURITY
controlChange(byte, byte, byte, int)This value changes the LED's purity.
mSeq->controlChange((byte)1, LED_PURITY, (byte)43);
public static final byte LED_BRIGHTNESS
controlChange(byte, byte, byte, int)This value changes the LED's brightness.
mSeq->controlChange((byte)1, LED_BRIGHTNESS, (byte)43);
public static final byte LED_MOOD_BOTTOM_LEFT_BRIGHTNESS
controlChange(byte, byte, byte, int)This value changes the LED #1's brightness.
mSeq->controlChange((byte)1, LED_MOOD_BOTTOM_LEFT_BRIGHTNESS, (byte)43);
public static final byte LED_MOOD_BOTTOM_RIGHT_BRIGHTNESS
controlChange(byte, byte, byte, int)This value changes the LED #2's brightness.
mSeq->controlChange((byte)1, LED_MOOD_BOTTOM_RIGHT_BRIGHTNESS, (byte)43);
public static final byte LED_MOOD_TOP_LEFT_BRIGHTNESS
controlChange(byte, byte, byte, int)This value changes the LED #3's brightness.
mSeq->controlChange((byte)1, LED_MOOD_TOP_LEFT_BRIGHTNESS, (byte)43);
public static final byte LED_MOOD_TOP_RIGHT_BRIGHTNESS
controlChange(byte, byte, byte, int)This value changes the LED #4's brightness.
mSeq->controlChange((byte)1, LED_MOOD_TOP_RIGHT_BRIGHTNESS, (byte)43);
public static final byte VIBRATE_70MS
controlChange(byte, byte, byte, int)A value >0 will turn on the vibration for 70 milliseconds and turn off if 0.
mSeq->controlChange((byte)1, VIBRATE_70MS, (byte)1);
public static final byte NPRN_BUZZER_LSB
public static final byte NPRN_BUZZER_MSB
public static final byte NPRN_FLASHER_LSB
public static final byte NPRN_FLASHER_MSB
public static final byte MAX_MIDI_CHANNELS
public static final byte MAX_MIDI_VOLUME
public static final byte MAX_MIDI_TRACKS
public static final int MAX_INSTRUMENTS
public static final int MAX_NOTE_NUMBER
public static final byte MAX_BANKS
public static final int MAX_TRANSPOSE_UP
public static final int MAX_TRANSPOSE_DOWN
public static final byte DEFAULT_PROGRAM
public static final byte DEFAULT_BANK
public static final byte PERCUSSION_CHANNEL
protected Object mLock
| Method Detail |
|---|
public static Sequence load(byte[] data,
boolean autoDelete)
load(byte [])
setLoops(int) with 0 to clear the loop points.
public static Sequence load(byte[] data)
setLoops(int) with 0 to clear the loop points.
public static Sequence play(byte[] data,
boolean autoDelete)
play(byte [])
load(byte[], boolean) then start() without the filters.
public static Sequence play(byte[] data)
load(byte[], boolean) then start() without the filters.
public static Sequence play(int resourceID,
boolean autoDelete)
play(int)
load(byte[], boolean) then start() without the filters.
public static Sequence play(int resourceID)
load(byte[], boolean) then start() without the filters.
public static Sequence load(File f,
boolean autoDelete)
load(File)
setLoops(int) with 0 to clear the loop points.
public static Sequence load(File f)
setLoops(int) with 0 to clear the loop points.
public static Sequence play(File f,
boolean autoDelete)
play(File)
load(byte[], boolean) then start() without the filters.
public static Sequence play(File f)
load(byte[], boolean) then start() without the filters.
public void play()
load(byte[], boolean)
then start() without the filters.
public String getTitle()
public byte[] getData()
public int getType()
Format.Typepublic boolean loadFromData(byte[] data)
public boolean loadFromRingtone(String ringtone)
"024A3A5D19B1B9D1CDD1B804005124650490418A24849B6194124106194
1761661661761961241441621021941241062892126D86504904186505D
85985985D865849051048800"
public boolean loadFromMIDPToneSeq(byte[] data)
data - byte array that is in the format. See
ToneControl.public boolean loadFromMidi(byte[] data)
loadFromFile(byte[]) instead
public boolean loadFromRingtone(byte[] data)
loadFromFile(byte[]) instead
public boolean loadFromRmf(byte[] data)
loadFromFile(byte[]) instead
public boolean loadFromFile(byte[] data)
public boolean loadFromResource(int id)
id - resource ID.
public boolean loadFromResource(int id,
Application app)
id - resource ID.app - Application resource database to search.
public void setLoops(int loops)
setLoopCount(int) instead.
startDefault().
loops - number of times to looppublic void start()
public boolean startWithFilter(int filter)
filter - one or combined bits of ToneFilter
public boolean startDefault()
public void start(int filter,
int volume)
ToneFilter and
set a volume level prior to starting.
public void start(int filter)
ToneFilter.
If you pass in ToneFilter.BUZZER or ToneFilter.FLASHER and
there are no specific controller events in the midi file,
then the flash and buzz will be synthetically generated by looking
at the percussion track first, then the first channel of
data.
VIBRATE,
VIBRATE_70MS,
LED_HUE,
LED_PURITY,
LED_BRIGHTNESS,
ToneFilter.BUZZER,
ToneFilter.FLASHERpublic boolean areMidiEventsPending()
public void setMasterTempo(int tempoFactor)
tempoFactor - This is a multipler on the playback speed. A value of 100
uses song's encoded tempo, and 200 will play twice as fast, and 50 will
play half as fast.public int getMasterTempo()
setMasterTempo(int) then
this will return 100, or what's encoded in the file.
public void setTempo(int beatsPerMinute)
public int getTempo()
public void setPlaybackRate(int rate)
setPlaybackRate in interface PlayableMediarate - rate of playback. 100 is normal, 200 is double speed,
50 is half speedpublic int getPlaybackRate()
getPlaybackRate in interface PlayableMediapublic void muteTrack(byte track)
track - 0 to 64public void unmuteTrack(byte track)
track - 0 to 64public void getTrackMuteStatus(boolean[] pTracks)
pTracks - a 65 byte array.public void soloTrack(byte track)
track - 0 to 64public void unSoloTrack(byte track)
track - 0 to 64public void getSoloTrackStatus(boolean[] pTracks)
pTracks - a 65 byte array.public int getMicrosecondLength()
getMillisecondLength() instead.
public void setMicrosecondPosition(int ticks)
setMillisecondPosition(int) instead.
public int getMicrosecondPosition()
getMillisecondPosition() instead.
public void allowChannelTranspose(byte channel,
boolean allowPitch)
PlayableAudio.setTranspose(int) is used.
channel - MIDI channel. 0 to 15.allowPitch - true/falsepublic boolean doesChannelAllowTranspose(byte channel)
channel - MIDI channel. 0 to 15.
public void muteChannel(byte channel)
channel - MIDI channel. 0 to 15.public void unmuteChannel(byte channel)
channel - MIDI channel. 0 to 15.public void getChannelMuteStatus(boolean[] pChannels)
pChannels - a 16 byte array.public void soloChannel(byte channel)
channel - MIDI channel. 0 to 15.public void unSoloChannel(byte channel)
channel - MIDI channel. 0 to 15.public void getChannelSoloStatus(boolean[] pChannels)
pChannels - a 16 byte array.public boolean loadInstrument(int instrument)
loadInstrument(byte, byte, byte)
public boolean unloadInstrument(int instrument)
unloadInstrument(byte, byte, byte)
public boolean isInstrumentLoaded(int instrument)
isInstrumentLoaded(byte, byte, byte)
public boolean loadInstrument(byte patch,
byte bankLSB,
byte bankMSB)
patch - MIDI patch number (0-127)bankLSB - LSB of a MIDI bank numberbankMSB - MSB of a MIDI bank number
public boolean unloadInstrument(byte patch,
byte bankLSB,
byte bankMSB)
patch - MIDI patch number (0-127)bankLSB - LSB of a MIDI bank numberbankMSB - MSB of a MIDI bank number
public boolean isInstrumentLoaded(byte patch,
byte bankLSB,
byte bankMSB)
patch - MIDI patch number (0-127)bankLSB - LSB of a MIDI bank numberbankMSB - MSB of a MIDI bank number
public int translateBankProgramToInstrument(byte bank,
byte program,
byte channel,
byte note)
loadInstrument(int) and unloadInstrument(int)
channel - MIDI channel. 0 to 15.program - MIDI program. 0 to 127.note - MIDI note. 0 to 127.bank - MIDI bank. 0 to 3.
public byte getControlValue(byte channel,
byte controller)
channel - MIDI channel. 0 to 15.controller - MIDI controller. 0 to 127.public byte getProgram(byte channel)
channel - MIDI channel. 0 to 15.public byte getBankMSB(byte channel)
channel - MIDI channel. 0 to 15.public byte getBankLSB(byte channel)
channel - MIDI channel. 0 to 15.public byte getBank(byte channel)
getBankLSB(byte) instead
channel - MIDI channel. 0 to 15.public byte getPitchBendLSB(byte channel)
channel - MIDI channel. 0 to 15.public byte getPitchBendMSB(byte channel)
channel - MIDI channel. 0 to 15.
public void parseMidiData(byte commandByte,
byte data1Byte,
byte data2Byte,
byte data3Byte,
int time)
0x92 0x50 0x7F 0x00
comandByte data1Byte data2Byte data3Byte
Note 80 on with a velocity of 127 on channel 2
commandByte - MIDI command bytedata1Byte - data byte specific to commandBytedata2Byte - data byte specific to commandBytedata3Byte - data byte specific to commandBytetime - time in microseconds
public void parseMidiData(byte commandByte,
byte data1Byte,
byte data2Byte,
byte data3Byte)
0x92 0x50 0x7F 0x00
comandByte data1Byte data2Byte data3Byte
Note 80 on with a velocity of 127 on channel 2
commandByte - MIDI command bytedata1Byte - data byte specific to commandBytedata2Byte - data byte specific to commandBytedata3Byte - data byte specific to commandByte
public void parseSysex(byte[] sysex,
int time)
public void parseSysex(byte[] sysex)
public void noteOff(byte channel,
byte note,
byte velocity,
int time)
If you pass AudioManager.NOW for time the current time will be passed The channel variable is 0 to 15. Channel 9 is percussion for example. The programNumber variable is a number from 0-127. note is a MIDI note value. 0-127. Higher numbers are higher in pitch.
channel - MIDI channel. 0 to 15.note - MIDI note. 0 to 127.velocity - MIDI velocity. 0 to 127.time - event start time in microseconds.
public void noteOff(byte channel,
byte note,
byte velocity)
channel - MIDI channel. 0 to 15.note - MIDI note. 0 to 127.velocity - MIDI velocity. 0 to 127.
public void noteOnWithLoad(byte channel,
byte note,
byte velocity,
int time)
Will load an instrument if not currently loaded.
channel - MIDI channel. 0 to 15.note - MIDI note. 0 to 127.velocity - MIDI velocity. 0 to 127.time - event start time in microseconds.
public void noteOnWithLoad(byte channel,
byte note,
byte velocity)
Will load an instrument if not currently loaded.
channel - MIDI channel. 0 to 15.note - MIDI note. 0 to 127.velocity - MIDI velocity. 0 to 127.
public void noteOn(byte channel,
byte note,
byte velocity,
int time)
channel - MIDI channel. 0 to 15.note - MIDI note. 0 to 127.velocity - MIDI velocity. 0 to 127.time - event start time in microseconds.
public void noteOn(byte channel,
byte note,
byte velocity)
channel - MIDI channel. 0 to 15.note - MIDI note. 0 to 127.velocity - MIDI velocity. 0 to 127.
public void controlChange(byte channel,
byte controlNumber,
byte controlValue,
int time)
channel - MIDI channel. 0 to 15.controlNumber - MIDI controller. 0 to 127.controlValue - value. 0 to 127.time - event start time in microseconds.
public void controlChange(byte channel,
byte controlNumber,
byte controlValue)
channel - MIDI channel. 0 to 15.controlNumber - MIDI controller. 0 to 127.controlValue - value. 0 to 127.
public void programBankChange(byte channel,
byte programNumber,
byte bankNumber,
int time)
programBankChange(byte, byte, byte, byte, int)
channel - MIDI channel. 0 to 15.programNumber - MIDI program. 0 to 127.bankNumber - value. 0 to 3.time - event start time in microseconds.
public void programBankChange(byte channel,
byte programNumber,
byte bankNumber)
programBankChange(byte, byte, byte, byte, int)
channel - MIDI channel. 0 to 15.programNumber - MIDI program. 0 to 127.bankNumber - value. 0 to 3.
public void programBankChange(byte channel,
byte programNumber,
byte bankLSB,
byte bankMSB,
int time)
channel - MIDI channel. 0 to 15.programNumber - MIDI program. 0 to 127.bankLSB - LSB bank.bankMSB - MSB bank.time - event start time in microseconds.
public void programChange(byte channel,
byte programNumber,
int time)
channel - MIDI channel. 0 to 15.programNumber - MIDI program. 0 to 127.time - event start time in microseconds.
public void programChange(byte channel,
byte programNumber)
channel - MIDI channel. 0 to 15.programNumber - MIDI program. 0 to 127.
public void pitchBend(byte channel,
byte lsb,
byte msb,
int time)
channel - MIDI channel. 0 to 15.lsb - LSB of bend amount. 0 to 127.msb - MSB of bend amount. 0 to 127.time - event start time in microseconds.
public void pitchBend(byte channel,
byte lsb,
byte msb)
channel - MIDI channel. 0 to 15.lsb - LSB of bend amount. 0 to 127.msb - MSB of bend amount. 0 to 127.
public void RPN(byte channel,
byte lsb,
byte msb,
byte value,
int time)
channel - MIDI channel. 0 to 15.lsb - LSB of bend amount. 0 to 127.msb - MSB of bend amount. 0 to 127.value - 0 to 127.time - event start time in microseconds.
public void RPN(byte channel,
byte lsb,
byte msb,
byte value)
channel - MIDI channel. 0 to 15.lsb - LSB of bend amount. 0 to 127.msb - MSB of bend amount. 0 to 127.value - 0 to 127.
public void NRPN(byte channel,
byte lsb,
byte msb,
byte value,
int time)
channel - MIDI channel. 0 to 15.lsb - LSB of bend amount. 0 to 127.msb - MSB of bend amount. 0 to 127.value - 0 to 127.time - event start time in microseconds.
public void NRPN(byte channel,
byte lsb,
byte msb,
byte value)
channel - MIDI channel. 0 to 15.lsb - LSB of bend amount. 0 to 127.msb - MSB of bend amount. 0 to 127.value - 0 to 127.public void allNotesOff(int time)
time - in microsecondspublic void allNotesOff()
public void destroy()
destroy in interface Playabledestroy in interface PlayableMediapublic void setRouteBus(int routeBus)
routeBus - one of Routepublic void setVolume(int volume)
setVolume in interface PlayablesetVolume in interface PlayableAudiovolume - 0 to 100 volume.public int getVolume()
getVolume in interface PlayablegetVolume in interface PlayableAudiopublic void setPriority(int priority)
PlayableMedia
setPriority in interface PlayableMediapriority - - priority level for mediapublic int getPriority()
PlayableMedia
getPriority in interface PlayableMediapublic int getLoops()
getLoopCount() instead.
getLoops in interface Playablepublic void setLoopCount(int loopCount)
PlayableMedia
setLoopCount in interface PlayableMedialoopCount - - total number of times to play; 0 means loop forever.public int getLoopCount()
PlayableMedia
getLoopCount in interface PlayableMedia
public void setBuzzFlashEnable(boolean buzzOn,
boolean flashOn)
PlayableAudio
setBuzzFlashEnable in interface PlayableAudiobuzzOn - if true, media will use vibrationflashOn - if true, media will use LEDpublic void setFlashOnlyEnable(boolean flashOnly)
flashOnly - true to disable mood lights, false to enable them
public void setBuzzFlash(boolean buzzOn,
boolean flashOn)
PlayableAudio
setBuzzFlash in interface PlayableAudiobuzzOn - if true, media will generate vibrationflashOn - if true, media will generate LED
public void fadeFromToInTime(int sourceVolume,
int destVolume,
int timeInMilliseconds)
PlayableAudio
fadeFromToInTime in interface PlayableAudiosourceVolume - range 0 to 100destVolume - range 0 to 100timeInMilliseconds - how long the fade takespublic boolean isLoaded()
isLoaded in interface PlayableisLoaded in interface PlayableMediapublic boolean isPaused()
isPaused in interface PlayableisPaused in interface PlayableMediapublic void pause()
pause in interface Playablepause in interface PlayableMediapublic void resume()
resume in interface Playableresume in interface PlayableMediapublic int getMillisecondLength()
PlayableMedia
getMillisecondLength in interface PlayableMediapublic int getMillisecondPosition()
PlayableMedia
getMillisecondPosition in interface PlayableMediapublic void setMillisecondPosition(int position)
PlayableMedia
setMillisecondPosition in interface PlayableMediaposition - position in media to seek topublic int getUniqueID()
getUniqueID in interface PlayablegetUniqueID in interface PlayableMediapublic int getMediaType()
PlayableMedia
getMediaType in interface PlayableMediapublic void setVolumeClass(int volumeClass)
setVolumeClass in interface PlayableAudiovolumeClass - one of VolumeSelectorpublic int getVolumeClass()
getVolumeClass in interface PlayableAudioVolumeSelectorpublic void setLoopingEnabled(boolean on)
PlayableMediaPlayableMedia.setLoopCount(int) or is 0 (loop forever) by default.
setLoopingEnabled in interface PlayableMediaon - enable or disable looping.public boolean isLoopingEnabled()
PlayableMediaPlayableMedia.setLoopingEnabled(boolean)).
isLoopingEnabled in interface PlayableMediapublic int getCurrentLoopNumber()
PlayableMedia
getCurrentLoopNumber in interface PlayableMediapublic int getMarkerCount()
MarkableMedia
getMarkerCount in interface MarkableMediagetMarkerCount in interface PlayableMediapublic int getMarkerIDByIndex(int index)
MarkableMedia
getMarkerIDByIndex in interface MarkableMediaindex - index of the marker (0 to (MarkableMedia.getMarkerCount() - 1))public int getMarkerID(int index)
PlayableMedia
getMarkerID in interface PlayableMediapublic String getMarkerNameByIndex(int index)
MarkableMedia
getMarkerNameByIndex in interface MarkableMediaindex - index of the marker (0 to (MarkableMedia.getMarkerCount() - 1))public String getMarkerNameByID(int markerID)
MarkableMedia
getMarkerNameByID in interface MarkableMediamarkerID - integer ID of the marker (retrieved via MarkableMedia.getMarkerIDByIndex(int))public String getMarkerName(int index)
PlayableMedia
getMarkerName in interface PlayableMediapublic int getMarkerPositionByIndex(int index)
MarkableMedia
getMarkerPositionByIndex in interface MarkableMediaindex - index of the marker (0 to (MarkableMedia.getMarkerCount() - 1))public int getMarkerPositionByID(int markerID)
MarkableMedia
getMarkerPositionByID in interface MarkableMediamarkerID - integer ID of the marker (retrieved via MarkableMedia.getMarkerIDByIndex(int))public int getMarkerPosition(int index)
PlayableMedia
getMarkerPosition in interface PlayableMediapublic void setPositionToMarkerByIndex(int index)
MarkableMedia
setPositionToMarkerByIndex in interface MarkableMediaindex - index of the marker (0 to (MarkableMedia.getMarkerCount() - 1))public void setPositionToMarkerByID(int markerID)
MarkableMedia
setPositionToMarkerByID in interface MarkableMediamarkerID - integer ID of the marker (retrieved via MarkableMedia.getMarkerIDByIndex(int))public void setPositionToMarker(int markerID)
PlayableMedia
setPositionToMarker in interface PlayableMediapublic void setStereoPosition(int position)
PlayableAudio
setStereoPosition in interface PlayableAudioposition - range is -100 (full left) to 100 (full right). Default is 0 (center)public int getStereoPosition()
PlayableAudio
getStereoPosition in interface PlayableAudiopublic void setMute(boolean mute)
PlayableAudio
setMute in interface PlayableAudiomute - true will mute, false will unmutepublic boolean isMuted()
PlayableAudio
isMuted in interface PlayableAudiopublic void startPlaying()
PlayableMedia
startPlaying in interface PlayableMediapublic void startPlaying(int attributes)
PlayableMedia
startPlaying in interface PlayableMediaattributes - - class-specific attributes applied to this playbackpublic boolean isPlaying()
PlayableMedia
isPlaying in interface PlayableMediapublic boolean isDone()
isDone in interface PlayableisDone in interface PlayableMediapublic void stopPlaying()
PlayableMedia
stopPlaying in interface PlayableMediapublic void setTranspose(int semitones)
setTuning(int) and getTuning().
A semitone, or half-step is a musical interval. A full octave is 12 semitones.
setTranspose in interface PlayableAudiosemitones - range -12 to 12public int getTranspose()
setTuning(int) has been called, This will truncate actual value to nearest 100 cents.
getTranspose in interface PlayableAudiopublic void setTuning(int cents)
setTranspose(int) and getTranspose().
setTuning in interface PlayableAudiocents - 1200 is down an octave, -1200 is up an octavepublic int getTuning()
setTranspose(int) and getTranspose()
getTuning in interface PlayableAudio
public void setPositionCallbackEvent(Event event,
int position)
PlayableMedia
setPositionCallbackEvent in interface PlayableMediaevent - - event to be postedposition - - time in milliseconds at which the event should be postedpublic void setDoneCallbackEvent(Event done)
PlayableMedia
setDoneCallbackEvent in interface PlayableMediadone - - event to be posted
public void setDoneCallbackEvent(Event done,
boolean doEventOnce)
PlayableMedia
setDoneCallbackEvent in interface PlayableMediadone - - event to be posteddoEventOnce - - if true, callback only called once for a given playbackpublic void setStoppedCallbackEvent(Event stopped)
PlayableMedia
setStoppedCallbackEvent in interface PlayableMediastopped - - event to be posted
public void setStoppedCallbackEvent(Event stopped,
boolean doEventOnce)
PlayableMedia
setStoppedCallbackEvent in interface PlayableMediastopped - - event to be posteddoEventOnce - - if true, callback only called once for a given playbackpublic boolean startAtOffset(int startOffset)
startOffset - offset in milliseconds.public void stop()
stop in interface Playable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||