diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 64f541f9c1..95e71e8681 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -325,10 +325,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , _livetrax_spacer2 (ArdourWidgets::ArdourDropShadow::DropShadowLongSideOnly, 1.0) , _livetrax_spacer3 (ArdourWidgets::ArdourDropShadow::DropShadowLongSideOnly, 1.0) , _livetrax_btn_peak_reset (_("Reset Peaks")) - , _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)) , _livetrax_toolbar_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL)) , _livetrax_viewbutton_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_BOTH)) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index f46cb0519c..16cf8ba2f0 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -663,11 +663,6 @@ private: ArdourWidgets::ArdourButton _livetrax_btn_peak_reset; - ArdourWidgets::ArdourButton _livetrax_btn_new_section; - ArdourWidgets::ArdourButton _livetrax_btn_new_location; - ArdourWidgets::ArdourButton _livetrax_btn_prev_marker; - ArdourWidgets::ArdourButton _livetrax_btn_next_marker; - Glib::RefPtr _livetrax_centering_sizegroup; Glib::RefPtr _livetrax_toolbar_sizegroup; Glib::RefPtr _livetrax_viewbutton_sizegroup; diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index b5b7bb3fa2..e93b5cf950 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -483,10 +483,6 @@ 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_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++; @@ -594,24 +590,7 @@ 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); + editor->livetrax_assign_ui_dependent_actions(); _livetrax_spacer1.set_size_request(-1, 6); _livetrax_spacer2.set_size_request(-1, 12); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index cf51f00762..d2d4a2ff6c 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -474,6 +474,12 @@ Editor::Editor () , _following_mixer_selection (false) , _show_touched_automation (false) , _control_point_toggled_on_press (false) +#ifdef LIVETRAX + , _livetrax_btn_new_section (_("+Sec")) + , _livetrax_btn_new_location (_("+Loc")) + , _livetrax_btn_prev_marker (_("<<")) + , _livetrax_btn_next_marker (_(">>")) +#endif , _stepping_axis_view (0) , quantize_dialog (0) , _main_menu_disabler (0) @@ -689,11 +695,17 @@ Editor::Editor () Label *spcr = manage(new Label()); spcr->set_size_request(8,-1); + HBox *marker_hbox = manage (new HBox()); + marker_hbox->pack_start (_livetrax_btn_prev_marker, false, false, 2); + marker_hbox->pack_start (_livetrax_btn_next_marker, false, false, 2); + marker_hbox->pack_start (_livetrax_btn_new_section, false, false, 2); + marker_hbox->pack_start (_livetrax_btn_new_location, false, false, 2); + Table *tsizer = manage(new Table); tsizer->set_homogeneous(false); tsizer->set_border_width(4); tsizer->set_spacings(4); - tsizer->attach(*manage(new Label()), 0,6, 0,1, FILL, EXPAND); + tsizer->attach(*marker_hbox, 0,6, 0,1, FILL, EXPAND); tsizer->attach(_track_box, 0,2, 1,2, FILL, FILL); tsizer->attach(*manage(new Label()), 2,3, 0,1, EXPAND, SHRINK); tsizer->attach(solo_btn, 3,4, 1,2, FILL, FILL); @@ -1005,6 +1017,36 @@ Editor::~Editor() } } +#ifdef LIVETRAX +void +Editor::livetrax_assign_ui_dependent_actions() +{ + Glib::RefPtr act; + + _livetrax_btn_prev_marker.set_tooltip_text(_("Jump to Prior Marker")); + _livetrax_btn_prev_marker.set_elements(ArdourButton::Element (ArdourButton::VectorIcon|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_elements(ArdourButton::Element (ArdourButton::VectorIcon|ArdourButton::Body)); + _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")); + _livetrax_btn_new_location.set_elements(ArdourButton::Element (ArdourButton::Text|ArdourButton::Body)); + 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")); + _livetrax_btn_new_section.set_elements(ArdourButton::Element (ArdourButton::Text|ArdourButton::Body)); + act = ActionManager::get_action (X_("Common"), X_("add-section-from-playhead")); + _livetrax_btn_new_section.set_related_action (act); +} +#endif + XMLNode* Editor::button_settings () const { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 64d071a028..ffefcc34e5 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -235,6 +235,10 @@ public: int rb_current_opt; #endif +#ifdef LIVETRAX + void livetrax_assign_ui_dependent_actions(); +#endif + /* things that need to be public to be used in the main menubar */ void new_region_from_selection (); @@ -2632,8 +2636,15 @@ private: }; TrackDrag* track_drag; +#ifdef LIVETRAX ArdourWidgets::ArdourButton _livetrax_btn_rec_all; + ArdourWidgets::ArdourButton _livetrax_btn_new_section; + ArdourWidgets::ArdourButton _livetrax_btn_new_location; + ArdourWidgets::ArdourButton _livetrax_btn_prev_marker; + ArdourWidgets::ArdourButton _livetrax_btn_next_marker; +#endif + friend class RegionMoveDrag; friend class TrimDrag; friend class MappingTwistDrag; diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index e7de95fb44..f6dd413fd2 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -616,6 +616,10 @@ public: Gtk::Adjustment vertical_adjustment; Gtk::Adjustment horizontal_adjustment; +#ifdef LIVETRAX + virtual void livetrax_assign_ui_dependent_actions() = 0; +#endif + protected: friend class DisplaySuspender; virtual void suspend_route_redisplay () = 0;