![]() |
drumstick 2.10.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 1165 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 1195 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 1235 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 1210 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 1224 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_WARNING.
| void resizeBuffer | ( | int | bufsize | ) |
Resize the CODEC buffer.
| bufsize | New buffer size. |
Definition at line 1263 of file alsaevent.cpp.
References DRUMSTICK_ALSA_CHECK_WARNING.