|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
A cursor over one track chunk. More...
A cursor over one track chunk.
peek() decodes the next event without consuming it; pop() consumes it. A malformed event ends the track and sets error(). The file's bytes must outlive the cursor.
Definition at line 49 of file smf_reader.hpp.
#include <smf_reader.hpp>
Public Member Functions | |
| SmfTrack ()=default | |
| An empty cursor: peek() returns nullptr. | |
| SmfTrack (const uint8_t *data, uint32_t length) | |
| A cursor at the start of a track chunk's body. | |
| void | rewind () |
| Return to the track's first event and clear error() | |
| const SmfEvent * | peek () |
| The next event, or nullptr when the track has ended. | |
| void | pop () |
| Consume the event peek() returned. | |
| bool | done () const |
| True once the track has ended and its last event was popped. | |
| bool | error () const |
| True if a malformed event ended the track. | |
|
inline |
A cursor at the start of a track chunk's body.
| data | First byte after the MTrk chunk header |
| length | Body length in bytes |
Definition at line 59 of file smf_reader.hpp.
References rewind().
|
inline |
Return to the track's first event and clear error()
Definition at line 62 of file smf_reader.hpp.
Referenced by SmfTrack().
|
inline |
The next event, or nullptr when the track has ended.
Definition at line 72 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::advance().
|
inline |
Consume the event peek() returned.
Definition at line 80 of file smf_reader.hpp.
Referenced by sbl::midi::Sequencer< Outputs >::advance().
|
inline |
True once the track has ended and its last event was popped.
Definition at line 83 of file smf_reader.hpp.
|
inline |
True if a malformed event ended the track.
Definition at line 85 of file smf_reader.hpp.