From 082339e9c004c4ae07c8e59de474858922bd2d47 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 24 Feb 2022 14:33:03 -0600 Subject: [PATCH] patch_change_widget: only show tabs for the channels that a slot is using --- gtk2_ardour/patch_change_widget.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/patch_change_widget.cc b/gtk2_ardour/patch_change_widget.cc index b804273fcc..b3e4d62005 100644 --- a/gtk2_ardour/patch_change_widget.cc +++ b/gtk2_ardour/patch_change_widget.cc @@ -850,10 +850,25 @@ PatchChangeTriggerWindow::reset (boost::shared_ptr r, boost::shared_ptrDropReferences.connect (_route_connection, invalidator(*this), boost::bind (&PatchChangeTriggerWindow::clear, this), gui_context()); + /* only show tabs for the chans that this region uses */ + Evoral::SMF::UsedChannels used = t->used_channels(); + uint32_t first_used_chan = 15; + for (uint32_t chn = 0; chn < 16; ++chn) { + if (used.test(chn)) { + if (chn < first_used_chan) { + first_used_chan = chn; + } + _w[chn]->show(); + } else { + _w[chn]->hide(); + } + } + for (uint32_t chn = 0; chn < 16; ++chn) { _w[chn]->reset (r, t); } - _notebook.set_current_page (0); + + _notebook.set_current_page (first_used_chan); } void