From 72a4ff130a0d17241f0fa483ba74fc9f9d7cafa8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 10 Oct 2025 19:12:30 +0200 Subject: [PATCH] Show RTA button at the bottom of each mixer strip --- gtk2_ardour/mixer_strip.cc | 19 ++++++++++++++----- gtk2_ardour/vca_master_strip.cc | 14 +++++++++++--- gtk2_ardour/vca_master_strip.h | 1 + 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index b1022b0117..bc40406b1e 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -122,7 +122,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer) , solo_iso_table (1, 2) , mute_solo_table (1, 2) , master_volume_table (2, 2) - , bottom_button_table (1, 3) + , bottom_button_table (2, 2) , input_button (true) , output_button (false) , monitor_section_button (0) @@ -159,7 +159,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, std::shared_ptr rt, , solo_iso_table (1, 2) , mute_solo_table (1, 2) , master_volume_table (1, 2) - , bottom_button_table (1, 3) + , bottom_button_table (2, 2) , input_button (true) , output_button (false) , monitor_section_button (0) @@ -211,7 +211,7 @@ MixerStrip::init () input_button_box.set_spacing(2); input_button_box.pack_start (input_button, true, true); - bottom_button_table.attach (gpm.meter_point_button, 2, 3, 0, 1); + bottom_button_table.attach (gpm.meter_point_button, 1, 2, 0, 1); hide_button.set_events (hide_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); @@ -278,8 +278,9 @@ MixerStrip::init () bottom_button_table.set_spacings (2); bottom_button_table.set_homogeneous (true); - bottom_button_table.attach (group_button, 1, 2, 0, 1); bottom_button_table.attach (gpm.gain_automation_state_button, 0, 1, 0, 1); + bottom_button_table.attach (group_button, 0, 1, 1, 2); + bottom_button_table.attach (*rta_button, 1, 2, 1, 2); name_button.set_name ("mixer strip button"); name_button.set_text_ellipsize (Pango::ELLIPSIZE_END); @@ -288,8 +289,12 @@ MixerStrip::init () set_tooltip (&group_button, _("Mix group")); group_button.set_name ("mixer strip button"); + set_tooltip (rta_button, _("Realtime Analyzer")); + rta_button->set_name ("mixer strip button"); + Gtk::Requisition mpb_size = gpm.meter_point_button.size_request(); group_button.set_size_request (mpb_size.width, mpb_size.height); + rta_button->set_size_request (mpb_size.width, mpb_size.height); _comment_button.set_name (X_("mixer strip button")); _comment_button.set_text_ellipsize (Pango::ELLIPSIZE_END); @@ -565,6 +570,7 @@ MixerStrip::set_route (std::shared_ptr rt) solo_button->hide (); mute_button->show (); mute_solo_table.attach (*mute_button, 0, 2, 0, 1); + bottom_button_table.attach (*rta_button, 1, 2, 1, 2); if (Config->get_use_master_volume ()) { master_volume_table.show (); } @@ -586,7 +592,8 @@ MixerStrip::set_route (std::shared_ptr rt) mute_button->show (); master_volume_table.hide (); } else { - bottom_button_table.attach (group_button, 1, 2, 0, 1); + bottom_button_table.attach (group_button, 0, 1, 1, 2); + bottom_button_table.attach (*rta_button, 1, 2, 1, 2); mute_solo_table.attach (*mute_button, 0, 1, 0, 1); mute_solo_table.attach (*solo_button, 1, 2, 0, 1); mute_button->show (); @@ -763,6 +770,7 @@ MixerStrip::set_route (std::shared_ptr rt) name_button.show(); _comment_button.show(); group_button.show(); + rta_button->show(); gpm.gain_automation_state_button.show(); parameter_changed ("mixer-element-visibility"); @@ -1943,6 +1951,7 @@ MixerStrip::update_sensitivity () input_button.set_sensitive (en && !send); group_button.set_sensitive (en && !send); + rta_button->set_sensitive (en && !send); gpm.meter_point_button.set_sensitive (en && !send); mute_button->set_sensitive (en && !send); solo_button->set_sensitive (en && !send); diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc index 4a041f0505..241b3f376a 100644 --- a/gtk2_ardour/vca_master_strip.cc +++ b/gtk2_ardour/vca_master_strip.cc @@ -111,8 +111,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, std::shared_ptr v) number_label.set_inactive_color (_vca->presentation_info().color ()); number_label.signal_button_press_event().connect (sigc::mem_fun (*this, &VCAMasterStrip::number_button_press), false); - update_bottom_padding (); - //Glib::RefPtr layout = vertical_button.get_layout (); // layout->set_justify (JUSTIFY_CENTER); /* horizontally centered, with a little space (5%) at the top */ @@ -178,6 +176,8 @@ VCAMasterStrip::VCAMasterStrip (Session* s, std::shared_ptr v) s->config.ParameterChanged.connect (*this, invalidator (*this), std::bind (&VCAMasterStrip::parameter_changed, this, _1), gui_context()); Config->ParameterChanged.connect (*this, invalidator (*this), std::bind (&VCAMasterStrip::parameter_changed, this, _1), gui_context()); UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &VCAMasterStrip::parameter_changed)); + UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &VCAMasterStrip::dpi_reset)); + gain_meter.gain_automation_state_button.signal_size_allocate().connect ([&] (Allocation&) { update_bottom_padding (); }); } VCAMasterStrip::~VCAMasterStrip () @@ -209,6 +209,12 @@ VCAMasterStrip::self_delete () delete_when_idle (this); } +void +VCAMasterStrip::dpi_reset () +{ + update_bottom_padding (); +} + void VCAMasterStrip::parameter_changed (std::string const & p) { @@ -256,7 +262,8 @@ VCAMasterStrip::update_bottom_padding () control_slave_ui.show (); } - int h = 0; + int h = gain_meter.gain_automation_state_button.get_height() + 2; /* group / rta */ + if (viz.find ("Output") != std::string::npos) { Gtk::Window window (WINDOW_TOPLEVEL); window.add (output_button); @@ -269,6 +276,7 @@ VCAMasterStrip::update_bottom_padding () Gtk::Requisition requisition(comment_button.size_request ()); h += requisition.height + 2; } + if (h <= 0) { bottom_padding.set_size_request (-1, 1); bottom_padding.hide (); diff --git a/gtk2_ardour/vca_master_strip.h b/gtk2_ardour/vca_master_strip.h index c24a861031..f09d4118dd 100644 --- a/gtk2_ardour/vca_master_strip.h +++ b/gtk2_ardour/vca_master_strip.h @@ -109,6 +109,7 @@ private: void unassign_all_selected (); void parameter_changed (std::string const& p); + void dpi_reset (); void set_button_names (); void update_bottom_padding ();