Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::sound::base::MIDIOutputStream Class Referenceabstract

A class that represents a stream-writable destination for MIDI data. More...

#include <omSoundMIDIOutputStream.h>

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

Public Member Functions

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...
 
virtual void flush ()=0
 Flush the MIDI output stream, sending all internally buffered events to the destination. More...
 
virtual Bool canSeek () const =0
 Return whether or not seeking is allowed in this input stream. More...
 
virtual Bool canSeek (Int64 relativeEventOffset) const =0
 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)=0
 Move the current event position in the stream by the specified signed amount of events. More...
 

Protected Member Functions

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

Detailed Description

A class that represents a stream-writable destination for MIDI data.

Constructor & Destructor Documentation

virtual om::sound::base::MIDIOutputStream::~MIDIOutputStream ( )
inlinevirtual

Destroy this MIDI output stream and release any resourcees associated with it.

Member Function Documentation

Size om::sound::base::MIDIOutputStream::write ( const MIDIBuffer buffer,
Size  numEvents 
)
inline

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.

virtual void om::sound::base::MIDIOutputStream::flush ( )
pure 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.

Implemented in om::sound::io::MIDIEncoder.

virtual Bool om::sound::base::MIDIOutputStream::canSeek ( ) const
pure virtual

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

Implemented in om::sound::io::MIDIEncoder.

virtual Bool om::sound::base::MIDIOutputStream::canSeek ( Int64  relativeEventOffset) const
pure 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.

Implemented in om::sound::io::MIDIEncoder.

virtual Int64 om::sound::base::MIDIOutputStream::seek ( Int64  relativeEventOffset)
pure 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.

Implemented in om::sound::io::MIDIEncoder.

virtual Size om::sound::base::MIDIOutputStream::writeEvents ( const MIDIBuffer buffer,
Size  numEvents 
)
protectedpure virtual

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.

Implemented in om::sound::io::MIDIEncoder.


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