Show RTA button at the bottom of each mixer strip

This commit is contained in:
Robin Gareus
2025-10-10 19:12:30 +02:00
parent 6836c93f21
commit 72a4ff130a
3 changed files with 26 additions and 8 deletions

View File

@@ -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<Route> 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<Route> 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<Route> 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<Route> 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);

View File

@@ -111,8 +111,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, std::shared_ptr<VCA> 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<Pango::Layout> 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<VCA> 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 ();

View File

@@ -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 ();