Loading...
Searching...
No Matches
universal_midi_packets::Endpoint Class Reference

Represents a single MIDI endpoint, which may have up to one input and up to one output. More...

Public Member Functions

 Endpoint ()=default
Endpoint withName (String x) const
Endpoint withProtocol (std::optional< PacketProtocol > x) const
Endpoint withDeviceInfo (DeviceInfo x) const
Endpoint withProductInstanceId (String x) const
Endpoint withUMPVersion (uint8_t major, uint8_t minor) const
Endpoint withStaticBlocks (bool x=true) const
Endpoint withMidi1Support (bool x=true) const
Endpoint withMidi2Support (bool x=true) const
Endpoint withReceiveJRSupport (bool x=true) const
Endpoint withTransmitJRSupport (bool x=true) const
Endpoint withReceiveJREnabled (bool x=true) const
Endpoint withTransmitJREnabled (bool x=true) const
Endpoint withBlocks (Span< const Block > x) const
 The block index is used to uniquely identify the block, so be sure to always declare blocks in a consistent order.
Endpoint withNumBlocks (size_t x) const
 The number of blocks on this endpoint.
String getName () const
 Returns the name of this endpoint.
DeviceInfo getDeviceInfo () const
 Returns properties of the device that owns the endpoint.
String getProductInstanceId () const
 Returns the product instance ID if available, or an empty string otherwise.
std::optional< PacketProtocol > getProtocol () const
 The protocol that the endpoint currently expects to send and receive; endpoints are allowed to switch protocols, so this won't always return the same value.
uint8_t getUMPVersionMajor () const
uint8_t getUMPVersionMinor () const
bool hasStaticBlocks () const
bool hasMidi1Support () const
bool hasMidi2Support () const
bool hasReceiveJRSupport () const
bool hasTransmitJRSupport () const
bool isReceiveJREnabled () const
bool isTransmitJREnabled () const
Span< const BlockgetBlocks () const &
 There can be a maximum of 32 blocks.
Span< BlockgetBlocks () &
 Returns a mutable view over the blocks in this endpoint.
Span< const BlockgetBlocks () const &&=delete
Span< BlockgetBlocks () &&=delete

Detailed Description

Represents a single MIDI endpoint, which may have up to one input and up to one output.

An Endpoint object just holds a snapshot of the physical endpoint's last known state at the point when the Endpoint instance was created. Instead of storing Endpoint instances, it's a better idea to store an EndpointId, and to call Endpoints::getEndpoint() to get an up-to-date snapshot.

To connect to an endpoint, use Session::connectInput() or Session::connectOutput() to create a connection in the context of a particular session.

Constructor & Destructor Documentation

◆ Endpoint()

Member Function Documentation

◆ withName()

Endpoint universal_midi_packets::Endpoint::withName ( String x) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withProtocol()

Endpoint universal_midi_packets::Endpoint::withProtocol ( std::optional< PacketProtocol > x) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withDeviceInfo()

Endpoint universal_midi_packets::Endpoint::withDeviceInfo ( DeviceInfo x) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withProductInstanceId()

Endpoint universal_midi_packets::Endpoint::withProductInstanceId ( String x) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withUMPVersion()

Endpoint universal_midi_packets::Endpoint::withUMPVersion ( uint8_t major,
uint8_t minor ) const
nodiscard

References Endpoint(), and withMember().

◆ withStaticBlocks()

Endpoint universal_midi_packets::Endpoint::withStaticBlocks ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withMidi1Support()

Endpoint universal_midi_packets::Endpoint::withMidi1Support ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withMidi2Support()

Endpoint universal_midi_packets::Endpoint::withMidi2Support ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withReceiveJRSupport()

Endpoint universal_midi_packets::Endpoint::withReceiveJRSupport ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withTransmitJRSupport()

Endpoint universal_midi_packets::Endpoint::withTransmitJRSupport ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withReceiveJREnabled()

Endpoint universal_midi_packets::Endpoint::withReceiveJREnabled ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withTransmitJREnabled()

Endpoint universal_midi_packets::Endpoint::withTransmitJREnabled ( bool x = true) const
nodiscard

References Endpoint(), withMember(), and x.

◆ withBlocks()

Endpoint universal_midi_packets::Endpoint::withBlocks ( Span< const Block > x) const
nodiscard

The block index is used to uniquely identify the block, so be sure to always declare blocks in a consistent order.

References Endpoint(), withNumBlocks(), and x.

◆ withNumBlocks()

Endpoint universal_midi_packets::Endpoint::withNumBlocks ( size_t x) const
nodiscard

The number of blocks on this endpoint.

References Endpoint(), jassert, and x.

Referenced by withBlocks().

◆ getName()

String universal_midi_packets::Endpoint::getName ( ) const

Returns the name of this endpoint.

◆ getDeviceInfo()

DeviceInfo universal_midi_packets::Endpoint::getDeviceInfo ( ) const

Returns properties of the device that owns the endpoint.

◆ getProductInstanceId()

String universal_midi_packets::Endpoint::getProductInstanceId ( ) const

Returns the product instance ID if available, or an empty string otherwise.

The product instance ID should match the device serial number, and should be unique per manufacturer, family, and model.

This ID can be used to distinguish between separate devices that have the same DeviceInfo. It can also be used to determine whether separate endpoints are associated with the same device.

◆ getProtocol()

std::optional< PacketProtocol > universal_midi_packets::Endpoint::getProtocol ( ) const

The protocol that the endpoint currently expects to send and receive; endpoints are allowed to switch protocols, so this won't always return the same value.

May return nullopt if the protocol is unknown, perhaps because negotiation has not taken place.

◆ getUMPVersionMajor()

uint8_t universal_midi_packets::Endpoint::getUMPVersionMajor ( ) const

◆ getUMPVersionMinor()

uint8_t universal_midi_packets::Endpoint::getUMPVersionMinor ( ) const

◆ hasStaticBlocks()

bool universal_midi_packets::Endpoint::hasStaticBlocks ( ) const

◆ hasMidi1Support()

bool universal_midi_packets::Endpoint::hasMidi1Support ( ) const

◆ hasMidi2Support()

bool universal_midi_packets::Endpoint::hasMidi2Support ( ) const

◆ hasReceiveJRSupport()

bool universal_midi_packets::Endpoint::hasReceiveJRSupport ( ) const

◆ hasTransmitJRSupport()

bool universal_midi_packets::Endpoint::hasTransmitJRSupport ( ) const

◆ isReceiveJREnabled()

bool universal_midi_packets::Endpoint::isReceiveJREnabled ( ) const

◆ isTransmitJREnabled()

bool universal_midi_packets::Endpoint::isTransmitJREnabled ( ) const

◆ getBlocks() [1/4]

Span< const Block > universal_midi_packets::Endpoint::getBlocks ( ) const &

There can be a maximum of 32 blocks.

This may return an empty span if the endpoint has neither function blocks nor group terminal blocks.

Referenced by getBlocks().

◆ getBlocks() [2/4]

Span< Block > universal_midi_packets::Endpoint::getBlocks ( ) &

Returns a mutable view over the blocks in this endpoint.

◆ getBlocks() [3/4]

Span< const Block > universal_midi_packets::Endpoint::getBlocks ( ) const &&
delete

◆ getBlocks() [4/4]

Span< Block > universal_midi_packets::Endpoint::getBlocks ( ) &&
delete

References getBlocks().

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram