Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::sound::io::MIDIEncoder Class Reference

A class that encodes MIDI file data from a stream of MIDI events. More...

#include <omSoundMIDIEncoder.h>

Inheritance diagram for om::sound::io::MIDIEncoder:
om::sound::base::MIDIOutputStream

Public Member Functions

virtual void flush ()
 Flush the MIDI output stream, sending all internally buffered events to the destination. More...
 
virtual Bool canSeek () const
 Return whether or not seeking is allowed in this input stream. More...
 
virtual Bool canSeek (Int64 relativeEventOffset) const
 Return whether or not this input stream's current position can be moved by the specified signed event offset. More...
 
virtual Int64 seek (Int64 relativeEventOffset)
 Move the current event position in the stream by the specified signed amount of events. More...
 
- Public Member Functions inherited from om::sound::base::MIDIOutputStream
virtual ~MIDIOutputStream ()
 Destroy this MIDI output stream and release any resourcees associated with it. More...
 
Size write (const MIDIBuffer &buffer, Size numEvents)
 Write the specified number of MIDI events from the buffer to the output stream. More...
 

Protected Member Functions

virtual Size writeEvents (const MIDIBuffer &buffer, Size numEvents)
 Write the specified number of MIDI events from the buffer to the output stream. More...
 

Detailed Description

A class that encodes MIDI file data from a stream of MIDI events.

Member Function Documentation

virtual void om::sound::io::MIDIEncoder::flush ( )
virtual

Flush the MIDI output stream, sending all internally buffered events to the destination.

This method causes all currently pending output MIDI data to be sent to it's final destination. This method blocks the current thread until it ensures that this is done and that all internal data buffers are emptied if they have any contents.

Implements om::sound::base::MIDIOutputStream.

virtual Bool om::sound::io::MIDIEncoder::canSeek ( ) const
virtual

Return whether or not seeking is allowed in this input stream.

Implements om::sound::base::MIDIOutputStream.

virtual Bool om::sound::io::MIDIEncoder::canSeek ( Int64  relativeEventOffset) const
virtual

Return whether or not this input stream's current position can be moved by the specified signed event offset.

This event offset is specified as the signed number of MIDI events to move in the stream.

Implements om::sound::base::MIDIOutputStream.

virtual Int64 om::sound::io::MIDIEncoder::seek ( Int64  relativeEventOffset)
virtual

Move the current event position in the stream by the specified signed amount of events.

This method attempts to seek the position in the stream by the specified amount of MIDI events. The method returns the signed amount that the position in the stream was changed by. Thus, if seeking is not allowed, 0 is returned. Otherwise, the stream should seek as far as possible in the specified direction and return the actual change in position.

Implements om::sound::base::MIDIOutputStream.

virtual Size om::sound::io::MIDIEncoder::writeEvents ( const MIDIBuffer buffer,
Size  numEvents 
)
protectedvirtual

Write the specified number of MIDI events from the buffer to the output stream.

This method attempts to write the specified number of MIDI events to the stream from the buffer. It then returns the total number of valid events which were written to the stream. The current write position in the stream is advanced by the number of events that are written.

Implements om::sound::base::MIDIOutputStream.


The documentation for this class was generated from the following file: