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.
This commit is contained in:
IanCaio
2020-07-07 04:59:34 -03:00
committed by GitHub
parent fd04efd394
commit 5aba3d2a73

View File

@@ -455,6 +455,15 @@ void FxMixerView::deleteUnusedChannels()
break;
}
}
else if( t->type() == Track::SampleTrack )
{
SampleTrack *strack = dynamic_cast<SampleTrack *>( t );
if( i == strack->effectChannelModel()->value(0) )
{
empty=false;
break;
}
}
}
FxChannel * ch = Engine::fxMixer()->effectChannel( i );
// delete channel if no references found