drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
|
Auxiliary class to translate between raw MIDI streams and ALSA events. More...
#include <alsaevent.h>
Public Member Functions | |
MidiCodec (int bufsize, QObject *parent=nullptr) | |
MidiCodec constructor. More... | |
~MidiCodec () | |
Destructor. | |
void | init () |
CODEC initialization. | |
long | decode (unsigned char *buf, long count, const snd_seq_event_t *ev) |
Decode from event to bytes. More... | |
long | encode (const unsigned char *buf, long count, snd_seq_event_t *ev) |
Encode from byte stream. More... | |
long | encode (int c, snd_seq_event_t *ev) |
Read one byte and encode to sequencer event if finished. More... | |
void | enableRunningStatus (bool enable) |
Enable MIDI running status (command merge) More... | |
void | resetEncoder () |
Reset MIDI encode parser. | |
void | resetDecoder () |
Reset MIDI decode parser. | |
void | resizeBuffer (int bufsize) |
Resize the CODEC buffer. More... | |
Auxiliary class to translate between raw MIDI streams and ALSA events.
Definition at line 787 of file alsaevent.h.
MidiCodec constructor.
bufsize | The buffer size of the CODEC |
parent | The optional parent object |
Definition at line 1163 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_ERROR.
long decode | ( | unsigned char * | buf, |
long | count, | ||
const snd_seq_event_t * | ev | ||
) |
Decode from event to bytes.
buf | A buffer to get the results |
count | Available bytes in MIDI byte stream |
ev | The input event |
Definition at line 1193 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_WARNING.
void enableRunningStatus | ( | bool | enable | ) |
Enable MIDI running status (command merge)
enable | True to enable, false to disable. |
Definition at line 1233 of file alsaevent.cpp.
long encode | ( | const unsigned char * | buf, |
long | count, | ||
snd_seq_event_t * | ev | ||
) |
Encode from byte stream.
buf | MIDI byte stream |
count | Bytes of MIDI byte stream to encode |
ev | Result - sequencer event |
Definition at line 1208 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_WARNING.
long encode | ( | int | c, |
snd_seq_event_t * | ev | ||
) |
Read one byte and encode to sequencer event if finished.
c | A byte of MIDI stream |
ev | Result - sequencer event |
Definition at line 1222 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_WARNING.
void resizeBuffer | ( | int | bufsize | ) |
Resize the CODEC buffer.
bufsize | New buffer size. |
Definition at line 1261 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_WARNING.