Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
midi_ci::Parser Class Reference

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::Parsedparse (MUID ourMUID, Span< const std::byte > message, Status *=nullptr)
 Parses the provided message;.
 
static std::optional< Message::Parsedparse (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.
 

Detailed Description

Parses CI messages.

Member Enumeration Documentation

◆ Status

enum class midi_ci::Parser::Status
strong
Enumerator
noError 

Parsing was successful.

mismatchedMUID 

The message destination MUID doesn't match the provided MUID.

collidingMUID 

The message source MUID matches the provided MUID.

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.

Constructor & Destructor Documentation

◆ Parser()

midi_ci::Parser::Parser ( )
delete

Member Function Documentation

◆ parse() [1/2]

static std::optional< Message::Parsed > midi_ci::Parser::parse ( MUID ourMUID,
Span< const std::byte > message,
Status * = nullptr )
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.

◆ parse() [2/2]

static std::optional< Message::Parsed > midi_ci::Parser::parse ( Span< const std::byte > message,
Status * = nullptr )
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.

◆ getMessageDescription()

static String midi_ci::Parser::getMessageDescription ( const Message::Parsed & message)
static

Returns a human-readable string describing the message.


The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram