JUCE: juce::midi_ci::PropertyHost Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::midi_ci::PropertyHost Class Referencefinal
juce_midi_ci » ci

Acting as a ResponderListener, instances of this class can formulate appropriate replies to property transactions initiated by remote devices. More...

`#include <juce_CIPropertyHost.h>`

Inheritance diagram for juce::midi_ci::PropertyHost:

## Public Member Functions
| PropertyHost (FunctionBlock fb, PropertyDelegate &d, BufferOutput &o, CacheProvider &p)
std::optional< RequestKey > | sendSubscriptionUpdate (MUID device, const PropertySubscriptionHeader &header, Span< const std::byte > body, std::function< void(const PropertyExchangeResult &)> callback)
| Sends a "Subscription" message from a device, when acting as a subscription responder.
void | terminateSubscription (MUID device, const String &subscribeId)
| Terminates a subscription that was started by a remote device.
std::set< Subscription > | findSubscriptionsForDevice (MUID device) const
| Returns a set of subscribed resources.
int | countOngoingTransactions () const
| Returns the number of transactions that have been initiated by other devices, but not yet completed, normally because the request has been split into several messages.
bool | tryRespond (ResponderOutput &, const Message::Parsed &) override
| If the message is processed successfully, and a response sent, then this returns true.
Public Member Functions inherited from juce::midi_ci::ResponderDelegate
| ResponderDelegate ()=default
virtual | ~ResponderDelegate ()=default

## Detailed Description

Acting as a ResponderListener, instances of this class can formulate appropriate replies to property transactions initiated by remote devices.

PropertyHost instances also contain methods to inform remote devices about changes to local property state.

Keeps track of property subscriptions requested by remote devices.

## Constructor & Destructor Documentation

## ◆ PropertyHost()

juce::midi_ci::PropertyHost::PropertyHost | ( | FunctionBlock | fb,
|  | PropertyDelegate & | d,
|  | BufferOutput & | o,
|  | CacheProvider & | p )

## Member Function Documentation

## ◆ sendSubscriptionUpdate()

std::optional< RequestKey > juce::midi_ci::PropertyHost::sendSubscriptionUpdate | ( | MUID | device,
|  | const PropertySubscriptionHeader & | header,
|  | Span< const std::byte > | body,
|  | std::function< void(const PropertyExchangeResult &)> | callback )

Sends a "Subscription" message from a device, when acting as a subscription responder.

You should call this for all registered subscribers whenever the subscribed property is modified in a way that remote devices don't know about (if a remote device requests a property update, there's no need to send a subscription update after changing the property accordingly).

You should not attempt to start a new subscription on another device using this function. Valid subscription commands are "full", "partial", and "notify". Check the property exchange specification for the intended use of these commands.

To terminate a subscription that was initiated by a remote device, use terminateSubscription().

The provided callback will be called once the remote device has confirmed receipt of the subscription update. If the state of your application changes such that you no longer need to respond/wait for confirmation, you can pass the request key to Device::abortPropertyRequest().

## ◆ terminateSubscription()

void juce::midi_ci::PropertyHost::terminateSubscription | ( | MUID | device,
|  | const String & | subscribeId )

Terminates a subscription that was started by a remote device.

This may be useful if your application has properties that can be added and removed - you can terminate subscriptions to subscribed properties before removing those properties.

## ◆ findSubscriptionsForDevice()

std::set< Subscription > juce::midi_ci::PropertyHost::findSubscriptionsForDevice | ( | MUID | device | ) | const

Returns a set of subscribed resources.

This set contains all active subscriptionIDs for the given device, along with the resources to which those subscriptionIDs refer.

## ◆ countOngoingTransactions()

int juce::midi_ci::PropertyHost::countOngoingTransactions | ( |  | ) | const

Returns the number of transactions that have been initiated by other devices, but not yet completed, normally because the request has been split into several messages.

## ◆ tryRespond()

bool juce::midi_ci::PropertyHost::tryRespond | ( | ResponderOutput & | output,
|  | const Message::Parsed & | message )
| overridevirtual

If the message is processed successfully, and a response sent, then this returns true.

Otherwise, returns false, allowing other ResponderDelegates to attempt to handle the message if necessary.

Implements juce::midi_ci::ResponderDelegate.

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

- juce_CIPropertyHost.h