From 796720b6851175eeaca95ddc51604208422e2dad Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 7 May 2024 15:51:39 -0500 Subject: [PATCH] L: set Actions for marker buttons, incl "Add Section Marker" action --- gtk2_ardour/ardour_ui.cc | 4 ++-- gtk2_ardour/ardour_ui.h | 4 ++-- gtk2_ardour/ardour_ui_dependents.cc | 31 ++++++++++++++++++++++------- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 022f2a18d2..f57dc56f7e 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -321,9 +321,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , editor_meter(0) , _clear_editor_meter( true) , _editor_meter_peaked (false) - , _livetrax_btn_rec_none (_("Rec None")) , _livetrax_btn_peak_reset (_("Reset Peaks")) - , _livetrax_btn_marker_new (_("Marker")) + , _livetrax_btn_new_section (_("+Sec")) + , _livetrax_btn_new_location (_("+Loc")) , _livetrax_btn_prev_marker (_("<< Prev")) , _livetrax_btn_next_marker (_("Next >>")) , _livetrax_centering_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL)) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 90c931f925..670f986f90 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -657,10 +657,10 @@ private: Gtk::HBox livetrax_prefs_bar; Gtk::HBox livetrax_mixer_bar; - ArdourWidgets::ArdourButton _livetrax_btn_rec_none; ArdourWidgets::ArdourButton _livetrax_btn_peak_reset; - ArdourWidgets::ArdourButton _livetrax_btn_marker_new; + ArdourWidgets::ArdourButton _livetrax_btn_new_section; + ArdourWidgets::ArdourButton _livetrax_btn_new_location; ArdourWidgets::ArdourButton _livetrax_btn_prev_marker; ArdourWidgets::ArdourButton _livetrax_btn_next_marker; diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index 4f945a9eef..63f20b6ed9 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -481,8 +481,9 @@ ARDOUR_UI::livetrax_setup_windows () int TCOL = 0; livetrax_top_table_l.attach (_livetrax_btn_prev_marker, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_l.attach (_livetrax_btn_marker_new, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_l.attach (_livetrax_btn_next_marker, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_l.attach (_livetrax_btn_new_section, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_l.attach (_livetrax_btn_new_location, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_l.attach (_livetrax_btn_next_marker, TCOL+3, TCOL+4, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_l.attach (transport_ctrl, TCOL, TCOL+4, 1, 2, FILL, FILL, 4, 4); TCOL+=4; livetrax_top_table_l.attach (sync_button, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); TCOL++; @@ -500,16 +501,13 @@ ARDOUR_UI::livetrax_setup_windows () TCOL = 0; livetrax_top_table_r.attach (*editor->mouse_mode_hbox, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_r.attach (editor->_track_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL+=2; - - livetrax_top_table_r.attach (_livetrax_btn_peak_reset, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_r.attach (editor->_zoom_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; livetrax_top_table_r.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; - livetrax_top_table_r.attach (_livetrax_btn_rec_none, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); TCOL+=2; + livetrax_top_table_r.attach (_livetrax_btn_peak_reset, TCOL, TCOL+1, 0, 2, FILL, FILL, 4, 4); TCOL++; - livetrax_top_table_r.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; + livetrax_top_table_r.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; livetrax_top_table_r.attach (*ev_dsp, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_r.attach (disk_space_label, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; @@ -593,6 +591,25 @@ ARDOUR_UI::livetrax_setup_windows () we_have_dependents (); + _livetrax_btn_prev_marker.set_tooltip_text(_("Jump to Prior Marker")); + _livetrax_btn_prev_marker.set_elements(ArdourButton::Element (ArdourButton::VectorIcon|ArdourButton::Edge|ArdourButton::Body)); + _livetrax_btn_prev_marker.set_icon(ArdourWidgets::ArdourIcon::ScrollLeft); + act = ActionManager::get_action (X_("Common"), X_("jump-backward-to-mark")); + _livetrax_btn_prev_marker.set_related_action (act); + + _livetrax_btn_next_marker.set_tooltip_text(_("Jump to Next Marker")); + _livetrax_btn_next_marker.set_icon(ArdourWidgets::ArdourIcon::ScrollRight); + act = ActionManager::get_action (X_("Common"), X_("jump-forward-to-mark")); + _livetrax_btn_next_marker.set_related_action (act); + + _livetrax_btn_new_location.set_tooltip_text(_("Create a New Location at Playhead")); + act = ActionManager::get_action (X_("Common"), X_("add-location-from-playhead")); + _livetrax_btn_new_location.set_related_action (act); + + _livetrax_btn_new_section.set_tooltip_text(_("Start a New Section at Playhead")); + act = ActionManager::get_action (X_("Common"), X_("add-section-from-playhead")); + _livetrax_btn_new_section.set_related_action (act); + /* order of addition affects order seen in initial window display */ main_vpacker.pack_start (menu_bar_base, false, false);