JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::midi_ci::ProfileHost Class Referencefinal

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

#include <juce_CIProfileHost.h>

Inheritance diagram for juce::midi_ci::ProfileHost:
Collaboration diagram for juce::midi_ci::ProfileHost:

Public Member Functions

 ProfileHost (FunctionBlock fb, ProfileDelegate &d, BufferOutput &o)
 
void addProfile (ProfileAtAddress, int maxNumChannels=1)
 Adds support for a profile on the specified group/channel with a maximum number of channels that may be activated.
 
const BlockProfileStatesgetProfileStates () const
 Returns the profile states (supported/active) for all groups and channels.
 
SupportedAndActive getState (ProfileAtAddress profileAtAddress) const
 Returns the number of supported and active channels for the given profile on the specified group/channel.
 
void removeProfile (ProfileAtAddress)
 Removes support for a profile on the specified group/channel.
 
void setProfileEnablement (ProfileAtAddress, int numChannels)
 Activates or deactivates a profile on the specified group/channel.
 
bool tryRespond (ResponderOutput &, const Message::Parsed &) override
 

Private Member Functions

void disableProfileImpl (ProfileAtAddress)
 
void enableProfileImpl (ProfileAtAddress, int)
 
template<typename Body >
bool profileEnablementReceived (ResponderOutput &, const Body &)
 

Private Attributes

std::optional< ProfileAtAddresscurrentEnablementMessage
 
ProfileDelegatedelegate
 
FunctionBlock functionBlock
 
bool isResponder = false
 
BufferOutputoutput
 
BlockProfileStates states
 

Detailed Description

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

ProfileHost instances also contains methods to inform remote devices about changes to local profile state.

Stores the current state of profiles on the local device.

@tags{Audio}

Constructor & Destructor Documentation

◆ ProfileHost()

juce::midi_ci::ProfileHost::ProfileHost ( FunctionBlock  fb,
ProfileDelegate d,
BufferOutput o 
)
inline

Rather than constructing one of these objects yourself, you should configure a Device with profile support, and then use Device::getProfileHost() to retrieve a profile host that has been set up to work with that device.

Member Function Documentation

◆ addProfile()

void juce::midi_ci::ProfileHost::addProfile ( ProfileAtAddress  ,
int  maxNumChannels = 1 
)

Adds support for a profile on the specified group/channel with a maximum number of channels that may be activated.

◆ disableProfileImpl()

void juce::midi_ci::ProfileHost::disableProfileImpl ( ProfileAtAddress  )
private

◆ enableProfileImpl()

void juce::midi_ci::ProfileHost::enableProfileImpl ( ProfileAtAddress  ,
int   
)
private

◆ getProfileStates()

const BlockProfileStates & juce::midi_ci::ProfileHost::getProfileStates ( ) const
inline

Returns the profile states (supported/active) for all groups and channels.

References states.

◆ getState()

SupportedAndActive juce::midi_ci::ProfileHost::getState ( ProfileAtAddress  profileAtAddress) const
inline

Returns the number of supported and active channels for the given profile on the specified group/channel.

If the supported channels is 0, then the profile is not supported on the group/channel.

If the active channels is 0, then the profile is inactive on the group/channel.

References juce::midi_ci::ProfileAtAddress::address, juce::midi_ci::BlockProfileStates::getStateForDestination(), juce::midi_ci::ProfileAtAddress::profile, and states.

◆ profileEnablementReceived()

template<typename Body >
bool juce::midi_ci::ProfileHost::profileEnablementReceived ( ResponderOutput ,
const Body &   
)
private

◆ removeProfile()

void juce::midi_ci::ProfileHost::removeProfile ( ProfileAtAddress  )

Removes support for a profile on the specified group/channel.

◆ setProfileEnablement()

void juce::midi_ci::ProfileHost::setProfileEnablement ( ProfileAtAddress  ,
int  numChannels 
)

Activates or deactivates a profile on the specified group/channel.

The profile should previously have been added with addProfile(). A positive value of numChannels will enable the profile, and a non-positive value will disable it. This includes group and function-block profiles; passing any positive value will enable the profile on the entire group or block.

◆ tryRespond()

bool juce::midi_ci::ProfileHost::tryRespond ( ResponderOutput ,
const Message::Parsed  
)
overridevirtual

Member Data Documentation

◆ currentEnablementMessage

std::optional<ProfileAtAddress> juce::midi_ci::ProfileHost::currentEnablementMessage
private

◆ delegate

ProfileDelegate& juce::midi_ci::ProfileHost::delegate
private

◆ functionBlock

FunctionBlock juce::midi_ci::ProfileHost::functionBlock
private

◆ isResponder

bool juce::midi_ci::ProfileHost::isResponder = false
private

◆ output

BufferOutput& juce::midi_ci::ProfileHost::output
private

◆ states

BlockProfileStates juce::midi_ci::ProfileHost::states
private

Referenced by getProfileStates(), and getState().


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