Skip to content

Commit c0ea64e

Browse files
committed
Add warning when record button pressed without record node in signal chain
1 parent 1535ad3 commit c0ea64e

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

Source/Processors/ProcessorGraph/ProcessorGraph.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,22 @@ void ProcessorGraph::restoreParameters()
194194

195195
}
196196

197+
bool ProcessorGraph::hasRecordNode()
198+
{
199+
200+
Array<GenericProcessor*> processors = getListOfProcessors();
201+
202+
for (auto p : processors)
203+
{
204+
if (p->isRecordNode())
205+
{
206+
return true;
207+
}
208+
}
209+
return false;
210+
211+
}
212+
197213
Array<GenericProcessor*> ProcessorGraph::getListOfProcessors()
198214
{
199215

@@ -633,7 +649,7 @@ bool ProcessorGraph::enableProcessors()
633649

634650
bool allClear;
635651

636-
if (getNumNodes() < 5)
652+
if (getNumNodes() < 4)
637653
{
638654
std::cout << "Not enough processors in signal chain to acquire data" << std::endl;
639655
AccessClass::getUIComponent()->disableCallbacks();

Source/Processors/ProcessorGraph/ProcessorGraph.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class ProcessorGraph : public AudioProcessorGraph
6969
Array<RecordNode*> getRecordNodes();
7070
AudioNode* getAudioNode();
7171
MessageCenter* getMessageCenter();
72+
73+
bool hasRecordNode();
7274

7375
void updateConnections(Array<SignalChainTabButton*, CriticalSection>);
7476

Source/UI/ControlPanel.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,14 @@ void ControlPanel::buttonClicked(Button* button)
911911
{
912912
if (recordButton->getToggleState())
913913
{
914+
915+
if (!graph->hasRecordNode())
916+
{
917+
CoreServices::sendStatusMessage("Please insert at least one Record Node to start recording!");
918+
recordButton->setToggleState(false, dontSendNotification);
919+
return;
920+
}
921+
914922
if (playButton->getToggleState())
915923
{
916924
startRecording();

0 commit comments

Comments
 (0)