Base class for sections of MIDI file.
More...
|
| std::vector< std::uint8_t > | m_buffer |
| | Constant-capacity buffer vector to be written to stream.
|
|
| | Section () |
| | Reserve constant space for BufferSize capacity vector.
|
| void | writeBytes (std::span< const std::uint8_t > bytes) |
| | Write bytes to buffer.
|
| void | writeBytes (std::initializer_list< std::uint8_t > bytes) |
| | Write bytes to buffer.
|
| void | writeVarLength (std::uint32_t val) |
| | Write a MIDI-compatible variable length stream.
|
| void | writeBigEndian4 (std::uint32_t val) |
| | Buffer gets four 8-bit values from left to right.
|
| void | writeBigEndian2 (std::uint16_t val) |
| | Buffer gets two 8-bit values from left to right.
|
| virtual void | writeToBuffer () |
| | Write section info to buffer.
|
Base class for sections of MIDI file.
◆ Section()
| lmms::MidiFile::Section::Section |
( |
| ) |
|
|
protected |
Reserve constant space for BufferSize capacity vector.
◆ writeBigEndian2()
| void lmms::MidiFile::Section::writeBigEndian2 |
( |
std::uint16_t | val | ) |
|
|
protected |
Buffer gets two 8-bit values from left to right.
◆ writeBigEndian4()
| void lmms::MidiFile::Section::writeBigEndian4 |
( |
std::uint32_t | val | ) |
|
|
protected |
Buffer gets four 8-bit values from left to right.
◆ writeBytes() [1/2]
| void lmms::MidiFile::Section::writeBytes |
( |
std::initializer_list< std::uint8_t > | bytes | ) |
|
|
protected |
Write bytes to buffer.
- Parameters
-
| bytes | List of bytes to be written TODO C++26: Remove once std::span supports construction from std::initializer_list |
◆ writeBytes() [2/2]
| void lmms::MidiFile::Section::writeBytes |
( |
std::span< const std::uint8_t > | bytes | ) |
|
|
protected |
Write bytes to buffer.
- Parameters
-
| bytes | List of bytes to be written |
◆ writeToBuffer()
| virtual void lmms::MidiFile::Section::writeToBuffer |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ writeVarLength()
| void lmms::MidiFile::Section::writeVarLength |
( |
std::uint32_t | val | ) |
|
|
protected |
Write a MIDI-compatible variable length stream.
- Parameters
-
The MIDI format is a little strange, and makes use of so-called variable length quantities. These quantities are a stream of bytes. If the most significant bit is 1, then more bytes follow. If it is zero, then the byte in question is the last in the stream.
◆ m_buffer
| std::vector<std::uint8_t> lmms::MidiFile::Section::m_buffer |
Constant-capacity buffer vector to be written to stream.
The documentation for this class was generated from the following files: