Parses CI messages. More...
#include <juce_CIParser.h>
Public Types | |
enum class | Status { noError , mismatchedMUID , collidingMUID , unrecognisedMessage , reservedVersion , malformed } |
Public Member Functions | |
Parser ()=delete | |
Static Public Member Functions | |
static std::optional< Message::Parsed > | parse (MUID ourMUID, Span< const std::byte > message, Status *=nullptr) |
Parses the provided message;. | |
static std::optional< Message::Parsed > | parse (Span< const std::byte > message, Status *=nullptr) |
Parses the provided message;. | |
static String | getMessageDescription (const Message::Parsed &message) |
Returns a human-readable string describing the message. | |
Parses CI messages.
|
strong |
Enumerator | |
---|---|
noError | Parsing was successful. |
mismatchedMUID | The message destination MUID doesn't match the provided MUID. |
collidingMUID | |
unrecognisedMessage | The message ID doesn't correspond to a known message. |
reservedVersion | The MIDI CI version uses an unrecognised major version. |
malformed | The message (whole message, or just body) could not be parsed. |
|
delete |
|
static |
Parses the provided message;.
Call this with a full CI message. Don't include any "extra" bytes such as the leading/trailing 0xf0/0xf7 for messages that were originally in bytestream midi format, or the packet-header bytes from UMP-formatted sysex messages.
Returns nullopt if the message doesn't need to be acknowledged by the entity with the provided MUID, or if the message is malformed. Otherwise, returns a parsed header, and optionally a body. If the body is std::monostate, then something went wrong while parsing. For example, the body may be malformed, or the CI version might be unrecognised.
|
static |
Parses the provided message;.
Call this with a full CI message. Don't include any "extra" bytes such as the leading/trailing 0xf0/0xf7 for messages that were originally in bytestream midi format, or the packet-header bytes from UMP-formatted sysex messages.
Returns nullopt if the message is malformed. Otherwise, returns a parsed header, and optionally a body. If the body is std::monostate, then something went wrong while parsing. For example, the body may be malformed, or the CI version might be unrecognised.
|
static |
Returns a human-readable string describing the message.