a-fluidsynth: implement LV2_BANKPATCH__notify
[ardour.git] / gtk2_ardour / editor_actions.cc
index b740f9539c6b19290559142c0b54e011b52accab..8a447beecf1f98898d3b7344fb4e26e8a5602b73 100644 (file)
@@ -160,13 +160,16 @@ Editor::register_actions ()
        myactions.register_action (editor_menu_actions, X_("SyncMenu"), _("Sync"));
        myactions.register_action (editor_menu_actions, X_("TempoMenu"), _("Tempo"));
        myactions.register_action (editor_menu_actions, X_("Timecode"), _("Timecode fps"));
-       myactions.register_action (editor_menu_actions, X_("TrackHeightMenu"), _("Height"));
+
+       act = myactions.register_action (editor_menu_actions, X_("TrackHeightMenu"), _("Height"));
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
+
        myactions.register_action (editor_menu_actions, X_("TrackMenu"), _("Track"));
        myactions.register_action (editor_menu_actions, X_("Tools"), _("Tools"));
        myactions.register_action (editor_menu_actions, X_("View"), _("View"));
        myactions.register_action (editor_menu_actions, X_("ZoomFocus"), _("Zoom Focus"));
        myactions.register_action (editor_menu_actions, X_("ZoomMenu"), _("Zoom"));
-       myactions.register_action (editor_menu_actions, X_("ActionScripts"), _("Scripted Actions"));
+       myactions.register_action (editor_menu_actions, X_("LuaScripts"), _("Lua Scripts"));
 
        register_region_actions ();
 
@@ -237,17 +240,20 @@ Editor::register_actions ()
        reg_sens (editor_actions, "select-all-in-punch-range", _("Select All in Punch Range"), sigc::mem_fun(*this, &Editor::select_all_selectables_using_punch));
        reg_sens (editor_actions, "select-all-in-loop-range", _("Select All in Loop Range"), sigc::mem_fun(*this, &Editor::select_all_selectables_using_loop));
 
-       reg_sens (editor_actions, "select-next-route", _("Select Next Track or Bus"), sigc::mem_fun(*this, &Editor::select_next_route));
-       reg_sens (editor_actions, "select-prev-route", _("Select Previous Track or Bus"), sigc::mem_fun(*this, &Editor::select_prev_route));
+       reg_sens (editor_actions, "select-next-route", _("Select Next Track or Bus"), sigc::bind (sigc::mem_fun(*this, &Editor::select_next_stripable), true));
+       reg_sens (editor_actions, "select-prev-route", _("Select Previous Track or Bus"), sigc::bind (sigc::mem_fun(*this, &Editor::select_prev_stripable), true));
+
+       reg_sens (editor_actions, "select-next-stripable", _("Select Next Strip"), sigc::bind (sigc::mem_fun(*this, &Editor::select_next_stripable), false));
+       reg_sens (editor_actions, "select-prev-stripable", _("Select Previous Strip"), sigc::bind (sigc::mem_fun(*this, &Editor::select_prev_stripable), false));
 
        act = reg_sens (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), sigc::mem_fun(*this, &Editor::toggle_record_enable));
        ActionManager::track_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-solo-toggle", _("Toggle Solo"), sigc::mem_fun(*this, &Editor::toggle_solo));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-mute-toggle", _("Toggle Mute"), sigc::mem_fun(*this, &Editor::toggle_mute));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-solo-isolate-toggle", _("Toggle Solo Isolate"), sigc::mem_fun(*this, &Editor::toggle_solo_isolate));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
 
        for (int i = 1; i <= 12; ++i) {
                string const a = string_compose (X_("save-visual-state-%1"), i);
@@ -270,6 +276,7 @@ Editor::register_actions ()
        reg_sens (editor_actions, "temporal-zoom-out", _("Zoom Out"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), true));
        reg_sens (editor_actions, "temporal-zoom-in", _("Zoom In"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), false));
        reg_sens (editor_actions, "zoom-to-session", _("Zoom to Session"), sigc::mem_fun(*this, &Editor::temporal_zoom_session));
+       reg_sens (editor_actions, "zoom-to-extents", _("Zoom to Extents"), sigc::mem_fun(*this, &Editor::temporal_zoom_extents));
        reg_sens (editor_actions, "zoom-to-selection", _("Zoom to Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), Both));
        reg_sens (editor_actions, "zoom-to-selection-horiz", _("Zoom to Selection (Horizontal)"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), Horizontal));
        reg_sens (editor_actions, "toggle-zoom", _("Toggle Zoom State"), sigc::mem_fun(*this, &Editor::swap_visual_state));
@@ -294,14 +301,15 @@ Editor::register_actions ()
        reg_sens (editor_actions, "zoom_10_min", _("Zoom to 10 min"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 10 * 60 * 1000));
 
        act = reg_sens (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
 
        act = reg_sens (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), sigc::mem_fun(*this, &Editor::scroll_tracks_up));
        act = reg_sens (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), sigc::mem_fun(*this, &Editor::scroll_tracks_down));
        act = reg_sens (editor_actions, "step-tracks-up", _("Step Tracks Up"), sigc::hide_return (sigc::bind (sigc::mem_fun(*this, &Editor::scroll_up_one_track), true)));
        act = reg_sens (editor_actions, "step-tracks-down", _("Step Tracks Down"), sigc::hide_return (sigc::bind (sigc::mem_fun(*this, &Editor::scroll_down_one_track), true)));
+       act = reg_sens (editor_actions, "select-topmost", _("Select Topmost Track"), (sigc::mem_fun(*this, &Editor::select_topmost_track)));
 
        reg_sens (editor_actions, "scroll-backward", _("Scroll Backward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_backward), 0.8f));
        reg_sens (editor_actions, "scroll-forward", _("Scroll Forward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_forward), 0.8f));
@@ -334,7 +342,7 @@ Editor::register_actions ()
        reg_sens (editor_actions, "duplicate", _("Duplicate"), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_range), false));
 
        /* Open the dialogue to duplicate selected regions multiple times */
-       reg_sens (editor_actions, "multi-duplicate", _ ("Multi-Duplicate..."),
+       reg_sens (editor_actions, "multi-duplicate", _("Multi-Duplicate..."),
                  sigc::bind (sigc::mem_fun (*this, &Editor::duplicate_range), true));
 
        undo_action = reg_sens (editor_actions, "undo", S_("Command|Undo"), sigc::bind (sigc::mem_fun(*this, &Editor::undo), 1U));
@@ -353,13 +361,10 @@ Editor::register_actions ()
        ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
 
        act = reg_sens (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), sigc::mem_fun(*this, &Editor::separate_region_from_punch));
-       ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
-
        act = reg_sens (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), sigc::mem_fun(*this, &Editor::separate_region_from_loop));
-       ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
 
        act = reg_sens (editor_actions, "editor-crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection));
-       ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act);
+       ActionManager::time_selection_sensitive_actions.push_back (act);
 
        reg_sens (editor_actions, "editor-cut", _("Cut"), sigc::mem_fun(*this, &Editor::cut));
        reg_sens (editor_actions, "editor-delete", _("Delete"), sigc::mem_fun(*this, &Editor::delete_));
@@ -428,29 +433,28 @@ Editor::register_actions ()
 
 
        act = reg_sens (editor_actions, "toggle-track-active", _("Toggle Active"), (sigc::mem_fun(*this, &Editor::toggle_tracks_active)));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::route_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "remove-track", _("Remove"), (sigc::mem_fun(*this, &Editor::remove_tracks)));
-       /* not selection sensitive? */
-
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
 
        act = reg_sens (editor_actions, "fit-selection", _("Fit Selection (Vertical)"), sigc::mem_fun(*this, &Editor::fit_selection));
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
 
        act = reg_sens (editor_actions, "track-height-largest", _("Largest"), sigc::bind (
                                sigc::mem_fun(*this, &Editor::set_track_height), HeightLargest));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-height-larger", _("Larger"), sigc::bind (
                                sigc::mem_fun(*this, &Editor::set_track_height), HeightLarger));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-height-large", _("Large"), sigc::bind (
                                sigc::mem_fun(*this, &Editor::set_track_height), HeightLarge));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-height-normal", _("Normal"), sigc::bind (
                                sigc::mem_fun(*this, &Editor::set_track_height), HeightNormal));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
        act = reg_sens (editor_actions, "track-height-small", _("Small"), sigc::bind (
                                sigc::mem_fun(*this, &Editor::set_track_height), HeightSmall));
-       ActionManager::track_selection_sensitive_actions.push_back (act);
+       ActionManager::stripable_selection_sensitive_actions.push_back (act);
 
        toggle_reg_sens (editor_actions, "sound-midi-notes", _("Sound Selected MIDI Notes"), sigc::mem_fun (*this, &Editor::toggle_sound_midi_notes));
 
@@ -485,38 +489,38 @@ Editor::register_actions ()
 
        act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-object", _("Object Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseObject));
        mouse_move_button.set_related_action (act);
-       mouse_move_button.set_icon (Gtkmm2ext::ArdourIcon::ToolGrab);
+       mouse_move_button.set_icon (ArdourWidgets::ArdourIcon::ToolGrab);
        mouse_move_button.set_name ("mouse mode button");
 
        act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-range", _("Range Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange));
        mouse_select_button.set_related_action (act);
-       mouse_select_button.set_icon (Gtkmm2ext::ArdourIcon::ToolRange);
+       mouse_select_button.set_icon (ArdourWidgets::ArdourIcon::ToolRange);
        mouse_select_button.set_name ("mouse mode button");
 
        act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-draw", _("Note Drawing Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseDraw));
        mouse_draw_button.set_related_action (act);
-       mouse_draw_button.set_icon (Gtkmm2ext::ArdourIcon::ToolDraw);
+       mouse_draw_button.set_icon (ArdourWidgets::ArdourIcon::ToolDraw);
        mouse_draw_button.set_name ("mouse mode button");
 
        act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-audition", _("Audition Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseAudition));
        mouse_audition_button.set_related_action (act);
-       mouse_audition_button.set_icon (Gtkmm2ext::ArdourIcon::ToolAudition);
+       mouse_audition_button.set_icon (ArdourWidgets::ArdourIcon::ToolAudition);
        mouse_audition_button.set_name ("mouse mode button");
 
        act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("Time FX Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseTimeFX));
        mouse_timefx_button.set_related_action (act);
-       mouse_timefx_button.set_icon (Gtkmm2ext::ArdourIcon::ToolStretch);
+       mouse_timefx_button.set_icon (ArdourWidgets::ArdourIcon::ToolStretch);
        mouse_timefx_button.set_name ("mouse mode button");
 
        act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-content", _("Content Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseContent));
        mouse_content_button.set_related_action (act);
-       mouse_content_button.set_icon (Gtkmm2ext::ArdourIcon::ToolContent);
+       mouse_content_button.set_icon (ArdourWidgets::ArdourIcon::ToolContent);
        mouse_content_button.set_name ("mouse mode button");
 
        if(!Profile->get_mixbus()) {
                act = myactions.register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-cut", _("Cut Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseCut));
                mouse_cut_button.set_related_action (act);
-               mouse_cut_button.set_icon (Gtkmm2ext::ArdourIcon::ToolCut);
+               mouse_cut_button.set_icon (ArdourWidgets::ArdourIcon::ToolCut);
                mouse_cut_button.set_name ("mouse mode button");
        }
 
@@ -734,7 +738,7 @@ Editor::register_actions ()
        myactions.register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measure Lines"), sigc::mem_fun (*this, &Editor::toggle_measure_visibility));
 
        myactions.register_action (editor_actions, X_("toggle-midi-input-active"), _("Toggle MIDI Input Active for Editor-Selected Tracks/Busses"),
-                                  sigc::bind (sigc::mem_fun (*this, &Editor::toggle_midi_input_active), false));
+                                  sigc::bind (sigc::mem_fun (*this, &Editor::toggle_midi_input_active), false));
 
 
        /* MIDI stuff */
@@ -1696,7 +1700,7 @@ Editor::parameter_changed (std::string p)
                        _group_tabs->hide ();
                }
 
-                reset_controls_layout_width ();
+               reset_controls_layout_width ();
 
                Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
                if (act) {
@@ -1799,6 +1803,9 @@ Editor::register_region_actions ()
        /* Cut selected region gain */
        register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "cut-region-gain", _("Cut Gain"), sigc::bind (sigc::mem_fun(*this, &Editor::adjust_region_gain), false));
 
+       /* Reset selected region gain */
+       register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "reset-region-gain", _("Reset Gain"), sigc::mem_fun(*this, &Editor::reset_region_gain));
+
        /* Open the pitch shift dialogue for any selected audio regions */
        register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "pitch-shift-region", _("Pitch Shift..."), sigc::mem_fun (*this, &Editor::pitch_shift_region));