Represents a virtual device that allows this program to advertise itself to other MIDI-aware applications on the system. More...
Public Member Functions | |
VirtualEndpoint () | |
Creates an invalid virtual endpoint that doesn't correspond to any virtual device. | |
~VirtualEndpoint () | |
VirtualEndpoint (VirtualEndpoint &&) noexcept | |
VirtualEndpoint & | operator= (VirtualEndpoint &&) noexcept |
VirtualEndpoint (const VirtualEndpoint &)=delete | |
VirtualEndpoint & | operator= (const VirtualEndpoint &)=delete |
EndpointId | getId () const |
Retrieves the unique id of this endpoint. | |
bool | setBlock (uint8_t index, const Block &newBlock) |
Sets new properties for the block at the given zero-based index. | |
bool | setName (const String &) |
Assigns a new name to this endpoint, and sends a notification to connected endpoints. | |
bool | isAlive () const |
Returns true if this object represents an endpoint that is currently alive, or false if the endpoint is not alive. | |
operator bool () const |
Represents a virtual device that allows this program to advertise itself to other MIDI-aware applications on the system.
Creating a VirtualEndpoint will install a new endpoint on the system. This endpoint will be visible when enumerating endpoints using the Endpoints singleton. If you're displaying a list of endpoints in your UI, it's probably a good idea to omit any virtual endpoints created by the current application in order to avoid confusion.
After creating a VirtualEndpoint, it can be opened like any other connection, by calling Session::connectInput() and Session::connectOutput(), passing the EndpointId for the virtual endpoint.
universal_midi_packets::VirtualEndpoint::VirtualEndpoint | ( | ) |
Creates an invalid virtual endpoint that doesn't correspond to any virtual device.
isAlive() will return false for a default-constructed VirtualEndpoint.
Referenced by operator=(), operator=(), VirtualEndpoint(), and VirtualEndpoint().
universal_midi_packets::VirtualEndpoint::~VirtualEndpoint | ( | ) |
|
noexcept |
References VirtualEndpoint().
|
delete |
References VirtualEndpoint().
|
noexcept |
References VirtualEndpoint().
|
delete |
References VirtualEndpoint().
EndpointId universal_midi_packets::VirtualEndpoint::getId | ( | ) | const |
Retrieves the unique id of this endpoint.
Pass this ID to Session::connectInput() and/or Session::connectOutput in order to send and receive messages through the virtual endpoint.
Note that this ID is not guaranteed to be stable - creating the 'same' virtual device across several program invocations may produce a different ID each time.
To fetch the current details of this device, you can pass this ID to Endpoints::getEndpoint().
References getId().
Referenced by getId().
bool universal_midi_packets::VirtualEndpoint::setBlock | ( | uint8_t | index, |
const Block & | newBlock ) |
Sets new properties for the block at the given zero-based index.
The number of function blocks on an endpoint may not change.
Returns true on success, or false otherwise.
This may fail for several reasons, including:
References setBlock().
Referenced by setBlock().
bool universal_midi_packets::VirtualEndpoint::setName | ( | const String & | ) |
bool universal_midi_packets::VirtualEndpoint::isAlive | ( | ) | const |
Returns true if this object represents an endpoint that is currently alive, or false if the endpoint is not alive.
This can happen because the endpoint failed to open, or if the session holding the endpoint was closed.
This function returns false for a default-constructed instance.
References isAlive().
Referenced by isAlive(), and operator bool().
|
explicit |
References isAlive().