Skip to content
Snippets Groups Projects
Commit 873bbbf7 authored by jsiegle's avatar jsiegle
Browse files

Set source nodes to record all channels by default. Closes #136

parent bdfaea05
No related branches found
No related tags found
No related merge requests found
...@@ -470,7 +470,7 @@ void GenericEditor::update() ...@@ -470,7 +470,7 @@ void GenericEditor::update()
GenericProcessor* p = (GenericProcessor*) getProcessor(); GenericProcessor* p = (GenericProcessor*) getProcessor();
//std::cout << p->getName() << " updating settings." << std::endl; // std::cout << p->getName() << " updating settings." << std::endl;
int numChannels; int numChannels;
...@@ -482,6 +482,12 @@ void GenericEditor::update() ...@@ -482,6 +482,12 @@ void GenericEditor::update()
numChannels = p->getNumInputs(); numChannels = p->getNumInputs();
channelSelector->setNumChannels(numChannels); 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) if (numChannels == 0)
......
...@@ -30,6 +30,7 @@ GenericProcessor::GenericProcessor(const String& name_) : AccessClass(), ...@@ -30,6 +30,7 @@ GenericProcessor::GenericProcessor(const String& name_) : AccessClass(),
parametersAsXml(nullptr), name(name_), paramsWereLoaded(false), editor(0), sendSampleCount(true) parametersAsXml(nullptr), name(name_), paramsWereLoaded(false), editor(0), sendSampleCount(true)
{ {
settings.numInputs = settings.numOutputs = settings.sampleRate = 0; settings.numInputs = settings.numOutputs = settings.sampleRate = 0;
} }
GenericProcessor::~GenericProcessor() GenericProcessor::~GenericProcessor()
...@@ -268,16 +269,23 @@ void GenericProcessor::setDestNode(GenericProcessor* dn) ...@@ -268,16 +269,23 @@ void GenericProcessor::setDestNode(GenericProcessor* dn)
void GenericProcessor::clearSettings() void GenericProcessor::clearSettings()
{ {
//std::cout << "Generic processor clearing settings." << std::endl;
settings.originalSource = 0; settings.originalSource = 0;
settings.numInputs = 0; settings.numInputs = 0;
settings.numOutputs = 0; settings.numOutputs = 0;
settings.sampleRate = getDefaultSampleRate(); 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++) 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(); channels.clear();
...@@ -390,6 +398,19 @@ void GenericProcessor::update() ...@@ -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() void GenericProcessor::enableEditor()
{ {
......
...@@ -542,6 +542,9 @@ public: ...@@ -542,6 +542,9 @@ public:
/** Custom method for updating settings, called automatically by update().*/ /** Custom method for updating settings, called automatically by update().*/
virtual void updateSettings() {} 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.*/ /** Each processor has a unique integer ID that can be used to identify it.*/
int nodeId; int nodeId;
......
...@@ -144,6 +144,12 @@ void* ProcessorGraph::createNewProcessor(String& description, int id)//, ...@@ -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 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(); return processor->createEditor();
} }
......
...@@ -653,12 +653,16 @@ void ControlPanel::labelTextChanged(Label* label) ...@@ -653,12 +653,16 @@ void ControlPanel::labelTextChanged(Label* label)
void ControlPanel::startRecording() void ControlPanel::startRecording()
{ {
playButton->setToggleState(true,false); playButton->setToggleState(true,true);
masterClock->startRecording(); // turn on recording
backgroundColour = Colour(255,0,0); if (audio->callbacksAreActive())
{
prependText->setEditable(false); masterClock->startRecording(); // turn on recording
appendText->setEditable(false); backgroundColour = Colour(255,0,0);
prependText->setEditable(false);
appendText->setEditable(false);
}
repaint(); repaint();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment