Methods Summary |
---|
public int[] | addControllerEventListener(javax.sound.midi.ControllerEventListener listener, int[] controllers)
throw new UnsupportedOperationException();
|
public boolean | addMetaEventListener(javax.sound.midi.MetaEventListener listener)
throw new UnsupportedOperationException();
|
public void | close()
if (isOpen()) {
stop();
player = null;
}
|
public com.android.internal.sound.midi.AndroidSequencer$Info | getDeviceInfo()
return new Info();
|
public int | getLoopCount()
throw new UnsupportedOperationException();
|
public long | getLoopEndPoint()
throw new UnsupportedOperationException();
|
public long | getLoopStartPoint()
throw new UnsupportedOperationException();
|
public SyncMode | getMasterSyncMode()
throw new UnsupportedOperationException();
|
public SyncMode[] | getMasterSyncModes()
throw new UnsupportedOperationException();
|
public int | getMaxReceivers()
return 0;
|
public int | getMaxTransmitters()
return 0;
|
public long | getMicrosecondLength()
throw new UnsupportedOperationException();
|
public long | getMicrosecondPosition()
throw new UnsupportedOperationException();
|
public javax.sound.midi.Receiver | getReceiver()
throw new MidiUnavailableException("No receiver available");
|
public java.util.List | getReceivers()
return new ArrayList<Receiver>();
|
public javax.sound.midi.Sequence | getSequence()
return sequence;
|
public SyncMode | getSlaveSyncMode()
throw new UnsupportedOperationException();
|
public SyncMode[] | getSlaveSyncModes()
throw new UnsupportedOperationException();
|
public float | getTempoFactor()
throw new UnsupportedOperationException();
|
public float | getTempoInBPM()
throw new UnsupportedOperationException();
|
public float | getTempoInMPQ()
throw new UnsupportedOperationException();
|
public long | getTickLength()
throw new UnsupportedOperationException();
|
public long | getTickPosition()
throw new UnsupportedOperationException();
|
public boolean | getTrackMute(int track)
throw new UnsupportedOperationException();
|
public boolean | getTrackSolo(int track)
throw new UnsupportedOperationException();
|
public javax.sound.midi.Transmitter | getTransmitter()
throw new MidiUnavailableException("No receiver available");
|
public java.util.List | getTransmitters()
return new ArrayList<Transmitter>();
|
public boolean | isOpen()
return player != null;
|
public boolean | isRecording()
return false;
|
public boolean | isRunning()
return player != null && player.isPlaying();
|
public void | open()
try {
player = new MediaPlayer();
} catch (Exception ex) {
throw new MidiUnavailableException(ex.toString());
}
|
public void | recordDisable(javax.sound.midi.Track track)
throw new UnsupportedOperationException();
|
public void | recordEnable(javax.sound.midi.Track track, int channel)
throw new UnsupportedOperationException();
|
public int[] | removeControllerEventListener(javax.sound.midi.ControllerEventListener listener, int[] controllers)
throw new UnsupportedOperationException();
|
public void | removeMetaEventListener(javax.sound.midi.MetaEventListener listener)
throw new UnsupportedOperationException();
|
public void | setLoopCount(int count)
throw new UnsupportedOperationException();
|
public void | setLoopEndPoint(long tick)
throw new UnsupportedOperationException();
|
public void | setLoopStartPoint(long tick)
throw new UnsupportedOperationException();
|
public void | setMasterSyncMode(SyncMode sync)
throw new UnsupportedOperationException();
|
public void | setMicrosecondPosition(long microseconds)
throw new UnsupportedOperationException();
|
public void | setSequence(java.io.InputStream stream)
setSequence(new AndroidMidiFileReader().getSequence(stream));
|
public void | setSequence(javax.sound.midi.Sequence sequence)
if (!(sequence instanceof AndroidSequence)) {
throw new InvalidMidiDataException("Sequence must be an AndroidSequence");
}
if (isRunning()) {
stop();
}
this.sequence = (AndroidSequence)sequence;
|
public void | setSlaveSyncMode(SyncMode sync)
throw new UnsupportedOperationException();
|
public void | setTempoFactor(float factor)
throw new UnsupportedOperationException();
|
public void | setTempoInBPM(float bpm)
throw new UnsupportedOperationException();
|
public void | setTempoInMPQ(float mpq)
throw new UnsupportedOperationException();
|
public void | setTickPosition(long tick)
throw new UnsupportedOperationException();
|
public void | setTrackMute(int track, boolean mute)
throw new UnsupportedOperationException();
|
public void | setTrackSolo(int track, boolean solo)
throw new UnsupportedOperationException();
|
public void | start()
if (!isOpen()) {
throw new IllegalStateException("Sequencer must be open");
}
if (sequence == null) {
throw new IllegalStateException("Need a Sequence to play");
}
if (!isRunning()) {
/*
* This is ugly, but there is no way around it: The javax.sound API
* doesn't expect to throw an exception at this point for illegal
* MIDI sequences. Since we don't really construct the MIDI sequence
* from the original binary data, but only refer to its URL, the
* MediaPlayer can actually bail out at this point. We wrap the
* exception into a RuntimeException, to at least keep the API
* contract.
*/
try {
String s = this.sequence.getURL().toExternalForm();
/*
* TODO Workaround for 1107794: MediaPlayer doesn't handle
* "file:" URLs. Get rid of this.
*/
if (s.startsWith("file:")) {
s = s.substring(5);
}
player.setDataSource(s);
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.prepare();
} catch (IOException ex) {
throw new RuntimeException(ex.toString());
}
player.start();
}
|
public void | startRecording()
throw new UnsupportedOperationException();
|
public void | stop()
if (!isOpen()) {
throw new IllegalStateException("Sequencer must be open");
}
if (isRunning()) {
player.stop();
}
|
public void | stopRecording()
throw new UnsupportedOperationException();
|