Loading...
Searching...
No Matches
juce::midi_ci::PropertyHost Class Referencefinal

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

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

- juce_midi_ci/ci/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

## Constructors and Destructors

## PropertyHost()

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

inline

## Member Functions

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

override virtual

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.

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