Bela
|
Public Member Functions |
Static Public Member Functions |
Static Public Attributes |
List of all members
Midi Class Reference
Public Member Functions | |
void | enableParser (bool enable) |
MidiParser * | getParser () |
void | setParserCallback (void(*callback)(MidiChannelMessage, void *), void *arg=NULL) |
int | readFrom (int port) |
int | writeTo (int port) |
int | getInput () |
int | writeOutput (midi_byte_t byte) |
int | writeOutput (midi_byte_t *bytes, unsigned int length) |
MidiParser * | getMidiParser () |
Static Public Member Functions | |
static void | midiInputLoop () |
static void | midiOutputLoop () |
static void | staticConstructor () |
Static Public Attributes | |
static bool | staticConstructed |
Detailed Description
- Examples:
- FFT-phase-vocoder/render.cpp.
Member Function Documentation
void Midi::enableParser | ( | bool | enable | ) |
Enable the input MidiParser.
If the parser is enabled, getInput() will return an error code. Midi messages should instead be retrieved via, e.g.: getMidiParser()->getNextChannelMessage();
- Parameters
-
enable true to enable the input MidiParser, false to disable it.
MidiParser* Midi::getParser | ( | ) |
Get access to the input parser in use, if any.
- Returns
- a pointer to the instance of MidiParser, if currently enabled, zero otherwise.
|
inline |
Sets the callback to call when a new MidiChannelMessage is available from the input port.
Internally, it calls enableParser() and the MidiParser::setCallback();
- Parameters
-
newCallback the callback function. arg the second argument to be passed to the callback function.
- Examples:
- FFT-phase-vocoder/render.cpp.
int Midi::readFrom | ( | int | port | ) |
Open the specified input Midi port and start reading from it.
- Parameters
-
port Midi port to open
- Returns
- 1 on success, -1 on failure
- Examples:
- FFT-phase-vocoder/render.cpp.
int Midi::writeTo | ( | int | port | ) |
int Midi::getInput | ( | ) |
Get received midi bytes, one at a time.
- Returns
- -1 if no new byte is available, -2 on error, the oldest not yet retrieved midi byte otherwise
int Midi::writeOutput | ( | midi_byte_t | byte | ) |
int Midi::writeOutput | ( | midi_byte_t * | bytes, |
unsigned int | length | ||
) |
Writes Midi bytes to the output port
- Parameters
-
bytes an array of bytes to be written length number of bytes to write
- Returns
- 1 on success, -1 on error
MidiParser* Midi::getMidiParser | ( | ) |
Gives access to the midi parser, if it has been activated.
- Returns
- a pointer to the midi parser if active, zero otherwise
The documentation for this class was generated from the following file:
Generated on Mon Nov 25 2024 06:28:24 for Bela by 1.8.11