+
+
+void
+Editor::register_region_actions ()
+{
+ _region_actions = ActionGroup::create (X_("Region"));
+
+ /* PART 1: actions that operate on the selection, and for which the edit point type and location is irrelevant */
+
+ /* Remove selected regions */
+ reg_sens (_region_actions, "remove-region", _("Remove"), sigc::mem_fun (*this, &Editor::remove_selected_regions));
+
+ /* Offer dialogue box to rename the first selected region */
+ reg_sens (_region_actions, "rename-region", _("Rename..."), sigc::mem_fun (*this, &Editor::rename_region));
+
+ /* Raise all selected regions by 1 layer */
+ reg_sens (_region_actions, "raise-region", _("Raise"), sigc::mem_fun (*this, &Editor::raise_region));
+
+ /* Raise all selected regions to the top */
+ reg_sens (_region_actions, "raise-region-to-top", _("Raise to Top"), sigc::mem_fun (*this, &Editor::raise_region_to_top));
+
+ /* Lower all selected regions by 1 layer */
+ reg_sens (_region_actions, "lower-region", _("Lower"), sigc::mem_fun (*this, &Editor::lower_region));
+
+ /* Lower all selected regions to the bottom */
+ reg_sens (_region_actions, "lower-region-to-bottom", _("Lower to Bottom"), sigc::mem_fun (*this, &Editor::lower_region_to_bottom));
+
+ /* Move selected regions to their original (`natural') position */
+ reg_sens (_region_actions, "naturalize-region", _("Move to Original Position"), sigc::mem_fun (*this, &Editor::naturalize_region));
+
+ /* Toggle `locked' status of selected regions */
+ toggle_reg_sens (_region_actions, "toggle-region-lock", _("Lock"), sigc::mem_fun(*this, &Editor::toggle_region_lock));
+
+ toggle_reg_sens (
+ _region_actions,
+ "toggle-region-lock-style",
+ _("Glue to Bars and Beats"),
+ sigc::mem_fun (*this, &Editor::toggle_region_lock_style)
+ );
+
+ /* Remove sync points from selected regions */
+ reg_sens (_region_actions, "remove-region-sync", _("Remove Sync"), sigc::mem_fun(*this, &Editor::remove_region_sync));
+
+ /* Mute or unmute selected regions */
+ toggle_reg_sens (_region_actions, "toggle-region-mute", _("Mute"), sigc::mem_fun(*this, &Editor::toggle_region_mute));
+
+ /* Open the normalize dialogue to operate on the selected regions */
+ reg_sens (_region_actions, "normalize-region", _("Normalize..."), sigc::mem_fun(*this, &Editor::normalize_region));
+
+ /* Reverse selected regions */
+ reg_sens (_region_actions, "reverse-region", _("Reverse"), sigc::mem_fun (*this, &Editor::reverse_region));
+
+ /* Split selected multi-channel regions into mono regions */
+ reg_sens (_region_actions, "split-multichannel-region", _("Make Mono Regions"), sigc::mem_fun (*this, &Editor::split_multichannel_region));
+
+ /* Boost selected region gain */
+ reg_sens (_region_actions, "boost-region-gain", _("Boost Gain"), sigc::bind (sigc::mem_fun(*this, &Editor::adjust_region_gain), true));
+
+ /* Cut selected region gain */
+ reg_sens (_region_actions, "cut-region-gain", _("Cut Gain"), sigc::bind (sigc::mem_fun(*this, &Editor::adjust_region_gain), false));
+
+ /* Open the pitch shift dialogue for any selected audio regions */
+ reg_sens (_region_actions, "pitch-shift-region", _("Pitch Shift..."), sigc::mem_fun (*this, &Editor::pitch_shift_region));
+
+ /* Open the transpose dialogue for any selected MIDI regions */
+ reg_sens (_region_actions, "transpose-region", _("Transpose..."), sigc::mem_fun (*this, &Editor::transpose_region));
+
+ /* Toggle selected region opacity */
+ toggle_reg_sens (_region_actions, "toggle-opaque-region", _("Opaque"), sigc::mem_fun (*this, &Editor::toggle_opaque_region));
+
+ /* Toggle active status of selected regions' fade in */
+ toggle_reg_sens (
+ _region_actions, "toggle-region-fade-in", _("Fade In"), sigc::bind (sigc::mem_fun (*this, &Editor::toggle_region_fades), 1)
+ );
+
+ /* Toggle active status of selected regions' fade out */
+ toggle_reg_sens (
+ _region_actions, "toggle-region-fade-out", _("Fade Out"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_region_fades), -1)
+ );
+
+ /* Toggle active status of selected regions' fade in and out */
+ toggle_reg_sens (
+ _region_actions, "toggle-region-fades", _("Fades"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_region_fades), 0)
+ );
+
+ /* Open the dialogue to duplicate selected regions */
+ reg_sens (_region_actions, "duplicate-region", _("Duplicate"), sigc::bind (sigc::mem_fun (*this, &Editor::duplicate_dialog), false));
+
+ /* Open the dialogue to duplicate selected regions multiple times */
+ reg_sens (
+ _region_actions,
+ "multi-duplicate-region",
+ _("Multi-Duplicate..."),
+ sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_dialog), true)
+ );
+
+ /* Fill tracks with selected regions */
+ reg_sens (_region_actions, "region-fill-track", _("Fill Track"), sigc::mem_fun (*this, &Editor::region_fill_track));
+
+ /* Set up the loop range from the selected regions */
+ reg_sens (
+ _region_actions, "set-loop-from-region", _("Set Loop Range"), sigc::bind (sigc::mem_fun (*this, &Editor::set_loop_from_region), false)
+ );
+
+ /* Set up the loop range from the selected regions, and start playback of it */
+ reg_sens (_region_actions, "loop-region", _("Loop"), sigc::bind (sigc::mem_fun(*this, &Editor::set_loop_from_region), true));
+
+ /* Set the punch range from the selected regions */
+ reg_sens (_region_actions, "set-punch-from-region", _("Set Punch"), sigc::mem_fun (*this, &Editor::set_punch_from_region));
+
+ /* Add a single range marker around all selected regions */
+ reg_sens (
+ _region_actions, "add-range-marker-from-region", _("Add Single Range Marker"), sigc::mem_fun (*this, &Editor::add_location_from_region)
+ );
+
+ /* Add a range marker around each selected region */
+ reg_sens (
+ _region_actions, "add-range-markers-from-region", _("Add Range Marker Per Region"), sigc::mem_fun (*this, &Editor::add_locations_from_region)
+ );
+
+ /* Snap selected regions to the grid */
+ reg_sens (_region_actions, "snap-regions-to-grid", _("Snap Position To Grid"), sigc::mem_fun (*this, &Editor::snap_regions_to_grid));
+
+ /* Close gaps in selected regions */
+ reg_sens (_region_actions, "close-region-gaps", _("Close Gaps"), sigc::mem_fun (*this, &Editor::close_region_gaps));
+
+ /* Open the Rhythm Ferret dialogue for the selected regions */
+ reg_sens (_region_actions, "show-rhythm-ferret", _("Rhythm Ferret..."), sigc::mem_fun (*this, &Editor::show_rhythm_ferret));
+
+ /* Export the first selected region */
+ reg_sens (_region_actions, "export-region", _("Export..."), sigc::mem_fun (*this, &Editor::export_region));
+
+ /* Separate under selected regions: XXX not sure what this does */
+ reg_sens (
+ _region_actions,
+ "separate-under-region",
+ _("Separate Under"),
+ sigc::mem_fun (*this, &Editor::separate_under_selected_regions)
+ );
+
+ reg_sens (_region_actions, "set-fade-in-length", _("Set Fade In Length"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_length), true));
+ reg_sens (_region_actions, "set-fade-out-length", _("Set Fade Out Length"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_length), false));
+ reg_sens (_region_actions, "set-tempo-from-region", _("Set Tempo from Region = Bar"), sigc::mem_fun (*this, &Editor::set_tempo_from_region));
+
+ reg_sens (
+ _region_actions,
+ "split-region-at-transients",
+ _("Split at Percussion Onsets"),
+ sigc::mem_fun(*this, &Editor::split_region_at_transients)
+ );
+
+ /* Open the list editor dialogue for the selected regions */
+ reg_sens (_region_actions, "show-region-list-editor", _("List Editor..."), sigc::mem_fun (*this, &Editor::show_midi_list_editor));
+
+ /* Open the region properties dialogue for the selected regions */
+ reg_sens (_region_actions, "show-region-properties", _("Properties..."), sigc::mem_fun (*this, &Editor::show_region_properties));
+
+ reg_sens (_region_actions, "play-selected-regions", _("Play"), sigc::mem_fun(*this, &Editor::play_selected_region));
+
+ reg_sens (_region_actions, "bounce-regions-unprocessed", _("Bounce (with processing)"), (sigc::bind (sigc::mem_fun (*this, &Editor::bounce_region_selection), true)));
+ reg_sens (_region_actions, "bounce-regions-processed", _("Bounce (without processing)"), (sigc::bind (sigc::mem_fun (*this, &Editor::bounce_region_selection), false)));
+ reg_sens (_region_actions, "combine-regions", _("Combine"), sigc::mem_fun (*this, &Editor::combine_regions));
+ reg_sens (_region_actions, "uncombine-regions", _("Uncombine"), sigc::mem_fun (*this, &Editor::uncombine_regions));
+
+ reg_sens (_region_actions, "analyze-region", _("Spectral Analysis..."), sigc::mem_fun (*this, &Editor::analyze_region_selection));
+
+ reg_sens (_region_actions, "reset-region-gain-envelopes", _("Reset Envelope"), sigc::mem_fun (*this, &Editor::reset_region_gain_envelopes));
+
+ reg_sens (_region_actions, "reset-region-scale-amplitude", _("Reset Gain"), sigc::mem_fun (*this, &Editor::reset_region_scale_amplitude));
+
+ toggle_reg_sens (
+ _region_actions,
+ "toggle-region-gain-envelope-visible",
+ _("Envelope Visible"),
+ sigc::mem_fun (*this, &Editor::toggle_gain_envelope_visibility)
+ );
+
+ toggle_reg_sens (
+ _region_actions,
+ "toggle-region-gain-envelope-active",
+ _("Envelope Active"),
+ sigc::mem_fun (*this, &Editor::toggle_gain_envelope_active)
+ );
+
+ reg_sens (_region_actions, "quantize-region", _("Quantize..."), sigc::mem_fun (*this, &Editor::quantize_region));
+ reg_sens (_region_actions, "insert-patch-change", _("Insert Patch Change..."), sigc::bind (sigc::mem_fun (*this, &Editor::insert_patch_change), false));
+ reg_sens (_region_actions, "insert-patch-change-context", _("Insert Patch Change..."), sigc::bind (sigc::mem_fun (*this, &Editor::insert_patch_change), true));
+ reg_sens (_region_actions, "fork-region", _("Fork"), sigc::mem_fun (*this, &Editor::fork_region));
+ reg_sens (_region_actions, "strip-region-silence", _("Strip Silence..."), sigc::mem_fun (*this, &Editor::strip_region_silence));
+ reg_sens (_region_actions, "set-selection-from-region", _("Set Range Selection"), sigc::mem_fun (*this, &Editor::set_selection_from_region));
+
+ reg_sens (_region_actions, "nudge-forward", _("Nudge Forward"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_forward), false, false));
+ reg_sens (_region_actions, "nudge-backward", _("Nudge Backward"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_backward), false, false));
+
+ reg_sens (
+ _region_actions,
+ "nudge-forward-by-capture-offset",
+ _("Nudge Forward by Capture Offset"),
+ sigc::mem_fun (*this, &Editor::nudge_forward_capture_offset)
+ );
+
+ reg_sens (
+ _region_actions,
+ "nudge-backward-by-capture-offset",
+ _("Nudge Backward by Capture Offset"),
+ sigc::mem_fun (*this, &Editor::nudge_backward_capture_offset)
+ );
+
+ reg_sens (_region_actions, "trim-region-to-loop", _("Trim to Loop"), sigc::mem_fun (*this, &Editor::trim_region_to_loop));
+ reg_sens (_region_actions, "trim-region-to-punch", _("Trim to Punch"), sigc::mem_fun (*this, &Editor::trim_region_to_punch));
+
+ reg_sens (_region_actions, "trim-to-previous-region", _("Trim to Previous"), sigc::mem_fun(*this, &Editor::trim_region_to_previous_region_end));
+ reg_sens (_region_actions, "trim-to-next-region", _("Trim to Next"), sigc::mem_fun(*this, &Editor::trim_region_to_next_region_start));
+
+ /* PART 2: actions that are not related to the selection, but for which the edit point type and location is important */
+
+ reg_sens (
+ _region_actions,
+ "insert-region-from-region-list",
+ _("Insert Region From Region List"),
+ sigc::bind (sigc::mem_fun (*this, &Editor::insert_region_list_selection), 1)
+ );
+
+ /* PART 3: actions that operate on the selection and also require the edit point location */
+
+ reg_sens (_region_actions, "set-region-sync-position", _("Set Sync Position"), sigc::mem_fun (*this, &Editor::set_region_sync_position));
+ reg_sens (_region_actions, "place-transient", _("Place Transient"), sigc::mem_fun (*this, &Editor::place_transient));
+ reg_sens (_region_actions, "split-region", _("Split"), sigc::mem_fun (*this, &Editor::split_region));
+ reg_sens (_region_actions, "trim-front", _("Trim Start at Edit Point"), sigc::mem_fun (*this, &Editor::trim_region_front));
+ reg_sens (_region_actions, "trim-back", _("Trim End at Edit Point"), sigc::mem_fun (*this, &Editor::trim_region_back));
+
+ reg_sens (
+ _region_actions,
+ "align-regions-start",
+ _("Align Start"),
+ sigc::bind (sigc::mem_fun(*this, &Editor::align_regions), ARDOUR::Start)
+ );
+
+ reg_sens (
+ _region_actions,
+ "align-regions-start-relative",
+ _("Align Start Relative"),
+ sigc::bind (sigc::mem_fun (*this, &Editor::align_regions_relative), ARDOUR::Start)
+ );
+
+ reg_sens (_region_actions, "align-regions-end", _("Align End"), sigc::bind (sigc::mem_fun (*this, &Editor::align_regions), ARDOUR::End));
+
+ reg_sens (
+ _region_actions,
+ "align-regions-end-relative",
+ _("Align End Relative"),
+ sigc::bind (sigc::mem_fun(*this, &Editor::align_regions_relative), ARDOUR::End)
+ );
+
+ reg_sens (
+ _region_actions,
+ "align-regions-sync",
+ _("Align Sync"),
+ sigc::bind (sigc::mem_fun(*this, &Editor::align_regions), ARDOUR::SyncPoint)
+ );
+
+ reg_sens (
+ _region_actions,
+ "align-regions-sync-relative",
+ _("Align Sync Relative"),
+ sigc::bind (sigc::mem_fun (*this, &Editor::align_regions_relative), ARDOUR::SyncPoint)
+ );
+
+ Glib::RefPtr<Action> a = reg_sens (_region_actions, "choose-top-region", _("Choose Top..."), sigc::bind (sigc::mem_fun (*this, &Editor::change_region_layering_order), false));
+ a->set_accel_group (get_accel_group ());
+
+ a = reg_sens (_region_actions, "choose-top-region-context-menu", _("Choose Top..."), sigc::bind (sigc::mem_fun (*this, &Editor::change_region_layering_order), true));
+ a->set_accel_group (get_accel_group ());
+
+ _all_region_actions_sensitized = true;
+
+ ActionManager::add_action_group (_region_actions);
+}