org.tritonus.midi.file
Class StandardMidiFileWriter

java.lang.Object
  extended byjavax.sound.midi.spi.MidiFileWriter
      extended byorg.tritonus.midi.file.StandardMidiFileWriter

public class StandardMidiFileWriter
extends MidiFileWriter

Writer for Standard Midi Files. This writer can write type 0 and type 1 files. It cannot write type 2 files.


Field Summary
static boolean CANCEL_RUNNING_STATUS_ON_META_AND_SYSEX
          TODO:
static boolean USE_RUNNING_STATUS
          TODO:
 
Constructor Summary
StandardMidiFileWriter()
           
 
Method Summary
 int[] getMidiFileTypes()
          Return supported MIDI file types.
 int[] getMidiFileTypes(Sequence sequence)
          Return the supported MIDI file types for a given Sequence.
 int write(Sequence sequence, int nFileType, File file)
          Write a Sequence as Standard MIDI File (SMF) to a File.
 int write(Sequence sequence, int nFileType, OutputStream outputStream)
          Write a Sequence as Standard MIDI File (SMF) to an OutputStream.
 
Methods inherited from class javax.sound.midi.spi.MidiFileWriter
isFileTypeSupported, isFileTypeSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_RUNNING_STATUS

public static boolean USE_RUNNING_STATUS
TODO:


CANCEL_RUNNING_STATUS_ON_META_AND_SYSEX

public static boolean CANCEL_RUNNING_STATUS_ON_META_AND_SYSEX
TODO:

Constructor Detail

StandardMidiFileWriter

public StandardMidiFileWriter()
Method Detail

getMidiFileTypes

public int[] getMidiFileTypes()
Return supported MIDI file types. This writer supports Standard MIDI File (SMF) types 0 and 1. So these numbers are returned here.

Specified by:
getMidiFileTypes in class MidiFileWriter
Returns:
an array of supported SMF types.

getMidiFileTypes

public int[] getMidiFileTypes(Sequence sequence)
Return the supported MIDI file types for a given Sequence. This writer supports Standard MIDI File (SMF) types 0 and 1. Depending on the Sequence, either 0 or 1 is returned.

Specified by:
getMidiFileTypes in class MidiFileWriter
Returns:
and array of supported SMF types. It contains 0 if the Sequence has one track, 1 otherwise.

write

public int write(Sequence sequence,
                 int nFileType,
                 OutputStream outputStream)
          throws IOException
Write a Sequence as Standard MIDI File (SMF) to an OutputStream. A byte stream representing the passed Sequence is written to the output stream in the given file type.

Specified by:
write in class MidiFileWriter
Returns:
The number of bytes written to the output stream.
Throws:
IOException

write

public int write(Sequence sequence,
                 int nFileType,
                 File file)
          throws IOException
Write a Sequence as Standard MIDI File (SMF) to a File. A byte stream representing the passed Sequence is written to the file in the given file type.

Specified by:
write in class MidiFileWriter
Returns:
The number of bytes written to the file.
Throws:
IOException