The BLOCKS SDK
RuleBasedTopologySource Class Reference

Description

This topology source holds and applies a set of rules for transforming one device topology into another one that may involve virtual and/or aggregate devices.

Given an input PhysicalTopologySource and a set of Rule objects, this class will apply the rules and present the resulting topology to clients.

Inheritance diagram for RuleBasedTopologySource:

Public Member Functions

 RuleBasedTopologySource (TopologySource &)
 Creates a RuleBasedTopologySource which wraps another TopologySource passed in here. More...
 
 ~RuleBasedTopologySource () override
 Destructor. More...
 
BlockTopology getCurrentTopology () const override
 Returns the currently active topology. More...
 
void clearRules ()
 Clears the list of active rules. More...
 
void addRule (Rule *)
 Adds a rule to the list that will be applied. More...
 
void setActive (bool shouldBeActive) override
 Sets the TopologySource as active, occupying the midi port and trying to connect to the block devices. More...
 
bool isActive () const override
 Returns true, if the TopologySource is currently trying to connect the block devices. More...
 
bool isLockedFromOutside () const override
 Returns true if the topology is locked externally. More...
 
- Public Member Functions inherited from TopologySource
virtual ~TopologySource ()=default
 Destructor. More...
 
void addListener (Listener *l)
 
void removeListener (Listener *l)
 
virtual void cancelAllActiveTouches () noexcept
 Invoke this to force touches-off on all physical devices. More...
 
Block::Array getBlocks () const
 Gets blocks from the current topology. More...
 
Block::Ptr getBlockWithUID (Block::UID uid) const
 Gets a block with given uid from the current topology. More...
 

Classes

struct  Rule
 A rule that can transform parts of a topology. More...
 

Additional Inherited Members

- Protected Attributes inherited from TopologySource
juce::ListenerList< Listenerlisteners
 

Constructor & Destructor Documentation

◆ RuleBasedTopologySource()

RuleBasedTopologySource::RuleBasedTopologySource ( TopologySource )

Creates a RuleBasedTopologySource which wraps another TopologySource passed in here.

◆ ~RuleBasedTopologySource()

RuleBasedTopologySource::~RuleBasedTopologySource ( )
override

Destructor.

Member Function Documentation

◆ getCurrentTopology()

BlockTopology RuleBasedTopologySource::getCurrentTopology ( ) const
overridevirtual

Returns the currently active topology.

Implements TopologySource.

◆ clearRules()

void RuleBasedTopologySource::clearRules ( )

Clears the list of active rules.

Calling this method will cause an asynchronous topology update if the new rule-set results in a change to the topology.

◆ addRule()

void RuleBasedTopologySource::addRule ( Rule )

Adds a rule to the list that will be applied.

The object passed-in will be owned by this object, so don't keep any references to it. Calling this method will cause an asynchronous topology update if the new rule-set results in a change to the topology.

◆ setActive()

void RuleBasedTopologySource::setActive ( bool  shouldBeActive)
overridevirtual

Sets the TopologySource as active, occupying the midi port and trying to connect to the block devices.

Implements TopologySource.

◆ isActive()

bool RuleBasedTopologySource::isActive ( ) const
overridevirtual

Returns true, if the TopologySource is currently trying to connect the block devices.

Implements TopologySource.

◆ isLockedFromOutside()

bool RuleBasedTopologySource::isLockedFromOutside ( ) const
overridevirtual

Returns true if the topology is locked externally.

Implements TopologySource.


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