From fcae7c7bb57a230ee8257072cc6723a608ef0aab Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 12 Jun 2025 22:46:02 +0200 Subject: [PATCH] Transfer slot_prop_box to selection_properties_box --- gtk2_ardour/selection_properties_box.cc | 25 ++++++++++++++++++++++++- gtk2_ardour/selection_properties_box.h | 2 ++ gtk2_ardour/trigger_page.cc | 14 ++++---------- gtk2_ardour/trigger_page.h | 5 ++--- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/gtk2_ardour/selection_properties_box.cc b/gtk2_ardour/selection_properties_box.cc index 3d7d50fb08..e32a121e93 100644 --- a/gtk2_ardour/selection_properties_box.cc +++ b/gtk2_ardour/selection_properties_box.cc @@ -31,8 +31,12 @@ #include "region_fx_properties_box.h" #include "region_view.h" #include "route_properties_box.h" -#include "selection_properties_box.h" +#include "slot_properties_box.h" #include "time_info_box.h" +#include "trigger_strip.h" +#include "triggerbox_ui.h" + +#include "selection_properties_box.h" #include "pbd/i18n.h" @@ -49,9 +53,11 @@ SelectionPropertiesBox::SelectionPropertiesBox () _time_info_box = new TimeInfoBox ("EditorTimeInfo", true); _route_prop_box = new RoutePropertiesBox (); + _slot_prop_box = new SlotPropertiesBox (); pack_start(*_time_info_box, false, false, 0); pack_start(*_route_prop_box, true, true, 0); + pack_start(*_slot_prop_box, true, true, 0); pack_start(_region_editor_box, true, true, 0); _time_info_box->set_no_show_all (); @@ -69,6 +75,7 @@ SelectionPropertiesBox::~SelectionPropertiesBox () delete _route_prop_box; delete _region_editor; delete _region_fx_box; + delete _slot_prop_box; } void @@ -102,6 +109,7 @@ SelectionPropertiesBox::set_session (Session* s) _time_info_box->set_session(s); _route_prop_box->set_session(s); + _slot_prop_box->set_session(s); selection_changed(); } @@ -146,6 +154,21 @@ SelectionPropertiesBox::selection_changed () _time_info_box->hide (); } + bool show_slot_properties = false; + if (!selection.triggers.empty ()) { + TriggerSelection ts = selection.triggers; + TriggerEntry* entry = *ts.begin (); + TriggerReference ref = entry->trigger_reference (); + + _slot_prop_box->set_slot(ref); + show_slot_properties = true; + } + if (show_slot_properties) { + _slot_prop_box->show(); + } else { + _slot_prop_box->hide(); + } + bool show_route_properties = false; if (!selection.tracks.empty ()) { TimeAxisView *tav = selection.tracks.back (); //the LAST selected stripable is the clicked one. see selection.cc line ~92 diff --git a/gtk2_ardour/selection_properties_box.h b/gtk2_ardour/selection_properties_box.h index 4dafcef6df..d804946976 100644 --- a/gtk2_ardour/selection_properties_box.h +++ b/gtk2_ardour/selection_properties_box.h @@ -35,6 +35,7 @@ class TimeInfoBox; class RegionEditor; class RegionFxPropertiesBox; class RoutePropertiesBox; +class SlotPropertiesBox; class SelectionPropertiesBox : public Gtk::HBox, public ARDOUR::SessionHandlePtr { @@ -52,6 +53,7 @@ private: TimeInfoBox* _time_info_box; RoutePropertiesBox* _route_prop_box; + SlotPropertiesBox* _slot_prop_box; Gtk::HBox _region_editor_box; RegionEditor* _region_editor; RegionFxPropertiesBox* _region_fx_box; diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index a92ab48640..9fd6180308 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -152,10 +152,11 @@ TriggerPage::TriggerPage () table.set_border_width (8); int col = 0; - table.attach (_slot_prop_box, col, col + 1, 0, 1, Gtk::FILL, Gtk::SHRINK | Gtk::FILL); + table.attach (_properties_box, col, col + 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL); ++col; table.attach (_audio_trig_box, col, col + 1, 0, 1, Gtk::FILL, Gtk::SHRINK | Gtk::FILL); clip_editor_column = ++col; + ++col; table.set_no_show_all (); @@ -194,6 +195,7 @@ TriggerPage::TriggerPage () _trigger_clip_picker.show (); _no_strips.show (); _sidebar_vbox.show_all (); + _properties_box.show(); /* setup keybidings */ set_widget_bindings (contents(), *bindings, ARDOUR_BINDING_KEY); @@ -365,7 +367,7 @@ TriggerPage::set_session (Session* s) initial_track_display (); - _slot_prop_box.set_session (s); + _properties_box.set_session (s); _audio_trig_box.set_session (s); @@ -473,7 +475,6 @@ TriggerPage::trigger_arm_changed (Trigger const * trigger) /* hide everything */ - _slot_prop_box.hide (); _audio_trig_box.hide (); _midi_trig_box.hide (); _midi_editor->viewport().hide (); @@ -483,9 +484,6 @@ TriggerPage::trigger_arm_changed (Trigger const * trigger) TriggerBox& box = trigger->box(); TriggerReference ref (trigger->boxptr(), trigger->index()); - _slot_prop_box.set_slot (ref); - _slot_prop_box.show (); - if (box.data_type () == DataType::AUDIO) { if (trigger->the_region()) { _audio_trig_box.set_trigger (ref); @@ -513,7 +511,6 @@ TriggerPage::selection_changed () /* hide everything */ - _slot_prop_box.hide (); _audio_trig_box.hide (); _midi_trig_box.hide (); @@ -533,9 +530,6 @@ TriggerPage::selection_changed () TriggerPtr trigger = entry->trigger (); std::shared_ptr box = ref.box(); - _slot_prop_box.set_slot (ref); - _slot_prop_box.show (); - if (box->data_type () == DataType::AUDIO) { if (trigger->the_region()) { diff --git a/gtk2_ardour/trigger_page.h b/gtk2_ardour/trigger_page.h index 96a0b5aa08..2d963983f9 100644 --- a/gtk2_ardour/trigger_page.h +++ b/gtk2_ardour/trigger_page.h @@ -37,7 +37,7 @@ #include "fitted_canvas_widget.h" #include "midi_trigger_properties_box.h" #include "route_processor_selection.h" -#include "slot_properties_box.h" +#include "selection_properties_box.h" #include "trigger_clip_picker.h" #include "trigger_region_list.h" #include "trigger_route_list.h" @@ -134,8 +134,7 @@ private: bool _show_bottom_pane; - SlotPropertiesBox _slot_prop_box; - + SelectionPropertiesBox _properties_box; AudioTriggerPropertiesBox _audio_trig_box; MidiTriggerPropertiesBox _midi_trig_box;