MidiInput class public functions

MidiInput
~MidiInput
extract
getBufferSize
getCount
insert
isOrphan
makeOrphanBuffer
removeOrphanBuffer
setBufferSize
An index of inherited functions can be found at the bottom of this page.
MidiInput(void);
Sets the receiving port to 0, but does not open the port to receive MIDI input. Use the member function open to open the MIDI port, or first use the member function setPort to choose an input port for the object.

MidiInput(int aPort, int autoOpen = 1);
Sets the port on which MIDI I/O will occur for this object. If openAutoQ == 1, then the specified port will automatically be opened. If openQ == 0, then the user must call the open function to open the port before actually using MIDI I/O (unless some other MidiInput object has already opened the port).

~MidiInput();
If there are no more instances of MidiInput left, then close all open MIDI ports.

int getBufferSize(void);
Returns the size of the circular buffer used to store incoming MIDI messages. Behaves similar to the MidiInPort version of this function, but will return the size of the orphanBuffer if the object is disconnected from the true MIDI input.

int getCount(void);
Returns the total number of complete MIDI messages which have been received and not yet extracted. You should check this function before extracting messages for a MidiInput object, because a fatal error results if you try to extract from a MidiInput object which has a getCount() value of 0.

MidiMessage extract(void);
Extract the oldest MIDI message which is still located in the circular buffer that stores incoming MIDI message for the object.

void insert(const MidiMessage& aMessage);
No description available.

int isOrphan(void) const;
Returns true if there is an orphan buffer being used. False if a hardware MIDI input port buffer is being used.

void makeOrphanBuffer(int aSize = 1024);
This function will disconnect the object from the associated hardware MIDI input port and create a new private circular buffer for MIDI message when can then be inserted to simulate input from a real hardware MIDI input port. Also the orphan buffer can be used to copy MIDI input data from another MidiInput/MidiInPort object when is actually connected to a hardware MIDI input port. The size of the input buffer can be specified with the aSize argument when the buffer is created, or it can be set later with the setBuffersize function

void removeOrphanBuffer(void);
Removes the orphan buffer and sets the input buffer back to the hardware MIDI input buffer that the object is associated which can be determined with the getPort function.

void setBufferSize(int aSize);
No description available.


Functions inherited from MidiInPort:
MidiInPort
~MidiInPort
clearSysex
close
closeAll
extract
getBufferSize
getChannelOffset
getCount
getName
getNumPorts
getPort
getSysex
getSysexSize
getTrace
insert
installSysex
open
operator[]
pause
setAndOpenPort
setBufferSize
setChannelOffset
setPort
setTrace
toggleTrace
unpause