From 2579bb6dd459d377f229031b8fb65fcc00ca0f81 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 29 Jan 2024 21:42:03 +0100 Subject: [PATCH] Vapor: hide surround pan controls when removing channel(s) --- libs/ardour/surround_send.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/ardour/surround_send.cc b/libs/ardour/surround_send.cc index aaa95c2d92..101a54f30e 100644 --- a/libs/ardour/surround_send.cc +++ b/libs/ardour/surround_send.cc @@ -255,6 +255,15 @@ SurroundSend::configure_io (ChanCount in, ChanCount out) add_pannable (); } + if (changed) { + for (uint32_t i = 0; i < n_audio; ++i) { + _pannable[i]->foreach_pan_control ([](std::shared_ptr ac) { ac->clear_flag (PBD::Controllable::HiddenControl); }); + } + for (uint32_t i = n_audio; i < _pannable.size (); ++i) { + _pannable[i]->foreach_pan_control ([](std::shared_ptr ac) { ac->set_flag (PBD::Controllable::HiddenControl); }); + } + } + #ifdef MIXBUS /* Link visibility - currently only for Mixbus which has a custom UI, and at most stereo */ for (uint32_t i = 0; i < _pannable.size (); ++i) { @@ -348,6 +357,10 @@ SurroundSend::cycle_start (pframes_t /*nframes*/) std::string SurroundSend::describe_parameter (Evoral::Parameter param) { + if (param.id() >= n_pannables ()) { + return X_("hidden"); + } + if (n_pannables () < 2) { /* Use default names */ return Automatable::describe_parameter (param);