diff options
-rw-r--r-- | gtk2_ardour/ardour-sae.bindings.in | 21 | ||||
-rw-r--r-- | gtk2_ardour/ardour-sae.menus | 17 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 17 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 39 | ||||
-rw-r--r-- | gtk2_ardour/editor_audiotrack.cc | 31 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 159 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/gain_meter.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.cc | 18 | ||||
-rw-r--r-- | gtk2_ardour/selection.cc | 26 | ||||
-rw-r--r-- | gtk2_ardour/selection.h | 8 |
11 files changed, 236 insertions, 116 deletions
diff --git a/gtk2_ardour/ardour-sae.bindings.in b/gtk2_ardour/ardour-sae.bindings.in index e1f031b8e8..7b15d347a0 100644 --- a/gtk2_ardour/ardour-sae.bindings.in +++ b/gtk2_ardour/ardour-sae.bindings.in @@ -29,6 +29,7 @@ ; (gtk_accel_path "<Actions>/RegionList/rlHide" "") ; (gtk_accel_path "<Actions>/Main/Metering" "") (gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow") +(gtk_accel_path "<Actions>/Editor/selected-marker-to-next-region-boundary" "<%PRIMARY%><%TERTIARY%>rightarrow") ; (gtk_accel_path "<Actions>/Zoom/zoom-focus-playhead" "") ; (gtk_accel_path "<Actions>/Editor/center-edit-cursor" "") ; (gtk_accel_path "<Actions>/Editor/Monitoring" "") @@ -72,8 +73,8 @@ ; (gtk_accel_path "<Actions>/options/StopPluginsWithTransport" "") (gtk_accel_path "<Actions>/Editor/editor-paste" "<%PRIMARY%>v") (gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down") -(gtk_accel_path "<Actions>/Editor/select-next-route" "<%PRIMARY%>Page_Down") -(gtk_accel_path "<Actions>/Editor/select-prev-route" "<%PRIMARY%>Page_Up") +(gtk_accel_path "<Actions>/Editor/select-next-route" "downarrow") +(gtk_accel_path "<Actions>/Editor/select-prev-route" "uparrow") ; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-minutes" "") ; (gtk_accel_path "<Actions>/Main/FlushWastebasket" "") (gtk_accel_path "<Actions>/Editor/normalize-region" "n") @@ -89,7 +90,6 @@ (gtk_accel_path "<Actions>/Editor/undo" "<%PRIMARY%>z") (gtk_accel_path "<Actions>/Editor/insert-region" "i") ; (gtk_accel_path "<Actions>/Editor/center-playhead" "") -(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-start" "bracketright") ; (gtk_accel_path "<Actions>/Snap/snap-to-region-start" "") ; (gtk_accel_path "<Actions>/Editor/View" "") ; (gtk_accel_path "<Actions>/Editor/Layering" "") @@ -99,6 +99,7 @@ ; (gtk_accel_path "<Actions>/Editor/Smpte30drop" "") ; (gtk_accel_path "<Actions>/Zoom/zoom-focus-edit" "") (gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow") +(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow") ; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "") ; (gtk_accel_path "<Actions>/redirectmenu/activate_all" "") ; (gtk_accel_path "<Actions>/redirectmenu/paste" "") @@ -111,10 +112,8 @@ ; (gtk_accel_path "<Actions>/Editor/CrossfadesShort" "") ; (gtk_accel_path "<Actions>/Editor/Smpte5994" "") ; (gtk_accel_path "<Actions>/JACK/JACKLatency8192" "") -(gtk_accel_path "<Actions>/Editor/step-tracks-down" "downarrow") ; (gtk_accel_path "<Actions>/Editor/toggle-xfades-visible" "") (gtk_accel_path "<Actions>/Editor/extend-range-to-end-of-region" "rightanglebracket") -(gtk_accel_path "<Actions>/Editor/scroll-backward" "leftarrow") (gtk_accel_path "<Actions>/Editor/start-range" "F1") ; (gtk_accel_path "<Actions>/ShuttleActions/SetShuttleUnitsSemitones" "") ; (gtk_accel_path "<Actions>/JACK/JACKLatency128" "") @@ -131,9 +130,9 @@ ; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "") ; (gtk_accel_path "<Actions>/RegionList/rlRemove" "") (gtk_accel_path "<Actions>/Transport/GotoStart" "Home") -(gtk_accel_path "<Actions>/Editor/select-all-before-edit-cursor" "<%LEVEL4%>Home") +(gtk_accel_path "<Actions>/Editor/select-all-before-edit-cursor" "<%TERTIARY%>Home") (gtk_accel_path "<Actions>/Editor/scroll-playhead-backward" "<%TERTIARY%>leftarrow") -(gtk_accel_path "<Actions>/Editor/split-region" "d") +(gtk_accel_path "<Actions>/Editor/split-region" "z") ; (gtk_accel_path "<Actions>/Transport/ToggleAutoInput" "") ; (gtk_accel_path "<Actions>/Snap/snap-to-thirtyseconds" "") ; (gtk_accel_path "<Actions>/Snap/snap-to-minutes" "") @@ -142,7 +141,6 @@ ; (gtk_accel_path "<Actions>/Main/CleanupUnused" "") ; (gtk_accel_path "<Actions>/redirectmenu/deselectall" "") ; (gtk_accel_path "<Actions>/options/SoloViaBus" "") -(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "z") ; (gtk_accel_path "<Actions>/RegionList/rlAudition" "") (gtk_accel_path "<Actions>/Editor/set-region-sync-position" "u") ; (gtk_accel_path "<Actions>/Editor/PullupPlus4Plus1" "") @@ -193,7 +191,6 @@ ; (gtk_accel_path "<Actions>/Editor/LayerMoveAddHigher" "") ; (gtk_accel_path "<Actions>/Editor/Smpte60" "") ; (gtk_accel_path "<Actions>/Main/Open" "") -(gtk_accel_path "<Actions>/Editor/scroll-forward" "rightarrow") ; (gtk_accel_path "<Actions>/Zoom/zoom-focus-left" "") ; (gtk_accel_path "<Actions>/Main/TransportOptions" "") ; (gtk_accel_path "<Actions>/Main/ControlSurfaces" "") @@ -225,7 +222,6 @@ ; (gtk_accel_path "<Actions>/Editor/Crossfades" "") ; (gtk_accel_path "<Actions>/Editor/PullupPlus4" "") (gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "KP_Enter") -(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-end" "<%PRIMARY%>bracketleft") ; (gtk_accel_path "<Actions>/Main/MeteringHoldTime" "") ; (gtk_accel_path "<Actions>/Editor/PullupPlus1" "") ; (gtk_accel_path "<Actions>/Editor/Smpte24976" "") @@ -252,7 +248,7 @@ (gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>Delete") ; (gtk_accel_path "<Actions>/options/FileHeaderFormatWAVE" "") (gtk_accel_path "<Actions>/Transport/GotoZero" "KP_Insert") -(gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<%LEVEL4%>End") +(gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<%TERTIARY%>End") ; (gtk_accel_path "<Actions>/redirectmenu/cut" "") ; (gtk_accel_path "<Actions>/redirectmenu/newinsert" "") ; (gtk_accel_path "<Actions>/options/UseMMC" "") @@ -278,7 +274,6 @@ ; (gtk_accel_path "<Actions>/RegionList/SortByRegionTimestamp" "") ; (gtk_accel_path "<Actions>/options/VerifyRemoveLastCapture" "") ; (gtk_accel_path "<Actions>/options/OutputAutoConnectPhysical" "") -(gtk_accel_path "<Actions>/Editor/step-tracks-up" "uparrow") ; (gtk_accel_path "<Actions>/options/SendMMC" "") ; (gtk_accel_path "<Actions>/Editor/toggle-auto-xfades" "") ; (gtk_accel_path "<Actions>/Main/AudioFileFormatHeader" "") @@ -337,4 +332,6 @@ (gtk_accel_path "<Actions>/Transport/ToggleClick" "5") (gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "4") (gtk_accel_path "<Actions>/Transport/focus-on-clock" "KP_Divide") +(gtk_accel_path "<Actions>/Editor/set-loop-from-edit-range" "bracketright") +(gtk_accel_path "<Actions>/Editor/set-punch-from-edit-range" "bracketleft") diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus index af875a49ba..1746cb4115 100644 --- a/gtk2_ardour/ardour-sae.menus +++ b/gtk2_ardour/ardour-sae.menus @@ -55,10 +55,8 @@ <menuitem action='playhead-to-next-region-sync'/> <menuitem action='playhead-to-previous-region-sync'/> <menuitem action='center-playhead'/> + <separator/> <menuitem action='playhead-to-edit'/> - <separator/> - <menuitem action='playhead-to-range-start'/> - <menuitem action='playhead-to-range-end'/> <menuitem action='focus-on-clock'/> <separator/> <menuitem action='ToggleTimeMaster'/> @@ -69,6 +67,9 @@ <menuitem action='ToggleAutoReturn'/> <menuitem action='ToggleClick'/> <menuitem action='toggle-follow-playhead'/> + <separator/> + <menuitem action='set-loop-from-edit-range'/> + <menuitem action='set-punch-from-edit-range'/> </menu> <menu name='Edit' action='Edit'> <menuitem action='undo'/> @@ -87,8 +88,6 @@ <menuitem action='invert-selection'/> <menuitem action='select-all-after-edit-cursor'/> <menuitem action='select-all-before-edit-cursor'/> - <menuitem action='select-all-after-playhead'/> - <menuitem action='select-all-before-playhead'/> <menuitem action='select-all-between-cursors'/> <menuitem action='select-all-within-cursors'/> <menuitem action='select-all-in-punch-range'/> @@ -98,16 +97,12 @@ <menuitem action='select-prev-route'/> <separator/> <menu action='EditCursorMovementOptions'> - <menuitem action='edit-cursor-to-next-region-start'/> - <menuitem action='edit-cursor-to-next-region-end'/> - <menuitem action='edit-cursor-to-previous-region-start'/> - <menuitem action='edit-cursor-to-previous-region-end'/> + <menuitem action='selected-marker-to-next-region-boundary'/> + <menuitem action='selected-marker-to-previous-region-boundary'/> <menuitem action='edit-cursor-to-next-region-sync'/> <menuitem action='edit-cursor-to-previous-region-sync'/> <menuitem action='center-edit-cursor'/> <menuitem action='edit-to-playhead'/> - <menuitem action='edit-cursor-to-range-start'/> - <menuitem action='edit-cursor-to-range-end'/> </menu> <menu name='KeyMouse Actions' action='KeyMouse Actions'> <menuitem action='audition-at-mouse'/> diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 1f64e4d2e5..05e9d7c088 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -665,11 +665,14 @@ class Editor : public PublicEditor void cursor_to_selection_start (Cursor *); void cursor_to_selection_end (Cursor *); - void edit_point_to_next_region_point (ARDOUR::RegionPoint); - void edit_point_to_previous_region_point (ARDOUR::RegionPoint); - void edit_point_to_region_point (ARDOUR::RegionPoint, int32_t dir); - void edit_point_to_selection_start (); - void edit_point_to_selection_end (); + void selected_marker_to_region_boundary (int32_t dir); + void selected_marker_to_next_region_boundary (); + void selected_marker_to_previous_region_boundary (); + void selected_marker_to_next_region_point (ARDOUR::RegionPoint); + void selected_marker_to_previous_region_point (ARDOUR::RegionPoint); + void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir); + void selected_marker_to_selection_start (); + void selected_marker_to_selection_end (); void select_all_selectables_using_cursor (Cursor *, bool); void select_all_selectables_using_edit (bool); @@ -1095,11 +1098,15 @@ class Editor : public PublicEditor void set_selection_from_loop (); void set_selection_from_audio_region (); + void add_location_mark (nframes64_t where); void add_location_from_audio_region (); void add_location_from_selection (); void set_loop_from_selection (bool play); void set_punch_from_selection (); + void set_loop_from_edit_range (bool play); + void set_punch_from_edit_range (); + void set_loop_range (nframes_t start, nframes_t end, std::string cmd); void set_punch_range (nframes_t start, nframes_t end, std::string cmd); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 074cf89911..001ee5be62 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -103,23 +103,28 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "playhead-to-previous-region-sync", _("Playhead to Previous Region Sync"), bind (mem_fun(*this, &Editor::cursor_to_previous_region_point), playhead_cursor, RegionPoint (SyncPoint))); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-start", _("to Next Region Start"), bind (mem_fun(*this, &Editor::edit_point_to_next_region_point), RegionPoint (Start))); + act = ActionManager::register_action (editor_actions, "selected-marker-to-next-region-boundary", _("to Next Region Boundary"), mem_fun(*this, &Editor::selected_marker_to_next_region_boundary)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-end", _("to Next Region End"), bind (mem_fun(*this, &Editor::edit_point_to_next_region_point), RegionPoint (End))); + act = ActionManager::register_action (editor_actions, "selected-marker-to-previous-region-boundary", _("to Previous Region Boundary"), mem_fun(*this, &Editor::selected_marker_to_previous_region_boundary)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-sync", _("to Next Region Sync"), bind (mem_fun(*this, &Editor::edit_point_to_next_region_point), RegionPoint (SyncPoint))); + + act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-start", _("to Next Region Start"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (Start))); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-end", _("to Next Region End"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (End))); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-next-region-sync", _("to Next Region Sync"), bind (mem_fun(*this, &Editor::selected_marker_to_next_region_point), RegionPoint (SyncPoint))); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-start", _("to Previous Region Start"), bind (mem_fun(*this, &Editor::edit_point_to_previous_region_point), RegionPoint (Start))); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-start", _("to Previous Region Start"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (Start))); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-end", _("to Previous Region End"), bind (mem_fun(*this, &Editor::edit_point_to_previous_region_point), RegionPoint (End))); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-end", _("to Previous Region End"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (End))); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-sync", _("to Previous Region Sync"), bind (mem_fun(*this, &Editor::edit_point_to_previous_region_point), RegionPoint (SyncPoint))); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-previous-region-sync", _("to Previous Region Sync"), bind (mem_fun(*this, &Editor::selected_marker_to_previous_region_point), RegionPoint (SyncPoint))); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("to Range Start"), mem_fun(*this, &Editor::edit_point_to_selection_start)); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-start", _("to Range Start"), mem_fun(*this, &Editor::selected_marker_to_selection_start)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("to Range End"), mem_fun(*this, &Editor::edit_point_to_selection_end)); + act = ActionManager::register_action (editor_actions, "edit-cursor-to-range-end", _("to Range End"), mem_fun(*this, &Editor::selected_marker_to_selection_end)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "playhead-to-range-start", _("Playhead to Range Start"), bind (mem_fun(*this, &Editor::cursor_to_selection_start), playhead_cursor)); @@ -218,9 +223,9 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead)); + act = ActionManager::register_action (editor_actions, "center-playhead", _("to Center"), mem_fun(*this, &Editor::center_playhead)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Edit Point"), mem_fun(*this, &Editor::center_edit_point)); + act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("to Center"), mem_fun(*this, &Editor::center_edit_point)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));; @@ -228,14 +233,14 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead to Edit"), bind (mem_fun(*this, &Editor::cursor_align), true)); + act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("to Edit"), bind (mem_fun(*this, &Editor::cursor_align), true)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Edit to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false)); + act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "trim-front", _("Trim front at edit point"), mem_fun(*this, &Editor::trim_region_front)); + act = ActionManager::register_action (editor_actions, "trim-front", _("Trim start at edit point"), mem_fun(*this, &Editor::trim_region_front)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "trim-back", _("Trim back at edit point"), mem_fun(*this, &Editor::trim_region_back)); + act = ActionManager::register_action (editor_actions, "trim-back", _("Trim end at edit point"), mem_fun(*this, &Editor::trim_region_back)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to edit point"), mem_fun(*this, &Editor::trim_region_from_edit_point)); @@ -246,6 +251,12 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-region-to-punch", _("Trim To Punch"), mem_fun(*this, &Editor::trim_region_to_punch)); ActionManager::session_sensitive_actions.push_back (act); + + act = ActionManager::register_action (editor_actions, "set-loop-from-edit-range", _("Set Loop From Edit Range"), bind (mem_fun(*this, &Editor::set_loop_from_edit_range), false)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "set-punch-from-edit-range", _("Set Punch From Edit Range"), mem_fun(*this, &Editor::set_punch_from_edit_range)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index ec7b22c104..4cd328821e 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -33,37 +33,6 @@ using namespace ARDOUR; using namespace PBD; void -Editor::set_loop_from_selection (bool play) -{ - if (session == 0 || selection->time.empty()) { - return; - } - - nframes_t start = selection->time[clicked_selection].start; - nframes_t end = selection->time[clicked_selection].end; - - set_loop_range (start, end, _("set loop range from selection")); - - if (play) { - session->request_play_loop (true); - session->request_locate (start, true); - } -} - -void -Editor::set_punch_from_selection () -{ - if (session == 0 || selection->time.empty()) { - return; - } - - nframes_t start = selection->time[clicked_selection].start; - nframes_t end = selection->time[clicked_selection].end; - - set_punch_range (start, end, _("set punch range from selection")); -} - -void Editor::set_show_waveforms (bool yn) { AudioTimeAxisView* atv; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 016dfdaeb9..7fa22a5bcb 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -730,6 +730,7 @@ Editor::cursor_to_region_boundary (Cursor* cursor, int32_t dir) return; } + if (cursor == playhead_cursor) { session->request_locate (target); } else { @@ -887,7 +888,68 @@ Editor::cursor_to_selection_end (Cursor *cursor) } void -Editor::edit_point_to_region_point (RegionPoint point, int32_t dir) +Editor::selected_marker_to_region_boundary (int32_t dir) +{ + nframes64_t target; + Location* loc; + bool ignored; + + if (!session) { + return; + } + + if (selection->markers.empty()) { + nframes64_t mouse; + bool ignored; + + if (!mouse_frame (mouse, ignored)) { + return; + } + + add_location_mark (mouse); + } + + if ((loc = find_location_from_marker (selection->markers.front(), ignored)) == 0) { + return; + } + + nframes64_t pos = loc->start(); + + // so we don't find the current region again.. + if (dir > 0 || pos > 0) { + pos += dir; + } + + if (!selection->tracks.empty()) { + + target = find_next_region_boundary (pos, dir, selection->tracks); + + } else { + + target = find_next_region_boundary (pos, dir, track_views); + } + + if (target < 0) { + return; + } + + loc->move_to (target); +} + +void +Editor::selected_marker_to_next_region_boundary () +{ + selected_marker_to_region_boundary (1); +} + +void +Editor::selected_marker_to_previous_region_boundary () +{ + selected_marker_to_region_boundary (-1); +} + +void +Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir) { boost::shared_ptr<Region> r; nframes_t pos; @@ -959,19 +1021,19 @@ Editor::edit_point_to_region_point (RegionPoint point, int32_t dir) } void -Editor::edit_point_to_next_region_point (RegionPoint point) +Editor::selected_marker_to_next_region_point (RegionPoint point) { - edit_point_to_region_point (point, 1); + selected_marker_to_region_point (point, 1); } void -Editor::edit_point_to_previous_region_point (RegionPoint point) +Editor::selected_marker_to_previous_region_point (RegionPoint point) { - edit_point_to_region_point (point, -1); + selected_marker_to_region_point (point, -1); } void -Editor::edit_point_to_selection_start () +Editor::selected_marker_to_selection_start () { nframes_t pos = 0; Location* loc; @@ -1006,7 +1068,7 @@ Editor::edit_point_to_selection_start () } void -Editor::edit_point_to_selection_end () +Editor::selected_marker_to_selection_end () { nframes_t pos = 0; Location* loc; @@ -1595,12 +1657,10 @@ Editor::add_location_from_selection () } void -Editor::add_location_from_playhead_cursor () +Editor::add_location_mark (nframes64_t where) { string markername; - nframes_t where = session->audible_frame(); - select_new_marker = true; session->locations()->next_available_name(markername,"mark"); @@ -1614,6 +1674,12 @@ Editor::add_location_from_playhead_cursor () } void +Editor::add_location_from_playhead_cursor () +{ + add_location_mark (session->audible_frame()); +} + +void Editor::add_location_from_audio_region () { if (selection->regions.empty()) { @@ -3224,7 +3290,7 @@ Editor::cut_copy (CutCopyOp op) cerr << "no edit op range" << endl; return; } - selection->set (0, start, end); + selection->set ((TimeAxisView*) 0, start, end); } begin_reversible_command (opname + _(" range")); @@ -4372,3 +4438,74 @@ Editor::select_prev_route() } } } + +void +Editor::set_loop_from_selection (bool play) +{ + if (session == 0 || selection->time.empty()) { + return; + } + + nframes_t start = selection->time[clicked_selection].start; + nframes_t end = selection->time[clicked_selection].end; + + set_loop_range (start, end, _("set loop range from selection")); + + if (play) { + session->request_play_loop (true); + session->request_locate (start, true); + } +} + +void +Editor::set_loop_from_edit_range (bool play) +{ + if (session == 0) { + return; + } + + nframes64_t start; + nframes64_t end; + + if (!get_edit_op_range (start, end)) { + return; + } + + set_loop_range (start, end, _("set loop range from edit range")); + + if (play) { + session->request_play_loop (true); + session->request_locate (start, true); + } +} + +void +Editor::set_punch_from_selection () +{ + if (session == 0 || selection->time.empty()) { + return; + } + + nframes_t start = selection->time[clicked_selection].start; + nframes_t end = selection->time[clicked_selection].end; + + set_punch_range (start, end, _("set punch range from selection")); +} + +void +Editor::set_punch_from_edit_range () +{ + if (session == 0) { + return; + } + + nframes64_t start; + nframes64_t end; + + if (!get_edit_op_range (start, end)) { + return; + } + + set_punch_range (start, end, _("set punch range from edit range")); +} + diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 25c2206405..61a128e618 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -576,13 +576,13 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr<Region> regi selection->toggle (all_equivalent_regions); break; case Selection::Set: - selection->set (all_equivalent_regions); + selection->set (all_equivalent_regions, false); break; case Selection::Extend: - selection->add (all_equivalent_regions); + selection->add (all_equivalent_regions, false); break; case Selection::Add: - selection->add (all_equivalent_regions); + selection->add (all_equivalent_regions, false); break; } } @@ -1050,7 +1050,7 @@ Editor::select_range_between () } set_mouse_mode (MouseRange); - selection->set (0, start, end); + selection->set ((TimeAxisView*) 0, start, end); } bool diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 80c651d548..66ce63219c 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -709,7 +709,7 @@ GainMeter::meter_press(GdkEventButton* ev) if (ev->button == 2) { - // ctrl-button2 click is the midi binding click + // Primary-button2 click is the midi binding click // button2-click is "momentary" if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier))) { @@ -722,7 +722,7 @@ GainMeter::meter_press(GdkEventButton* ev) if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { - /* ctrl-shift-click applies change to all routes */ + /* Primary+Tertiary-click applies change to all routes */ _session.begin_reversible_command (_("meter point change")); Session::GlobalMeteringStateCommand *cmd = new Session::GlobalMeteringStateCommand (_session, this); @@ -734,8 +734,8 @@ GainMeter::meter_press(GdkEventButton* ev) } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - /* ctrl-click: solo mix group. - ctrl-button2 is MIDI learn. + /* Primary-click: solo mix group. + NOTE: Primary-button2 is MIDI learn. */ if (ev->button == 1) { diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 7006f03467..d10e832e2b 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -137,7 +137,7 @@ RouteUI::mute_press(GdkEventButton* ev) } else { if (ev->button == 2) { - // ctrl-button2 click is the midi binding click + // Primary-button2 click is the midi binding click // button2-click is "momentary" if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier))) { @@ -151,7 +151,7 @@ RouteUI::mute_press(GdkEventButton* ev) if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { - /* ctrl-shift-click applies change to all routes */ + /* Primary-Tertiary-click applies change to all routes */ _session.begin_reversible_command (_("mute change")); Session::GlobalMuteStateCommand *cmd = new Session::GlobalMuteStateCommand(_session, this); @@ -162,8 +162,8 @@ RouteUI::mute_press(GdkEventButton* ev) } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - /* ctrl-click applies change to the mix group. - ctrl-button2 is MIDI learn. + /* Primary-button1 applies change to the mix group. + NOTE: Primary-button2 is MIDI learn. */ if (ev->button == 1) { @@ -215,7 +215,7 @@ RouteUI::solo_press(GdkEventButton* ev) if (ev->button == 2) { - // ctrl-button2 click is the midi binding click + // Primary-button2 click is the midi binding click // button2-click is "momentary" if (!Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier))) { @@ -229,7 +229,7 @@ RouteUI::solo_press(GdkEventButton* ev) if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { - /* ctrl-shift-click applies change to all routes */ + /* Primary-Tertiary-click applies change to all routes */ _session.begin_reversible_command (_("solo change")); Session::GlobalSoloStateCommand *cmd = new Session::GlobalSoloStateCommand(_session, this); @@ -240,7 +240,7 @@ RouteUI::solo_press(GdkEventButton* ev) } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) { - // ctrl-alt-click: exclusively solo this track, not a toggle */ + // Primary-Secondary-click: exclusively solo this track, not a toggle */ _session.begin_reversible_command (_("solo change")); Session::GlobalSoloStateCommand *cmd = new Session::GlobalSoloStateCommand (_session, this); @@ -259,8 +259,8 @@ RouteUI::solo_press(GdkEventButton* ev) } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - /* ctrl-click: solo mix group. - ctrl-button2 is MIDI learn. + /* Primary-button1: solo mix group. + NOTE: Primary-button2 is MIDI learn. */ if (ev->button == 1) { diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 2091cae5fa..d794c0013b 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -338,24 +338,26 @@ Selection::add (const RegionSelection& rs) } void -Selection::add (RegionView* r) +Selection::add (RegionView* r, bool with_track) { if (find (regions.begin(), regions.end(), r) == regions.end()) { regions.add (r); - add (&r->get_trackview()); + if (with_track) { + add (&r->get_trackview()); + } RegionsChanged (); } } void -Selection::add (vector<RegionView*>& v) +Selection::add (vector<RegionView*>& v, bool with_track) { bool changed = false; for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) { if (find (regions.begin(), regions.end(), (*i)) == regions.end()) { changed = regions.add ((*i)); - if (changed) { + if (with_track && changed) { add (&(*i)->get_trackview()); } } @@ -570,23 +572,25 @@ Selection::set (const RegionSelection& rs) } void -Selection::set (RegionView* r, bool also_clear_tracks) +Selection::set (RegionView* r, bool also_clear_tracks, bool with_track) { clear_regions (); if (also_clear_tracks) { clear_tracks (); } - add (r); + add (r, with_track); } void -Selection::set (vector<RegionView*>& v) +Selection::set (vector<RegionView*>& v, bool with_track) { - clear_tracks (); clear_regions (); - // make sure to deselect any automation selections - clear_points(); - add (v); + if (with_track) { + clear_tracks (); + // make sure to deselect any automation selections + clear_points(); + } + add (v, with_track); } long diff --git a/gtk2_ardour/selection.h b/gtk2_ardour/selection.h index 4698544d9a..b20567ca7e 100644 --- a/gtk2_ardour/selection.h +++ b/gtk2_ardour/selection.h @@ -100,8 +100,8 @@ class Selection : public sigc::trackable void set (TimeAxisView*); void set (const std::list<TimeAxisView*>&); - void set (RegionView*, bool also_clear_tracks = true); - void set (std::vector<RegionView*>&); + void set (RegionView*, bool also_clear_tracks = true, bool with_track = true); + void set (std::vector<RegionView*>&, bool with_track = true); long set (TimeAxisView*, nframes_t, nframes_t); void set (ARDOUR::AutomationList*); void set (boost::shared_ptr<ARDOUR::Playlist>); @@ -125,8 +125,8 @@ class Selection : public sigc::trackable void add (TimeAxisView*); void add (const std::list<TimeAxisView*>&); - void add (RegionView*); - void add (std::vector<RegionView*>&); + void add (RegionView*, bool with_track = true); + void add (std::vector<RegionView*>&, bool with_track = true); long add (nframes_t, nframes_t); void add (ARDOUR::AutomationList*); void add (boost::shared_ptr<ARDOUR::Playlist>); |