@@ -61,6 +61,19 @@ Block::Block (const juce::String& serial, const juce::String& version, const juc | |||||
Block::~Block() {} | Block::~Block() {} | ||||
bool Block::isControlBlock() const | |||||
{ | |||||
return isControlBlock (getType()); | |||||
} | |||||
constexpr bool Block::isControlBlock (Block::Type type) | |||||
{ | |||||
return type == Block::Type::liveBlock | |||||
|| type == Block::Type::loopBlock | |||||
|| type == Block::Type::touchBlock | |||||
|| type == Block::Type::developerControlBlock; | |||||
} | |||||
void Block::addDataInputPortListener (DataInputPortListener* listener) { dataInputPortListeners.add (listener); } | void Block::addDataInputPortListener (DataInputPortListener* listener) { dataInputPortListeners.add (listener); } | ||||
void Block::removeDataInputPortListener (DataInputPortListener* listener) { dataInputPortListeners.remove (listener); } | void Block::removeDataInputPortListener (DataInputPortListener* listener) { dataInputPortListeners.remove (listener); } | ||||
@@ -88,6 +88,12 @@ public: | |||||
*/ | */ | ||||
virtual Type getType() const = 0; | virtual Type getType() const = 0; | ||||
/** Returns true if this a control block. **/ | |||||
bool isControlBlock() const; | |||||
/** Returns true if Block::Type is a control block. */ | |||||
constexpr static bool isControlBlock (Block::Type); | |||||
/** Returns a human-readable description of this device type. */ | /** Returns a human-readable description of this device type. */ | ||||
virtual juce::String getDeviceDescription() const = 0; | virtual juce::String getDeviceDescription() const = 0; | ||||
@@ -1643,16 +1643,6 @@ struct PhysicalTopologySource::Internal | |||||
return nullptr; | return nullptr; | ||||
} | } | ||||
bool isControlBlock() const | |||||
{ | |||||
auto type = getType(); | |||||
return type == Block::Type::liveBlock | |||||
|| type == Block::Type::loopBlock | |||||
|| type == Block::Type::touchBlock | |||||
|| type == Block::Type::developerControlBlock; | |||||
} | |||||
//============================================================================== | //============================================================================== | ||||
std::function<void(const String&)> logger; | std::function<void(const String&)> logger; | ||||