From 5aba3d2a73f91d5c6268b258f2c6f167df1a8e62 Mon Sep 17 00:00:00 2001 From: IanCaio Date: Tue, 7 Jul 2020 04:59:34 -0300 Subject: [PATCH] Fix a bug on the "Remove unused channels" command (#5559) On the FX mixer, the "Remove unused channels" action only checked for InstrumentTracks on every channel but ignored SampleTracks that could be linked to the particular FX channel. Because of that, if there was a channel where only SampleTracks are forwarded to and we clicked on "Remove unused channels", it was going to be removed. This commit fixes it. --- src/gui/FxMixerView.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 54bbff70f..782aafcd6 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -455,6 +455,15 @@ void FxMixerView::deleteUnusedChannels() break; } } + else if( t->type() == Track::SampleTrack ) + { + SampleTrack *strack = dynamic_cast( t ); + if( i == strack->effectChannelModel()->value(0) ) + { + empty=false; + break; + } + } } FxChannel * ch = Engine::fxMixer()->effectChannel( i ); // delete channel if no references found