|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Feed every byte a MIDI source has waiting into a parser. More...
Feed every byte a MIDI source has waiting into a parser.
The source is any type with static byte access in one of two shapes, detected at compile time:
available() -> bool and read_byte() -> uint8_t: a UART driver.read(uint8_t* buf, uint32_t max) -> uint32_t, returning 0 when empty: sbl::usb::MidiPort, or any port that hands over bytes in blocks.Usage:
The transport is the caller's: this header includes no hardware or USB code. Non-blocking: it returns once the source is empty.
Definition in file drain.hpp.
#include <cstdint>#include <type_traits>#include <utility>#include <sbl/protocol/midi/parser.hpp>Go to the source code of this file.
Namespaces | |
| namespace | sbl |
| Root namespace for all Sound Byte Libs code. | |
| namespace | sbl::midi |
| MIDI parser, encoder, SMF and sequencer. | |
Functions | |
| template<typename Source , typename Thru > | |
| uint32_t | sbl::midi::drain (Parser &parser, Thru &&thru) |
Push everything Source has waiting into parser, copying it to a thru. | |
| template<typename Source > | |
| uint32_t | sbl::midi::drain (Parser &parser) |
Push everything Source has waiting into parser | |
Variables | |
| constexpr uint32_t | sbl::midi::DRAIN_CHUNK = 64 |