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

## Detailed Description

An output (from the JUCE project's perspective) that sends messages to an endpoint.

An Output is conceptually similar to a unique_ptr, in that it's a nullable move-only type. You can check the null state of an instance by calling isAlive(). isAlive() will return true for an Output that's currently connected, or false otherwise. In particular, isAlive() will return false for a default-constructed Output. If isAlive() returns false, you should avoid calling other member functions: although this won't result in undefined behaviour, none of the functions will produce useful results in this state.

In the case that the device connected to the Output becomes unavailable (e.g. it is unplugged or the bluetooth connection is dropped), the Output will null itself, and calls to isAlive() will return false. You can register a callback to handle this event by calling addDisconnectionListener().

A particular pitfall to watch out for is calling addDisconnectionListener() and removeDisconnectionListener() on a default-constructed Output or other Output for which isAlive() returns false. This will have no effect. Instead, if you want to attach listeners to an Output, you should use Session::connectOutput() to create an Output, and ensure that isAlive() returns true on that Output before attaching listeners.

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

- juce_audio_devices/midi_io/ump/juce_UMPOutput.h

## Public Member Functions

| Output ()
| Creates a disconnected output.
| ~Output ()
| Output (Output &&) noexcept
Output & | operator= (Output &&) noexcept
| Output (const Output &)=delete
Output & | operator= (const Output &)=delete
EndpointId | getEndpointId () const
| Returns this connection's endpoint.
bool | send (Iterator beginIterator, Iterator endIterator)
| Sends a range of messages to this endpoint.
void | addDisconnectionListener (DisconnectionListener &r)
| Attaches a listener that will be notified when this endpoint is disconnected.
void | removeDisconnectionListener (DisconnectionListener &r)
| Removes a disconnection listener.
bool | isAlive () const
| True if this connection is currently active.
| operator bool () const

## Constructors and Destructors

## Output() [1/3]

juce::universal_midi_packets::Output::Output | ( |  | ) |

Creates a disconnected output.

Sending messages to a default-constructed output won't do anything.

Referenced by operator=(), operator=(), Output(), and Output().

## ~Output()

juce::universal_midi_packets::Output::~Output | ( |  | ) |

## Output() [2/3]

juce::universal_midi_packets::Output::Output | ( | Output && |  | ) |

noexcept

References Output().

## Output() [3/3]

juce::universal_midi_packets::Output::Output | ( | const Output & |  | ) |

delete

References Output().

## Member Functions

## operator=() [1/2]

Output & juce::universal_midi_packets::Output::operator= | ( | Output && |  | ) |

noexcept

References Output().

## operator=() [2/2]

Output & juce::universal_midi_packets::Output::operator= | ( | const Output & |  | ) |

delete

References Output().

## getEndpointId()

EndpointId juce::universal_midi_packets::Output::getEndpointId | ( |  | ) | const

Returns this connection's endpoint.

References getEndpointId().

Referenced by getEndpointId().

## send()

bool juce::universal_midi_packets::Output::send | ( | Iterator | beginIterator,
|  | Iterator | endIterator )

Sends a range of messages to this endpoint.

If isAlive() returns false at the point where this function is called, then this function has no effect.

Returns true on success, false on failure.

You may send messages using any protocol, and they will be converted automatically to the protocol expected by the receiver.

References send().

Referenced by send().

## addDisconnectionListener()

void juce::universal_midi_packets::Output::addDisconnectionListener | ( | DisconnectionListener & | r | ) |

Attaches a listener that will be notified when this endpoint is disconnected.

Calling this function on an instance for which isAlive() returns false has no effect.

References addDisconnectionListener().

Referenced by addDisconnectionListener().

## removeDisconnectionListener()

void juce::universal_midi_packets::Output::removeDisconnectionListener | ( | DisconnectionListener & | r | ) |

Removes a disconnection listener.

References removeDisconnectionListener().

Referenced by removeDisconnectionListener().

## isAlive()

bool juce::universal_midi_packets::Output::isAlive | ( |  | ) | const

True if this connection is currently active.

This function returns false for a default-constructed instance.

References isAlive().

Referenced by isAlive(), and operator bool().

## operator bool()

juce::universal_midi_packets::Output::operator bool | ( |  | ) | const

inline explicit

References isAlive().

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