Skip to content

Commit 13643da

Browse files
committed
Fix bug with data channel and audio monitor
DataChannel objects are copied when they are prepped for acquisition. Also, the copy constructor for DataChannel did not inherit the recording, enabled, or monitored state from the original when it is copied. Changing the state during acquisition resulted in changing the copy as desired, but not updating the original. Stopping acquisition and resuming would not be up to date with user configuration. Changing state before enabling acquisition would not propagate to the copy, because the copy constructor hardcoded the value. Both of these issues were changed in this commit. Since RecordNodes are handled in the same way, it is likely that this bug exists there too. However that behavior has not been changed yet.
1 parent 547cbce commit 13643da

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

‎Source/Processors/Channel/InfoObjects.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ DataChannel::DataChannel(const DataChannel& ch)
214214
m_type(ch.m_type),
215215
m_bitVolts(ch.m_bitVolts),
216216
m_isEnabled(true),
217-
m_isMonitored(false),
218-
m_isRecording(false)
217+
m_isMonitored(ch.m_isMonitored),
218+
m_isRecording(ch.m_isRecording)
219219
{
220220
}
221221

@@ -683,4 +683,4 @@ void ConfigurationObject::setDefaultNameAndDescription()
683683
{
684684
setName("Configuration Object");
685685
setDescription("Generic configuration object");
686-
}
686+
}

‎Source/Processors/Editors/ChannelSelector.cpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -655,19 +655,19 @@ void ChannelSelector::buttonClicked(Button* button)
655655
bool status = b->getToggleState();
656656

657657
// std::cout << "Requesting audio monitor for channel " << ch->nodeIndex + 1 << std::endl;
658-
659-
if (acquisitionIsActive) // use setParameter to change parameter safely
658+
659+
// change parameter directly on editor
660+
// This is another of those ugly things that will go away once the
661+
// probe audio system is implemented, but is needed to maintain compatibility
662+
// between the older recording system and the newer channel objects.
663+
const_cast<DataChannel*>(ch)->setMonitored(status);
664+
665+
666+
if (acquisitionIsActive) // use setParameter to change audio node's copy of parameter safely, if running
660667
{
661668
AccessClass::getProcessorGraph()->
662669
getAudioNode()->setChannelStatus(ch, status);
663670
}
664-
else// change parameter directly
665-
{
666-
//This is another of those ugly things that will go away once the
667-
//probe audio system is implemented, but is needed to maintain compatibility
668-
//between the older recording system and the newer channel objects.
669-
const_cast<DataChannel*>(ch)->setMonitored(status);
670-
}
671671
}
672672
elseif (b->getType() == RECORD)
673673
{

0 commit comments

Comments
(0)