diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 5f3b536dcd..eb0c7b0cf6 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -213,11 +213,17 @@ static const gchar *_edit_point_strings[] = { static const gchar *_edit_mode_strings[] = { N_("Slide"), N_("Ripple"), - N_("Ripple All"), N_("Lock"), 0 }; +static const gchar *_ripple_mode_strings[] = { + N_("Selected"), + N_("All"), + N_("Interview"), + 0 +}; + static const gchar *_zoom_focus_strings[] = { N_("Left"), N_("Right"), @@ -482,6 +488,7 @@ Editor::Editor () grid_type_strings = I18N (_grid_type_strings); zoom_focus_strings = I18N (_zoom_focus_strings); edit_mode_strings = I18N (_edit_mode_strings); + ripple_mode_strings = I18N (_ripple_mode_strings); edit_point_strings = I18N (_edit_point_strings); #ifdef USE_RUBBERBAND rb_opt_strings = I18N (_rb_opt_strings); @@ -3182,6 +3189,7 @@ Editor::setup_toolbar () mouse_mode_size_group->add_widget (edit_point_selector); mouse_mode_size_group->add_widget (edit_mode_selector); + mouse_mode_size_group->add_widget (ripple_mode_selector); mouse_mode_size_group->add_widget (*nudge_clock); mouse_mode_size_group->add_widget (nudge_forward_button); @@ -3210,9 +3218,11 @@ Editor::setup_toolbar () mouse_mode_box->pack_start (*mouse_mode_align, false, false); + ripple_mode_selector.set_name ("mouse mode button"); edit_mode_selector.set_name ("mouse mode button"); mode_box->pack_start (edit_mode_selector, false, false); + mode_box->pack_start (ripple_mode_selector, false, false); mode_box->pack_start (*(manage (new ArdourVSpacer ())), false, false, 3); mode_box->pack_start (edit_point_selector, false, false); mode_box->pack_start (*(manage (new ArdourVSpacer ())), false, false, 3); @@ -3404,11 +3414,16 @@ Editor::build_edit_mode_menu () edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)Slide], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Slide))); edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)Ripple], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Ripple))); - edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)RippleAll], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) RippleAll))); edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)Lock], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Lock))); /* Note: Splice was removed */ set_size_request_to_display_given_text (edit_mode_selector, edit_mode_strings, COMBO_TRIANGLE_WIDTH, 2); + + ripple_mode_selector.AddMenuElem (MenuElem (ripple_mode_strings[(int)RippleSelected], sigc::bind (sigc::mem_fun(*this, &Editor::ripple_mode_selection_done), (RippleMode) RippleSelected))); + ripple_mode_selector.AddMenuElem (MenuElem (ripple_mode_strings[(int)RippleAll], sigc::bind (sigc::mem_fun(*this, &Editor::ripple_mode_selection_done), (RippleMode) RippleAll))); + ripple_mode_selector.AddMenuElem (MenuElem (ripple_mode_strings[(int)RippleInterview], sigc::bind (sigc::mem_fun(*this, &Editor::ripple_mode_selection_done), (RippleMode) RippleInterview))); + + set_size_request_to_display_given_text (ripple_mode_selector, ripple_mode_strings, COMBO_TRIANGLE_WIDTH, 2); } void @@ -3799,7 +3814,13 @@ Editor::duplicate_range (bool with_dialog) } void -Editor::set_edit_mode (EditMode m) +Editor::set_ripple_mode (RippleMode m) /* redundant with selection_done ? */ +{ + Config->set_ripple_mode (m); +} + +void +Editor::set_edit_mode (EditMode m) /* redundant with selection_done ? */ { Config->set_edit_mode (m); } @@ -3812,9 +3833,6 @@ Editor::cycle_edit_mode () Config->set_edit_mode (Ripple); break; case Ripple: - Config->set_edit_mode (RippleAll); - break; - case RippleAll: Config->set_edit_mode (Lock); break; case Lock: @@ -3829,6 +3847,12 @@ Editor::edit_mode_selection_done (EditMode m) Config->set_edit_mode (m); } +void +Editor::ripple_mode_selection_done (RippleMode m) +{ + Config->set_ripple_mode (m); +} + void Editor::grid_type_selection_done (GridType gridtype) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 4d86b00cf3..cd764a68c4 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1927,11 +1927,15 @@ private: Gtk::Button automation_mode_button; //edit mode menu stuff + ArdourWidgets::ArdourDropdown ripple_mode_selector; ArdourWidgets::ArdourDropdown edit_mode_selector; void edit_mode_selection_done (ARDOUR::EditMode); + void ripple_mode_selection_done (ARDOUR::RippleMode); void build_edit_mode_menu (); Gtk::VBox edit_mode_box; + void set_ripple_mode (ARDOUR::RippleMode); + void set_edit_mode (ARDOUR::EditMode); void cycle_edit_mode (); @@ -2310,6 +2314,7 @@ private: Glib::RefPtr edit_point_action (Editing::EditPoint); std::vector edit_point_strings; std::vector edit_mode_strings; + std::vector ripple_mode_strings; void selected_marker_moved (ARDOUR::Location*); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 95d1cb209f..cd76dce6e8 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -582,11 +582,14 @@ Editor::register_actions () ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), true)); ActionManager::register_action (editor_actions, "set-edit-ripple", _("Ripple"), bind (mem_fun (*this, &Editor::set_edit_mode), Ripple)); - ActionManager::register_action (editor_actions, "set-edit-ripple-all", _("Ripple All"), bind (mem_fun (*this, &Editor::set_edit_mode), RippleAll)); ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Slide)); ActionManager::register_action (editor_actions, "set-edit-lock", S_("EditMode|Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock)); ActionManager::register_action (editor_actions, "cycle-edit-mode", _("Cycle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode)); + ActionManager::register_action (editor_actions, "set-ripple-selected", _("Selected"), bind (mem_fun (*this, &Editor::set_ripple_mode), RippleSelected)); + ActionManager::register_action (editor_actions, "set-ripple-all", _("All"), sigc::bind (sigc::mem_fun (*this, &Editor::set_ripple_mode), RippleAll)); + ActionManager::register_action (editor_actions, "set-ripple-interview", S_("Interview"), sigc::bind (sigc::mem_fun (*this, &Editor::set_ripple_mode), RippleInterview)); + ActionManager::register_action (editor_actions, X_("GridChoice"), _("Snap & Grid")); RadioAction::Group snap_mode_group; @@ -1666,8 +1669,15 @@ Editor::parameter_changed (std::string p) update_just_timecode (); } else if (p == "show-region-fades") { update_region_fade_visibility (); + } else if (p == "ripple-mode") { + ripple_mode_selector.set_text (ripple_mode_strings [Config->get_ripple_mode()]); } else if (p == "edit-mode") { - edit_mode_selector.set_text (edit_mode_to_string (Config->get_edit_mode())); + edit_mode_selector.set_text (edit_mode_strings [Config->get_edit_mode()]); + if (Config->get_edit_mode()==Ripple) { + ripple_mode_selector.show(); + } else { + ripple_mode_selector.hide(); + } } else if (p == "show-track-meters") { toggle_meter_updating(); } else if (p == "show-summary") {