diff --git a/Source/Processors/Editors/GenericEditor.cpp b/Source/Processors/Editors/GenericEditor.cpp index 5e41dc348916317a6c2ffcef16e07ab13cc060db..1e555b071eea668b88c76d5b984265c8bf3c229a 100755 --- a/Source/Processors/Editors/GenericEditor.cpp +++ b/Source/Processors/Editors/GenericEditor.cpp @@ -470,7 +470,7 @@ void GenericEditor::update() GenericProcessor* p = (GenericProcessor*) getProcessor(); - //std::cout << p->getName() << " updating settings." << std::endl; + // std::cout << p->getName() << " updating settings." << std::endl; int numChannels; @@ -482,6 +482,12 @@ void GenericEditor::update() numChannels = p->getNumInputs(); channelSelector->setNumChannels(numChannels); + + for (int i = 0; i < numChannels; i++) + { + // std::cout << p->channels[i]->getRecordState() << std::endl; + channelSelector->setRecordStatus(i, p->channels[i]->getRecordState()); + } } if (numChannels == 0) diff --git a/Source/Processors/GenericProcessor.cpp b/Source/Processors/GenericProcessor.cpp index a6f03264e393f9b9db4b6d23b07a3e1a20ad971e..29ad5eb9fd59fdc1f19e0157bce440a9975be5fb 100755 --- a/Source/Processors/GenericProcessor.cpp +++ b/Source/Processors/GenericProcessor.cpp @@ -30,6 +30,7 @@ GenericProcessor::GenericProcessor(const String& name_) : AccessClass(), parametersAsXml(nullptr), name(name_), paramsWereLoaded(false), editor(0), sendSampleCount(true) { settings.numInputs = settings.numOutputs = settings.sampleRate = 0; + } GenericProcessor::~GenericProcessor() @@ -268,16 +269,23 @@ void GenericProcessor::setDestNode(GenericProcessor* dn) void GenericProcessor::clearSettings() { + + //std::cout << "Generic processor clearing settings." << std::endl; + settings.originalSource = 0; settings.numInputs = 0; settings.numOutputs = 0; settings.sampleRate = getDefaultSampleRate(); - recordStatus.clear(); + // std::cout << "Record status size = " << recordStatus.size() << std::endl; + + if (recordStatus.size() < channels.size()) + recordStatus.resize(channels.size()); for (int i = 0; i < channels.size(); i++) { - recordStatus.add(channels[i]->getRecordState()); + std::cout << channels[i]->getRecordState() << std::endl; + recordStatus.set(i,channels[i]->getRecordState()); } channels.clear(); @@ -390,6 +398,19 @@ void GenericProcessor::update() } +void GenericProcessor::setAllChannelsToRecord() +{ + + recordStatus.resize(getDefaultNumOutputs()); + + for (int i = 0; i < getDefaultNumOutputs(); i++) + { + recordStatus.set(i,true); + } + + // std::cout << "Setting all channels to record for source." << std::endl; + +} void GenericProcessor::enableEditor() { diff --git a/Source/Processors/GenericProcessor.h b/Source/Processors/GenericProcessor.h index a1cd67a6b5846600f5d10a708eedad7bb715cfc4..176b0708e2d30bde4d173271e470e94624095227 100755 --- a/Source/Processors/GenericProcessor.h +++ b/Source/Processors/GenericProcessor.h @@ -542,6 +542,9 @@ public: /** Custom method for updating settings, called automatically by update().*/ virtual void updateSettings() {} + /** Toggles record ON for all channels */ + void setAllChannelsToRecord(); + /** Each processor has a unique integer ID that can be used to identify it.*/ int nodeId; diff --git a/Source/Processors/ProcessorGraph.cpp b/Source/Processors/ProcessorGraph.cpp index f4eaed34529cb32219190090428ae8e0bc9eaac1..93cd7fc33f6fe3948317d41607fa9975f67f85e8 100644 --- a/Source/Processors/ProcessorGraph.cpp +++ b/Source/Processors/ProcessorGraph.cpp @@ -144,6 +144,12 @@ void* ProcessorGraph::createNewProcessor(String& description, int id)//, addNode(processor,id); // have to add it so it can be deleted by the graph + if (processor->isSource()) + { + // by default, all source nodes record automatically + processor->setAllChannelsToRecord(); + } + return processor->createEditor(); } diff --git a/Source/UI/ControlPanel.cpp b/Source/UI/ControlPanel.cpp index 463a8c588afca05920493394b47ec2abf36de417..de5b76d37e15819a8bbfec885f738fad734dac54 100755 --- a/Source/UI/ControlPanel.cpp +++ b/Source/UI/ControlPanel.cpp @@ -653,12 +653,16 @@ void ControlPanel::labelTextChanged(Label* label) void ControlPanel::startRecording() { - playButton->setToggleState(true,false); - masterClock->startRecording(); // turn on recording - backgroundColour = Colour(255,0,0); - - prependText->setEditable(false); - appendText->setEditable(false); + playButton->setToggleState(true,true); + + if (audio->callbacksAreActive()) + { + masterClock->startRecording(); // turn on recording + backgroundColour = Colour(255,0,0); + prependText->setEditable(false); + appendText->setEditable(false); + } + repaint(); }