supplies MIDI file-writing services. Classes
that implement this interface can write one or more types of MIDI file from
a
object.
Method from javax.sound.midi.spi.MidiFileWriter Detail: |
abstract public int[] getMidiFileTypes()
Obtains the set of MIDI file types for which file writing support is
provided by this file writer. |
abstract public int[] getMidiFileTypes(Sequence sequence)
Obtains the file types that this file writer can write from the
sequence specified. |
public boolean isFileTypeSupported(int fileType) {
int types[] = getMidiFileTypes();
for(int i=0; i< types.length; i++) {
if( fileType == types[i] ) {
return true;
}
}
return false;
}
Indicates whether file writing support for the specified MIDI file type
is provided by this file writer. |
public boolean isFileTypeSupported(int fileType,
Sequence sequence) {
int types[] = getMidiFileTypes( sequence );
for(int i=0; i< types.length; i++) {
if( fileType == types[i] ) {
return true;
}
}
return false;
}
Indicates whether a MIDI file of the file type specified can be written
from the sequence indicated. |
abstract public int write(Sequence in,
int fileType,
OutputStream out) throws IOException
Writes a stream of bytes representing a MIDI file of the file type
indicated to the output stream provided. |
abstract public int write(Sequence in,
int fileType,
File out) throws IOException
Writes a stream of bytes representing a MIDI file of the file type
indicated to the external file provided. |