Loading...
Searching...
No Matches
juce::midi_ci::Encodings Struct Reference

## Detailed Description

Utility functions for working with data formats used by property exchange messages.

The documentation for this struct was generated from the following file:

- juce_midi_ci/ci/juce_CIEncodings.h

## Public Member Functions

| Encodings ()=delete

## Static Public Member Functions

static String | stringFrom7BitText (Span< const std::byte > bytes)
| Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits.
static std::vector< std::byte > | stringTo7BitText (const String &text)
| Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits.
static var | jsonFrom7BitText (Span< const std::byte > bytes)
| Converts a list of bytes representing a 7-bit ASCII string to JSON.
static std::vector< std::byte > | jsonTo7BitText (const var &v)
| Converts a JSON object to a list of bytes in 7-bit ASCII format.
static std::vector< std::byte > | toMcoded7 (Span< const std::byte > bytes)
| Each group of seven stored bytes is transmitted as eight bytes.
static std::vector< std::byte > | fromMcoded7 (Span< const std::byte > bytes)
| Each group of seven stored bytes is transmitted as eight bytes.
static std::optional< std::vector< std::byte > > | tryEncode (Span< const std::byte > bytes, Encoding mutualEncoding)
| Attempts to encode the provided byte span using the specified encoding.
static std::vector< std::byte > | decode (Span< const std::byte > bytes, Encoding mutualEncoding)
| Decodes the provided byte span using the specified encoding.

## Constructors and Destructors

## Encodings()

juce::midi_ci::Encodings::Encodings | ( |  | ) |

delete

## Member Functions

## stringFrom7BitText()

String juce::midi_ci::Encodings::stringFrom7BitText | ( | Span< const std::byte > | bytes | ) |

static

Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits.

The encoding rules are in section 5.10.4 of the CI spec.

Referenced by juce::midi_ci::Message::ACK::getMessageTextAsString(), juce::midi_ci::Message::NAK::getMessageTextAsString(), and jsonFrom7BitText().

## stringTo7BitText()

std::vector< std::byte > juce::midi_ci::Encodings::stringTo7BitText | ( | const String & | text | ) |

static

Text in ACK and NAK messages can't be utf-8 or ASCII because each byte only has 7 usable bits.

The encoding rules are in section 5.10.4 of the CI spec.

Referenced by jsonTo7BitText().

## jsonFrom7BitText()

var juce::midi_ci::Encodings::jsonFrom7BitText | ( | Span< const std::byte > | bytes | ) |

inline static

Converts a list of bytes representing a 7-bit ASCII string to JSON.

References juce::JSON::parse(), and stringFrom7BitText().

## jsonTo7BitText()

std::vector< std::byte > juce::midi_ci::Encodings::jsonTo7BitText | ( | const var & | v | ) |

inline static

Converts a JSON object to a list of bytes in 7-bit ASCII format.

References juce::JSON::none, stringTo7BitText(), juce::JSON::toString(), and juce::JSON::FormatOptions::withSpacing().

## toMcoded7()

std::vector< std::byte > juce::midi_ci::Encodings::toMcoded7 | ( | Span< const std::byte > | bytes | ) |

static

Each group of seven stored bytes is transmitted as eight bytes.

First, the sign bits of the seven bytes are sent, followed by the low-order 7 bits of each byte.

## fromMcoded7()

std::vector< std::byte > juce::midi_ci::Encodings::fromMcoded7 | ( | Span< const std::byte > | bytes | ) |

static

Each group of seven stored bytes is transmitted as eight bytes.

First, the sign bits of the seven bytes are sent, followed by the low-order 7 bits of each byte.

## tryEncode()

std::optional< std::vector< std::byte > > juce::midi_ci::Encodings::tryEncode | ( | Span< const std::byte > | bytes,
|  | Encoding | mutualEncoding )

static

Attempts to encode the provided byte span using the specified encoding.

The ASCII encoding does not make any changes to the input stream, but encoding will fail if any byte has its most significant bit set.

## decode()

std::vector< std::byte > juce::midi_ci::Encodings::decode | ( | Span< const std::byte > | bytes,
|  | Encoding | mutualEncoding )

static

Decodes the provided byte span using the specified encoding.

All bytes of the input must be 7-bit values, i.e. all most-significant bits are unset.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited