Loading...
Searching...
No Matches
juce::universal_midi_packets::Endpoints Class Reference

## Detailed Description

Endpoints known to the system.

Use this to locate hardware and software devices that are capable of sending and receiving MIDI messages.

Call makeSession() to create a session that manages connections to those devices.

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

- juce_audio_devices/midi_io/ump/juce_UMPEndpoints.h

Inheritance diagram for juce::universal_midi_packets::Endpoints:

## Public Member Functions

std::vector< EndpointId > | getEndpoints () const
| Fetch endpoint ids.
void | getEndpoints (std::vector< EndpointId > &) const
| Fetch endpoint ids into the provided buffer.
std::optional< Endpoint > | getEndpoint (const EndpointId &) const
| Fetches information about a particular endpoint, or nullopt if the information is unavailable.
std::optional< StaticDeviceInfo > | getStaticDeviceInfo (const EndpointId &) const
| Fetches static information about a particular endpoint, or nullopt if the endpoint is unavailable, which might happen if the endpoint has been disconnected.
void | addListener (EndpointsListener &)
| Adds a listener that will receive notifications when endpoints are added, removed, or otherwise changed.
void | removeListener (EndpointsListener &)
| Removes a listener that was previously added with addListener().
Session | makeSession (const String &name) const
| Creates a session to manage connections to endpoints.
std::optional< Backend > | getBackend () const
| Returns the technology that is being used to communicate with MIDI devices on this platform.
bool | isVirtualMidiBytestreamServiceActive () const
| Creating a virtual legacy port will only succeed if this function returns true.
bool | isVirtualMidiUmpServiceActive () const
| Creating a virtual UMP endpoint will only succeed if this function returns true.
void | setVirtualMidiBytestreamServiceActive (bool)
| By default, Android MIDI services are initially disabled, but can be enabled by calling this function, passing true.
void | setVirtualMidiUmpServiceActive (bool)
| By default, Android MIDI services are initially disabled, but can be enabled by calling this function, passing true.
| ~Endpoints () override

## Additional Inherited Members

Static Public Member Functions inherited from juce::DeletedAtShutdown
static void | deleteAll ()
| Deletes all extant objects.
Protected Member Functions inherited from juce::DeletedAtShutdown
| DeletedAtShutdown ()
| Creates a DeletedAtShutdown object.
virtual | ~DeletedAtShutdown ()
| Destructor.

## Constructors and Destructors

## ~Endpoints()

juce::universal_midi_packets::Endpoints::~Endpoints | ( |  | ) |

override

## Member Functions

## getEndpoints() [1/2]

std::vector< EndpointId > juce::universal_midi_packets::Endpoints::getEndpoints | ( |  | ) | const

Fetch endpoint ids.

## getEndpoints() [2/2]

void juce::universal_midi_packets::Endpoints::getEndpoints | ( | std::vector< EndpointId > & |  | ) | const

Fetch endpoint ids into the provided buffer.

## getEndpoint()

std::optional< Endpoint > juce::universal_midi_packets::Endpoints::getEndpoint | ( | const EndpointId & |  | ) | const

Fetches information about a particular endpoint, or nullopt if the information is unavailable.

Currently, this function may return nullopt on Android for UMP devices that are connected but not opened.

If you're displaying endpoint names in a user-facing list, it's probably a good idea to use the Endpoint name if getEndpoint() returns a value. Otherwise, you can use the StaticDeviceInformation name if getStaticDeviceInformation() returns a value. If both functions return nullopt, this implies that the device is unknown/disconnected.

## getStaticDeviceInfo()

std::optional< StaticDeviceInfo > juce::universal_midi_packets::Endpoints::getStaticDeviceInfo | ( | const EndpointId & |  | ) | const

Fetches static information about a particular endpoint, or nullopt if the endpoint is unavailable, which might happen if the endpoint has been disconnected.

## addListener()

void juce::universal_midi_packets::Endpoints::addListener | ( | EndpointsListener & |  | ) |

Adds a listener that will receive notifications when endpoints are added, removed, or otherwise changed.

## removeListener()

void juce::universal_midi_packets::Endpoints::removeListener | ( | EndpointsListener & |  | ) |

Removes a listener that was previously added with addListener().

## makeSession()

Session juce::universal_midi_packets::Endpoints::makeSession | ( | const String & | name | ) | const

Creates a session to manage connections to endpoints.

It's possible for this function to fail, in which case Session::isAlive() will return false.

References name.

## getBackend()

std::optional< Backend > juce::universal_midi_packets::Endpoints::getBackend | ( |  | ) | const

Returns the technology that is being used to communicate with MIDI devices on this platform.

This is mainly relevant on Windows, where there are several different MIDI implementations.

The intended use of this getter is to allow programs to detect whether the Windows MIDI Services (WMS) are active and running. If initialisation of WMS failed, the implementation will fall back to an earlier, more limited implementation. Programs may wish to detect this situation so that they can direct users to install the WMS SDK.

If no MIDI technology is available, this returns nullopt.

## isVirtualMidiBytestreamServiceActive()

bool juce::universal_midi_packets::Endpoints::isVirtualMidiBytestreamServiceActive | ( |  | ) | const

Creating a virtual legacy port will only succeed if this function returns true.

On platforms that support virtual MIDI connections (macOS, iOS, ALSA, Windows MIDI Services), this will normally return true. On platforms that don't support virtual MIDI (older Windows MIDI APIs), this will always return false. On Android, this will return false until the virtual MIDI service has started, and will return true while the service is running. You can listen for virtualMidiServiceActiveChanged() to take actions (e.g. creating or destroying virtual ports) when the service status changes.

## isVirtualMidiUmpServiceActive()

bool juce::universal_midi_packets::Endpoints::isVirtualMidiUmpServiceActive | ( |  | ) | const

Creating a virtual UMP endpoint will only succeed if this function returns true.

On recent platforms that support virtual MIDI connections (recent macOS and iOS, recent ALSA, Windows MIDI Services), this will normally return true. On platforms that don't support virtual MIDI (older Windows MIDI APIs), this will always return false. On Android, this will return false until the virtual MIDI service has started, and will return true while the service is running. You can listen for virtualMidiServiceActiveChanged() to take actions (e.g. creating or destroying virtual ports) when the service status changes.

## setVirtualMidiBytestreamServiceActive()

void juce::universal_midi_packets::Endpoints::setVirtualMidiBytestreamServiceActive | ( | bool |  | ) |

By default, Android MIDI services are initially disabled, but can be enabled by calling this function, passing true.

This function is not synchronous, so the service will start or stop at some point after this function has returned. To find out when the service state changes, listen for virtualMidiServiceActiveChanged() and check the result of isVirtualMidiBytestreamServiceActive().

On platforms other than Android, this call does nothing.

## setVirtualMidiUmpServiceActive()

void juce::universal_midi_packets::Endpoints::setVirtualMidiUmpServiceActive | ( | bool |  | ) |

By default, Android MIDI services are initially disabled, but can be enabled by calling this function, passing true.

This function is not synchronous, so the service will start or stop at some point after this function has returned. To find out when the service state changes, listen for virtualMidiServiceActiveChanged() and check the result of isVirtualMidiUmpServiceActive(). On Android versions that don't support virtual UMP (API level < 35), this call does nothing.

On platforms other than Android, this call does nothing.

### 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