From c8546633a27bb0208268d244d4a8d43cd3c1b9b2 Mon Sep 17 00:00:00 2001 From: superpaik <68785450+superpaik@users.noreply.github.com> Date: Sat, 24 Jun 2023 04:57:52 +0200 Subject: [PATCH] Adding new FX channel while in solo (#6717) * Adding FX channel while in solo New FX channel is muted when there is a soloed FX line. Fixes #6311 * Move var initialization to constructor --- src/core/Mixer.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 9354687a8..b2a9f9e3f 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -190,11 +190,11 @@ void MixerChannel::doProcessing() Mixer::Mixer() : Model( nullptr ), JournallingObject(), - m_mixerChannels() + m_mixerChannels(), + m_lastSoloed(-1) { // create master channel createChannel(); - m_lastSoloed = -1; } @@ -224,6 +224,13 @@ int Mixer::createChannel() // reset channel state clearChannel( index ); + // if there is a soloed channel, mute the new track + if (m_lastSoloed != -1 && m_mixerChannels[m_lastSoloed]->m_soloModel.value()) + { + m_mixerChannels[index]->m_muteBeforeSolo = m_mixerChannels[index]->m_muteModel.value(); + m_mixerChannels[index]->m_muteModel.setValue(true); + } + return index; }