@@ -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 else if (b->getType () == RECORD)
673673 {
@@ -680,9 +680,16 @@ void ChannelSelector::buttonClicked(Button* button)
680680
681681 if (acquisitionIsActive) // use setParameter to change parameter safely
682682 {
683- AccessClass::getProcessorGraph ()->
683+ if ( AccessClass::getProcessorGraph ()->
684684 getRecordNode ()->
685- setChannelStatus (ch, status);
685+ setChannelStatus (ch, status) )
686+ {
687+ const_cast <DataChannel*>(ch)->setRecordState (status);
688+ }
689+
690+ // make sure that the button matches the system's actual state, in case
691+ // user's interaction was disallowed
692+ b->setToggleState (const_cast <DataChannel*>(ch)->getRecordState (), dontSendNotification);
686693 }
687694 else // change parameter directly
688695 {
0 commit comments