diff options
author | David Robillard <d@drobilla.net> | 2008-02-19 22:10:27 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-19 22:10:27 +0000 |
commit | a2a6cc0404757f445bd753d69f34d8bc2c0e87a9 (patch) | |
tree | 5d42f3dc23fa38679de1946d76ff0aa98845bc39 /gtk2_ardour | |
parent | 4cbd7f0eabfb9221444776bc6ea2dfe3a53cf873 (diff) |
Merge with 2.0-ongoing R3082.
Superficial generification of export stuff.
git-svn-id: svn://localhost/ardour2/branches/3.0@3088 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/SAE-de.bindings.in | 37 | ||||
-rw-r--r-- | gtk2_ardour/actions.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/ardour-sae.menus | 390 | ||||
-rw-r--r-- | gtk2_ardour/ardour.menus | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 20 | ||||
-rw-r--r-- | gtk2_ardour/audio_region_view.cc | 12 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 122 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 6 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 182 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 44 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 21 | ||||
-rw-r--r-- | gtk2_ardour/export_dialog.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/export_dialog.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/export_range_markers_dialog.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/export_range_markers_dialog.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/export_region_dialog.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/export_region_dialog.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/export_session_dialog.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/export_session_dialog.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 2 |
20 files changed, 578 insertions, 300 deletions
diff --git a/gtk2_ardour/SAE-de.bindings.in b/gtk2_ardour/SAE-de.bindings.in index e0758e5c04..a1dedef2f9 100644 --- a/gtk2_ardour/SAE-de.bindings.in +++ b/gtk2_ardour/SAE-de.bindings.in @@ -7,7 +7,7 @@ (gtk_accel_path "<Actions>/Transport/ToggleRoll" "space") (gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>space") -(gtk_accel_path "<Actions>/Transport/record-roll" "<%TERTIARY%>space") +(gtk_accel_path "<Actions>/Transport/record-roll" "<%PRIMARY%>space") (gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less") (gtk_accel_path "<Actions>/Editor/align-regions-end-relative" "<%PRIMARY%>less") @@ -43,17 +43,18 @@ ;; note that ctrl-w is special and consumed by the keyboard snooper -(gtk_accel_path "<Actions>/Editor/audition-at-mouse" "w") +(gtk_accel_path "<Actions>/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space") +(gtk_accel_path "<Actions>/Editor/play-edit-range" "<%SECONDARY%>space") +(gtk_accel_path "<Actions>/Editor/play-selected-regions" "s") (gtk_accel_path "<Actions>/Main/Close" "<%PRIMARY%>w") (gtk_accel_path "<Actions>/Editor/set-fade-out-length" "e") (gtk_accel_path "<Actions>/Main/ExportSession" "<%PRIMARY%>e") (gtk_accel_path "<Actions>/Editor/select-all-before-edit-cursor" "<%PRIMARY%>e") (gtk_accel_path "<Actions>/Editor/toggle-fade-out-active" "<%SECONDARY%>e") (gtk_accel_path "<Actions>/Editor/show-editor-mixer" "<%TERTIARY%>e") -(gtk_accel_path "<Actions>/Common/goto-editor" "<%WINDOW%>e") +; (gtk_accel_path "<Actions>/Common/goto-editor" "<%SECONDARY%>e") (gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<%TERTIARY%><%PRIMARY%>e") -(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-range" "r") -(gtk_accel_path "<Actions>/Editor/redo" "<%PRIMARY%>r") +(gtk_accel_path "<Actions>/Editor/redo" "<%PRIMARY%><%TERTIARY%>z") (gtk_accel_path "<Actions>/Transport/Record" "<%TERTIARY%>r") (gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "r") (gtk_accel_path "<Actions>/Editor/temporal-zoom-in" "t") @@ -62,28 +63,28 @@ (gtk_accel_path "<Actions>/Editor/insert-region" "i") (gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "<%PRIMARY%>i") (gtk_accel_path "<Actions>/Editor/invert-selection" "<%TERTIARY%>i") -(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%WINDOW%>o") +(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%SECONDARY%>o") (gtk_accel_path "<Actions>/Main/Open" "<%PRIMARY%>o") (gtk_accel_path "<Actions>/Main/Recent" "<%PRIMARY%><%TERTIARY%>o") -(gtk_accel_path "<Actions>/Editor/set-playhead" "p") +(gtk_accel_path "<Actions>/Editor/set-playhead" "w") (gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<%TERTIARY%>p") ;; MITTELZEILE (gtk_accel_path "<Actions>/Editor/trim-front" "a") (gtk_accel_path "<Actions>/Editor/select-all" "<%PRIMARY%>a") -(gtk_accel_path "<Actions>/Editor/trim-back" "s") +(gtk_accel_path "<Actions>/Editor/trim-back" "d") (gtk_accel_path "<Actions>/Common/Save" "<%PRIMARY%>s") (gtk_accel_path "<Actions>/Main/Snapshot" "<%PRIMARY%><%TERTIARY%>s") -(gtk_accel_path "<Actions>/Editor/duplicate-region" "d") -(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%SECONDARY%>d") +(gtk_accel_path "<Actions>/Editor/duplicate-region" "<%PRIMARY%>d") +(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%PRIMARY%><%TERTIARY%>d") (gtk_accel_path "<Actions>/Editor/toggle-follow-playhead" "f") -(gtk_accel_path "<Actions>/Editor/set-edit-point" "g") -(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g") +; (gtk_accel_path "<Actions>/Editor/set-edit-point" "g") +; (gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g") (gtk_accel_path "<Actions>/Editor/nudge-backward" "g") (gtk_accel_path "<Actions>/Editor/nudge-forward" "h") -(gtk_accel_path "<Actions>/Common/ToggleKeyEditor" "<%WINDOW%>k") -(gtk_accel_path "<Actions>/Common/ToggleLocations" "<%WINDOW%>l") +(gtk_accel_path "<Actions>/Common/ToggleKeyEditor" "<%SECONDARY%>k") +(gtk_accel_path "<Actions>/Common/ToggleLocations" "<%SECONDARY%>l") (gtk_accel_path "<Actions>/Transport/Loop" "l") (gtk_accel_path "<Actions>/Editor/select-all-in-loop-range" "<%TERTIARY%>l") @@ -97,14 +98,14 @@ (gtk_accel_path "<Actions>/Editor/editor-cut" "<%PRIMARY%>x") (gtk_accel_path "<Actions>/Editor/crop" "c") (gtk_accel_path "<Actions>/Editor/editor-copy" "<%PRIMARY%>c") -(gtk_accel_path "<Actions>/Common/ToggleColorManager" "<%WINDOW%>c") +(gtk_accel_path "<Actions>/Common/ToggleColorManager" "<%SECONDARY%>c") (gtk_accel_path "<Actions>/Editor/editor-paste" "<%PRIMARY%>v") -(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<%WINDOW%>b") +(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<%SECONDARY%>b") (gtk_accel_path "<Actions>/Editor/normalize-region" "n") (gtk_accel_path "<Actions>/Main/New" "<%PRIMARY%>n") (gtk_accel_path "<Actions>/Main/AddTrackBus" "<%PRIMARY%><%TERTIARY%>n") -(gtk_accel_path "<Actions>/Common/goto-mixer" "<%WINDOW%>m") -(gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "m") +(gtk_accel_path "<Actions>/Common/goto-mixer" "<%SECONDARY%>m") +(gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "KP_Enter") (gtk_accel_path "<Actions>/Editor/mute-unmute-region" "<%SECONDARY%>m") ;; arrow keys, navigation etc. diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc index 1484c01454..a383371c98 100644 --- a/gtk2_ardour/actions.cc +++ b/gtk2_ardour/actions.cc @@ -80,7 +80,8 @@ ActionManager::init () ui_manager->add_ui_from_file (ui_file.to_string()); loaded = true; } catch (Glib::MarkupError& err) { - error << _("badly formatted UI definition file") << endmsg; + error << string_compose (_("badly formatted UI definition file: %1"), err.what()) << endmsg; + cerr << string_compose (_("badly formatted UI definition file: %1"), err.what()) << endl; } catch (...) { error << _("Ardour menu definition file not found") << endmsg; } diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus index 16f00955f3..e8b8a20b5e 100644 --- a/gtk2_ardour/ardour-sae.menus +++ b/gtk2_ardour/ardour-sae.menus @@ -1,12 +1,11 @@ <ui> - <menubar name='Main' action='MainMenu'> + <menu name='Session' action='Session'> <menuitem action='New'/> <menuitem action='Open'/> <menuitem action='Recent'/> <menuitem action='Close'/> - <menuitem action='Quit'/> <separator/> <menuitem action='Save'/> <menuitem action='Snapshot'/> @@ -18,6 +17,7 @@ <menuitem action='addExistingAudioFiles'/> <separator/> <menuitem action='ExportSession'/> + <menuitem action='export-region'/> </menu> <separator/> @@ -28,43 +28,78 @@ <menuitem action='ToggleOptionsEditor'/> <menuitem action='About'/> </menu> + <menu name='Transport' action='Transport'> <menuitem action='ToggleRoll'/> - <menuitem action='play-from-edit-point-and-return'/> - <menuitem action='play-edit-range'/> + <menu action="PlayMenu"> + <menuitem action='play-selected-regions'/> + <menuitem action='play-edit-range'/> + <menuitem action='play-from-edit-point-and-return'/> + <menuitem action='Loop'/> + </menu> <menuitem action='record-roll'/> + <menuitem action='Record'/> <menuitem action='ToggleRollForgetCapture'/> - <menuitem action='Loop'/> - <menuitem action='loop-region'/> - <menuitem action='set-playhead'/> + <menuitem action='remove-last-capture'/> + <menu action="SetLoopMenu"> + <menuitem action='set-loop-from-edit-range'/> + <menuitem action='set-loop-from-region'/> + </menu> + <menu action="SetPunchMenu"> + <menuitem action='set-punch-from-edit-range'/> + <menuitem action='set-punch-from-region'/> + </menu> + <menuitem action='Forward'/> <menuitem action='Rewind'/> - <menuitem action='GotoZero'/> - <menuitem action='GotoStart'/> - <menuitem action='GotoEnd'/> - <separator/> - <menuitem action='tab-to-transient-forwards'/> - <menuitem action='tab-to-transient-backwards'/> - <menuitem action='nudge-playhead-forward'/> - <menuitem action='nudge-playhead-backward'/> - <separator/> - <menuitem action='Record'/> - <separator/> <menuitem action='TransitionToRoll'/> <menuitem action='TransitionToReverse'/> - <separator/> - <menuitem action='jump-forward-to-mark'/> - <menuitem action='jump-backward-to-mark'/> - <menuitem action='add-location-from-playhead'/> - <separator/> - <menuitem action='playhead-to-next-region-boundary'/> - <menuitem action='playhead-to-previous-region-boundary'/> - <menuitem action='playhead-to-next-region-sync'/> - <menuitem action='playhead-to-previous-region-sync'/> - <menuitem action='center-playhead'/> - <separator/> + <menuitem action='center-playhead'/> + <menuitem action='set-playhead'/> <menuitem action='playhead-to-edit'/> - <menuitem action='focus-on-clock'/> + <menuitem action='nudge-playhead-forward'/> + <menuitem action='nudge-playhead-backward'/> + + <menu action="MovePlayHeadMenu"> + <menuitem action='tab-to-transient-forwards'/> + <menuitem action='tab-to-transient-backwards'/> + <separator/> + <menuitem action='playhead-forward-to-grid'/> + <menuitem action='playhead-backward-to-grid'/> + <separator/> + <menuitem action='playhead-to-next-region-boundary'/> + <menuitem action='playhead-to-previous-region-boundary'/> + <menuitem action='playhead-to-next-region-sync'/> + <menuitem action='playhead-to-previous-region-sync'/> + <separator/> + <menuitem action='jump-forward-to-mark'/> + <menuitem action='jump-backward-to-mark'/> + </menu> + + <menu action="MoveActiveMarkMenu"> + <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'/> + <separator/> + <menuitem action='edit-to-playhead'/> + <menuitem action='set-edit-point'/> + </menu> + + <menu action="MarkerMenu"> + <menuitem action='add-location-from-playhead'/> + <separator/> + <menuitem action='goto-mark-1'/> + <menuitem action='goto-mark-2'/> + <menuitem action='goto-mark-3'/> + <menuitem action='goto-mark-4'/> + <menuitem action='goto-mark-5'/> + <menuitem action='goto-mark-6'/> + <menuitem action='goto-mark-7'/> + <menuitem action='goto-mark-8'/> + <menuitem action='goto-mark-9'/> + </menu> + <separator/> <menuitem action='TogglePunchIn'/> <menuitem action='TogglePunchOut'/> @@ -74,182 +109,191 @@ <menuitem action='ToggleClick'/> <menuitem action='toggle-follow-playhead'/> <separator/> - <menuitem action='set-loop-from-edit-range'/> - <menuitem action='set-loop-from-region'/> - <menuitem action='set-punch-from-edit-range'/> - <menuitem action='set-punch-from-region'/> <menu action='LocateToMarker'> - <menuitem action='goto-mark-1'/> - <menuitem action='goto-mark-2'/> - <menuitem action='goto-mark-3'/> - <menuitem action='goto-mark-4'/> - <menuitem action='goto-mark-5'/> - <menuitem action='goto-mark-6'/> - <menuitem action='goto-mark-7'/> - <menuitem action='goto-mark-8'/> - <menuitem action='goto-mark-9'/> </menu> </menu> - <menu name='Edit' action='Edit'> + + <menu action='Edit'> <menuitem action='undo'/> <menuitem action='redo'/> <menuitem action='editor-cut'/> - <menuitem action='editor-delete'/> <menuitem action='editor-copy'/> <menuitem action='editor-paste'/> - <menuitem action='set-edit-point'/> - <menuitem action='editor-separate'/> <separator/> - <menuitem action='remove-last-capture'/> + <menuitem action='editor-delete'/> + <menuitem action='split-region'/> + <menu action="SeparateMenu"> + <menuitem action='editor-separate'/> + <menuitem action='separate-from-loop'/> + <menuitem action='separate-from-punch'/> + </menu> <separator/> - <menuitem action='select-all'/> - <menuitem action='deselect-all'/> - <menuitem action='invert-selection'/> - <menuitem action='select-all-after-edit-cursor'/> - <menuitem action='select-all-before-edit-cursor'/> - <menuitem action='select-all-between-cursors'/> - <menuitem action='select-all-within-cursors'/> - <menuitem action='select-all-in-punch-range'/> - <menuitem action='select-all-in-loop-range'/> - <separator/> - <menuitem action='select-next-route'/> - <menuitem action='select-prev-route'/> - <separator/> - <menu action='EditCursorMovementOptions'> - <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'/> - </menu> - <menu name='KeyMouse Actions' action='KeyMouse Actions'> - <menuitem action='play-selected-regions'/> - <menuitem action='brush-at-mouse'/> - <menuitem action='mute-unmute-region'/> - <separator/> - <menuitem action='set-mouse-mode-object'/> - <menuitem action='set-mouse-mode-range'/> - <menuitem action='set-mouse-mode-gain'/> - <menuitem action='set-mouse-mode-zoom'/> - <menuitem action='set-mouse-mode-timefx'/> - <separator/> - <menuitem action='cycle-edit-point'/> - <menuitem action='cycle-edit-point-with-marker'/> - <menuitem action='toggle-edit-mode'/> - <separator/> - <menuitem action='boost-region-gain'/> - <menuitem action='cut-region-gain'/> - </menu> - </menu> - <menu name='Regions' action='Regions'> - <menuitem action='crop'/> - <menuitem action='duplicate-region'/> - <menuitem action='insert-region'/> - <menuitem action='normalize-region'/> - <menuitem action='split-region-at-transients'/> - <separator/> - <menuitem action="nudge-forward"/> - <menuitem action="nudge-backward"/> - <menuitem action='split-region'/> - <menuitem action='set-region-sync-position'/> - <separator/> + <menuitem action='duplicate-region'/> + <menuitem action='multi-duplicate-region'/> + <menuitem action='region-fill-track'/> + <menu action="AlignMenu"> <menuitem action='align-regions-start'/> <menuitem action='align-regions-start-relative'/> <menuitem action='align-regions-end'/> <menuitem action='align-regions-end-relative'/> <menuitem action='align-regions-sync'/> <menuitem action='align-regions-sync-relative'/> - <separator/> - <menuitem action='set-fade-in-length'/> - <menuitem action='toggle-fade-in-active'/> - <menuitem action='set-fade-out-length'/> - <menuitem action='toggle-fade-out-active'/> - <separator/> + </menu> + <menu action="NudgeRegionMenu"> + <menuitem action="nudge-forward"/> + <menuitem action="nudge-backward"/> + </menu> + <menu action="TrimMenu"> <menuitem action='trim-front'/> <menuitem action='trim-back'/> + <menuitem action='crop'/> <menuitem action='trim-region-to-loop'/> <menuitem action='trim-region-to-punch'/> - <separator/> - <menuitem action='pitch-shift-region'/> - <menuitem action='set-tempo-from-region'/> - <menuitem action='set-tempo-from-edit-range'/> - </menu> + </menu> + <menu action="FadeMenu"> + <menuitem action='set-fade-in-length'/> + <menuitem action='toggle-fade-in-active'/> + <menuitem action='set-fade-out-length'/> + <menuitem action='toggle-fade-out-active'/> + </menu> + <menu action="SelectMenu"> + <menuitem action='select-all'/> + <menuitem action='deselect-all'/> + <menuitem action='invert-selection'/> + <menuitem action='select-all-after-edit-cursor'/> + <menuitem action='select-all-before-edit-cursor'/> + <menuitem action='select-all-between-cursors'/> + <menuitem action='select-all-within-cursors'/> + <menuitem action='select-all-in-punch-range'/> + <menuitem action='select-all-in-loop-range'/> + </menu> + </menu> + + <menu name='Regions' action='Regions'> + <menuitem action='insert-region'/> + <menuitem action='rename-region'/> + <menuitem action='auto-rename-region'/> + <menuitem action='raise-region'/> + <menuitem action='lower-region'/> + <menuitem action='naturalize-region'/> + <menuitem action='lock-region'/> + <menuitem action='set-region-sync-position'/> + <menuitem action='remove-region-sync'/> + <menuitem action='mute-unmute-region'/> + <separator/> + <menuitem action='monoize-region'/> + <menuitem action='normalize-region'/> + <menuitem action='split-region-at-transients'/> + <separator/> + <menu action="RegionGainMenu"> + <menuitem action='boost-region-gain'/> + <menuitem action='cut-region-gain'/> + </menu> + <menuitem action='pitch-shift-region'/> + <menuitem action='reverse-region'/> + </menu> + <menu name='View' action = 'View'> <menuitem action='ToggleMaximalEditor'/> + <menuitem action='show-editor-mixer'/> + <menuitem action='ToggleMeasureVisibility'/> + <menuitem action='ToggleLogoVisibility'/> + <menu action="PrimaryClockMenu"> + <menuitem action="primary-clock-bbt"/> + <menuitem action="primary-clock-minsec"/> + <menuitem action="primary-clock-samples"/> + <menuitem action="primary-clock-off"/> + </menu> + <menu action="SecondaryClockMenu"> + <menuitem action="secondary-clock-bbt"/> + <menuitem action="secondary-clock-minsec"/> + <menuitem action="secondary-clock-samples"/> + <menuitem action="secondary-clock-off"/> + </menu> + <menu action="RulerMenu"> + <menuitem action="toggle-bbt-ruler"/> + <menuitem action="toggle-minsec-ruler"/> + <menuitem action="toggle-samples-ruler"/> + <separator/> + <menuitem action="toggle-meter-ruler"/> + <menuitem action="toggle-tempo-ruler"/> + <menuitem action="toggle-range-ruler"/> + <menuitem action="toggle-cd-marker-ruler"/> + <menuitem action="toggle-loop-punch-ruler"/> + </menu> + <menu action="ZoomMenu"> + <menuitem action='temporal-zoom-in'/> + <menuitem action='temporal-zoom-out'/> + <menuitem action='zoom-to-session'/> + <menuitem action='zoom-to-region'/> + <menuitem action='toggle-zoom'/> + </menu> + <menu action="ScrollMenu"> + <menuitem action='scroll-tracks-down'/> + <menuitem action='scroll-tracks-up'/> + <menuitem action='scroll-forward'/> + <menuitem action='scroll-backward'/> + </menu> <separator/> - <menu name='ZoomFocus' action='ZoomFocus'> + <menu action="Windows"> + <menuitem action='goto-editor'/> + <menuitem action='goto-mixer'/> + <menuitem action='ToggleLocations'/> + <menuitem action='ToggleKeyEditor'/> + <menuitem action='ToggleThemeManager'/> + <menuitem action='ToggleBigClock'/> + <menuitem action='toggle-rhythm-ferret'/> + </menu> + </menu> + + <menu name='Options' action='Options'> + <menu action='Monitoring'> + <menuitem action='UseSoftwareMonitoring'/> + <menuitem action='UseExternalMonitoring'/> + </menu> + <menu action="TempoMenu"> + <menuitem action='set-tempo-from-region'/> + <menuitem action='set-tempo-from-edit-range'/> + </menu> + <menu action="LatchMenu"> + <menuitem action='LatchedSolo'/> + </menu> + <menu action="Link"> + <menuitem action='link-region-and-track-selection'/> + </menu> + <menu action='ZoomFocusMenu'> <menuitem action='zoom-focus-playhead'/> <menuitem action='zoom-focus-edit'/> <menuitem action='zoom-focus-mouse'/> </menu> - <menu name='SnapMode' action='SnapMode'> + <menu action="EditPointMenu"> + <menuitem action='edit-point-playhead'/> + <menuitem action='edit-point-mouse'/> + <menuitem action='edit-point-marker'/> + </menu> + <menu action='KeyMouseActions'> + <menuitem action='select-next-route'/> + <menuitem action='select-prev-route'/> + <menuitem action='focus-on-clock'/> + <menuitem action='GotoZero'/> + <menuitem action='GotoStart'/> + <menuitem action='GotoEnd'/> + <menuitem action='set-mouse-mode-object'/> + <menuitem action='set-mouse-mode-range'/> + <menuitem action='set-mouse-mode-gain'/> + <menuitem action='set-mouse-mode-zoom'/> + <menuitem action='set-mouse-mode-timefx'/> + <menuitem action='cycle-edit-point'/> + <menuitem action='cycle-edit-point-with-marker'/> + <menuitem action='toggle-edit-mode'/> <menuitem action='snap-off'/> <menuitem action='snap-normal'/> <menuitem action='snap-magnetic'/> - <separator/> <menuitem action='cycle-snap-mode'/> - </menu> - <menu name='SnapTo' action='SnapTo'> - <menuitem action='snap-to-cd-frame'/> - <menuitem action='snap-to-smpte-frame'/> - <menuitem action='snap-to-smpte-seconds'/> - <menuitem action='snap-to-smpte-minutes'/> - <menuitem action='snap-to-seconds'/> - <menuitem action='snap-to-minutes'/> - <menuitem action='snap-to-thirtyseconds'/> - <menuitem action='snap-to-asixteenthbeat'/> - <menuitem action='snap-to-eighths'/> - <menuitem action='snap-to-quarters'/> - <menuitem action='snap-to-thirds'/> - <menuitem action='snap-to-beat'/> - <menuitem action='snap-to-bar'/> - <menuitem action='snap-to-mark'/> - <menuitem action='snap-to-region-start'/> - <menuitem action='snap-to-region-end'/> - <menuitem action='snap-to-region-sync'/> - <menuitem action='snap-to-region-boundary'/> <menuitem action='cycle-snap-choice'/> </menu> - <separator/> - <menuitem action='temporal-zoom-in'/> - <menuitem action='temporal-zoom-out'/> - <menuitem action='zoom-to-session'/> - <menuitem action='zoom-to-region'/> - <menuitem action='toggle-zoom'/> - <menuitem action='scroll-tracks-down'/> - <menuitem action='scroll-tracks-up'/> - <menuitem action='scroll-tracks-down'/> - <menuitem action='step-tracks-up'/> - <menuitem action='step-tracks-down'/> - <separator/> - <menuitem action='scroll-forward'/> - <menuitem action='scroll-backward'/> - <separator/> - <menuitem action='scroll-playhead-forward'/> - <menuitem action='scroll-playhead-backward'/> - <separator/> - <menuitem action='show-editor-mixer'/> - <menuitem action='SyncEditorAndMixerTrackOrder'/> - <menuitem action='ToggleMeasureVisibility'/> - <menuitem action='ToggleLogoVisibility'/> - <separator/> - <menuitem action='goto-editor'/> - <menuitem action='goto-mixer'/> - <menuitem action='ToggleLocations'/> - <menuitem action='ToggleKeyEditor'/> - <menuitem action='ToggleThemeManager'/> - <menuitem action='ToggleBigClock'/> - <menuitem action='toggle-rhythm-ferret'/> - </menu> - <menu name='Options' action='Options'> - <menu action='Monitoring'> - <menuitem action='UseSoftwareMonitoring'/> - <menuitem action='UseExternalMonitoring'/> - </menu> - <menuitem action='LatchedSolo'/> - <menuitem action='link-region-and-track-selection'/> - </menu> + </menu> + </menubar> <popup name='redirectmenu'> diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index 73f65ef157..c333b03b61 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -123,7 +123,7 @@ </menu> <menuitem action='set-tempo-from-region'/> <menuitem action='set-tempo-from-edit-range'/> - <menu name='KeyMouse Actions' action='KeyMouse Actions'> + <menu action='KeyMouseActions'> <menuitem action='play-selected-regions'/> <menuitem action='brush-at-mouse'/> <menuitem action='set-edit-point'/> diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index c94fb1ba9d..d12165bbb7 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -92,7 +92,7 @@ ARDOUR_UI::install_actions () ActionManager::register_action (main_actions, X_("Options"), _("Options")); ActionManager::register_action (main_actions, X_("TransportOptions"), _("Options")); ActionManager::register_action (main_actions, X_("Help"), _("Help")); - ActionManager::register_action (main_actions, X_("KeyMouse Actions"), _("KeyMouse Actions")); + ActionManager::register_action (main_actions, X_("KeyMouseActions"), _("Misc. Shortcuts")); ActionManager::register_action (main_actions, X_("AudioFileFormat"), _("Audio File Format")); ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header")); ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Data")); @@ -310,6 +310,24 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); ActionManager::transport_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-bbt"), _("Bars & Beats"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::BBT)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-minsec"), _("Minutes & Seconds"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::MinSec)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-samples"), _("Samples"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Frames)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-off"), _("Off"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Off)); + ActionManager::session_sensitive_actions.push_back (act); + + act = ActionManager::register_action (transport_actions, X_("secondary-clock-bbt"), _("Bars & Beats"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::BBT)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("secondary-clock-minsec"), _("Minutes & Seconds"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::MinSec)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("secondary-clock-off"), _("Off"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Off)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunchIn"), _("Punch In"), mem_fun(*this, &ARDOUR_UI::toggle_punch_in)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::transport_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index c3e3b9a036..a98958f8a8 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -809,8 +809,8 @@ AudioRegionView::create_waves () ChanCount nchans = atv.get_diskstream()->n_channels(); - cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data - << " and channels = " << nchans.n_audio() << endl; + // cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data + // << " and channels = " << nchans.n_audio() << endl; /* in tmp_waves, set up null pointers for each channel so the vector is allocated */ for (uint32_t n = 0; n < nchans.n_audio(); ++n) { @@ -825,21 +825,21 @@ AudioRegionView::create_waves () wave_caches.push_back (WaveView::create_cache ()); - cerr << "\tchannel " << n << endl; + // cerr << "\tchannel " << n << endl; if (wait_for_data) { if (audio_region()->audio_source(n)->peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n), data_ready_connection)) { - cerr << "\tData is ready\n"; + // cerr << "\tData is ready\n"; cerr << "\tData is ready\n"; create_one_wave (n, true); } else { - cerr << "\tdata is not ready\n"; + // cerr << "\tdata is not ready\n"; // we'll get a PeaksReady signal from the source in the future // and will call create_one_wave(n) then. } } else { - cerr << "\tdon't delay, display today!\n"; + // cerr << "\tdon't delay, display today!\n"; create_one_wave (n, true); } diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4d05d5dac6..6330265dc6 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -153,7 +153,7 @@ static const gchar *_zoom_focus_strings[] = { N_("Center"), N_("Playhead"), N_("Mouse"), - N_("Edit Point"), + N_("Active Mark"), 0 }; @@ -1288,12 +1288,23 @@ Editor::connect_to_session (Session *t) no_route_list_redisplay = false; redisplay_route_list (); } + + switch (snap_type) { + case SnapToRegionStart: + case SnapToRegionEnd: + case SnapToRegionSync: + case SnapToRegionBoundary: + build_region_boundary_cache (); + break; - /* register for undo history */ + default: + break; + } + /* register for undo history */ session->register_with_memento_command_factory(_id, this); - start_updating (); + start_updating (); } void @@ -2163,19 +2174,17 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items) edit_items.push_back (MenuElem (_("Nudge"), *nudge_menu)); } -/* CURSOR SETTING AND MARKS AND STUFF */ - void Editor::set_snap_to (SnapType st) { - unsigned int snap_ind = (unsigned int)st; + unsigned int snap_ind = (unsigned int)st; snap_type = st; - - if ( snap_ind > snap_type_strings.size() - 1 ) { - snap_ind = 0; - snap_type = (SnapType)snap_ind; - } - + + if (snap_ind > snap_type_strings.size() - 1) { + snap_ind = 0; + snap_type = (SnapType)snap_ind; + } + string str = snap_type_strings[snap_ind]; if (str != snap_type_selector.get_active_text()) { @@ -2190,9 +2199,17 @@ Editor::set_snap_to (SnapType st) case SnapToAEighthBeat: case SnapToAQuarterBeat: case SnapToAThirdBeat: - compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit)); - update_tempo_based_rulers (); + compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit)); + update_tempo_based_rulers (); + break; + + case SnapToRegionStart: + case SnapToRegionEnd: + case SnapToRegionSync: + case SnapToRegionBoundary: + build_region_boundary_cache (); break; + default: /* relax */ break; @@ -2229,28 +2246,25 @@ Editor::set_edit_point_preference (EditPoint ep) return; } - if (Profile->get_sae()) { - - switch (zoom_focus) { - case ZoomFocusMouse: - case ZoomFocusPlayhead: - case ZoomFocusEdit: - switch (_edit_point) { - case EditAtMouse: - set_zoom_focus (ZoomFocusMouse); - break; - case EditAtPlayhead: - set_zoom_focus (ZoomFocusPlayhead); - break; - case EditAtSelectedMarker: - set_zoom_focus (ZoomFocusEdit); - break; - } + switch (zoom_focus) { + case ZoomFocusMouse: + case ZoomFocusPlayhead: + case ZoomFocusEdit: + switch (_edit_point) { + case EditAtMouse: + set_zoom_focus (ZoomFocusMouse); break; - default: + case EditAtPlayhead: + set_zoom_focus (ZoomFocusPlayhead); + break; + case EditAtSelectedMarker: + set_zoom_focus (ZoomFocusEdit); break; } - } + break; + default: + break; + } instant_save (); } @@ -2527,13 +2541,19 @@ Editor::trackview_by_y_position (double y) void Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) { - Location* before = 0; - Location* after = 0; - if (!session || snap_mode == SnapOff) { return; } + snap_to_internal (start, direction, for_mark); +} + +void +Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark) +{ + Location* before = 0; + Location* after = 0; + const nframes64_t one_second = session->frame_rate(); const nframes64_t one_minute = session->frame_rate() * 60; const nframes64_t one_smpte_second = (nframes64_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame()); @@ -2542,7 +2562,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) switch (snap_type) { case SnapToCDFrame: - if (direction) { + if (((direction == 0) && (start % (one_second/75) > (one_second/75) / 2)) || (direction > 0)) { start = (nframes_t) ceil ((double) start / (one_second / 75)) * (one_second / 75); } else { start = (nframes_t) floor ((double) start / (one_second / 75)) * (one_second / 75); @@ -2550,7 +2570,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) break; case SnapToSMPTEFrame: - if (fmod((double)start, (double)session->frames_per_smpte_frame()) > (session->frames_per_smpte_frame() / 2)) { + if (((direction == 0) && (fmod((double)start, (double)session->frames_per_smpte_frame()) > (session->frames_per_smpte_frame() / 2))) || (direction > 0)) { start = (nframes_t) (ceil ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame()); } else { start = (nframes_t) (floor ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame()); @@ -2564,7 +2584,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } else { start -= session->smpte_offset (); } - if (start % one_smpte_second > one_smpte_second / 2) { + if (((direction == 0) && (start % one_smpte_second > one_smpte_second / 2)) || direction > 0) { start = (nframes_t) ceil ((double) start / one_smpte_second) * one_smpte_second; } else { start = (nframes_t) floor ((double) start / one_smpte_second) * one_smpte_second; @@ -2585,7 +2605,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } else { start -= session->smpte_offset (); } - if (start % one_smpte_minute > one_smpte_minute / 2) { + if (((direction == 0) && (start % one_smpte_minute > one_smpte_minute / 2)) || direction > 0) { start = (nframes_t) ceil ((double) start / one_smpte_minute) * one_smpte_minute; } else { start = (nframes_t) floor ((double) start / one_smpte_minute) * one_smpte_minute; @@ -2599,7 +2619,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) break; case SnapToSeconds: - if (start % one_second > one_second / 2) { + if (((direction == 0) && (start % one_second > one_second / 2)) || (direction > 0)) { start = (nframes_t) ceil ((double) start / one_second) * one_second; } else { start = (nframes_t) floor ((double) start / one_second) * one_second; @@ -2607,7 +2627,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) break; case SnapToMinutes: - if (start % one_minute > one_minute / 2) { + if (((direction == 0) && (start % one_minute > one_minute / 2)) || (direction > 0)) { start = (nframes_t) ceil ((double) start / one_minute) * one_minute; } else { start = (nframes_t) floor ((double) start / one_minute) * one_minute; @@ -2696,11 +2716,19 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } if (i != region_boundary_cache.end()) { + + /* lower bound doesn't quite to the right thing for our purposes */ + + if (direction < 0 && i != region_boundary_cache.begin()) { + --i; + } + start = *i; + } else { start = region_boundary_cache.back(); } - } + } break; } @@ -3596,7 +3624,7 @@ Editor::zoom_focus_selection_done () focus_type = ZoomFocusPlayhead; } else if (choice == _("Edit")) { focus_type = ZoomFocusEdit; - } else if (choice == _("Edit Point")) { + } else if (choice == _("Active Mark")) { focus_type = ZoomFocusEdit; } else { focus_type = ZoomFocusMouse; @@ -4375,9 +4403,9 @@ Editor::idle_visual_changer () if (p & VisualChange::ZoomLevel) { set_frames_per_unit (pending_visual_change.frames_per_unit); - compute_fixed_ruler_scale (); - compute_current_bbt_points(pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); - compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); + compute_fixed_ruler_scale (); + compute_current_bbt_points(pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); + compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); update_tempo_based_rulers (); } if (p & VisualChange::TimeOrigin) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 1e0f47edfc..62d62a330f 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -189,6 +189,8 @@ class Editor : public PublicEditor void new_region_from_selection (); void separate_regions_between (const TimeSelection&); void separate_region_from_selection (); + void separate_region_from_punch (); + void separate_region_from_loop (); void separate_regions_using_location (ARDOUR::Location&); void toggle_playback (bool with_abort); void transition_to_rolling (bool forward); @@ -1188,6 +1190,8 @@ class Editor : public PublicEditor void center_edit_point (); void edit_cursor_backward (); void edit_cursor_forward (); + void playhead_forward_to_grid (); + void playhead_backward_to_grid (); void playhead_backward (); void playhead_forward (); void scroll_playhead (bool forward); @@ -2196,6 +2200,8 @@ public: void select_next_route (); void select_prev_route (); + void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false); + RhythmFerret* rhythm_ferret; }; diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 4d4ab99046..d6e4a5a214 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -44,26 +44,49 @@ Editor::register_actions () /* non-operative menu items for menu bar */ + ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align")); + ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect")); + ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades")); ActionManager::register_action (editor_actions, X_("Edit"), _("Edit")); - ActionManager::register_action (editor_actions, X_("Select"), _("Select")); - ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions")); - ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations")); ActionManager::register_action (editor_actions, X_("EditCursorMovementOptions"), _("Move Selected Marker")); - ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations")); - ActionManager::register_action (editor_actions, X_("Tools"), _("Tools")); - ActionManager::register_action (editor_actions, X_("View"), _("View")); - ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom Focus")); - ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold")); + ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations")); + ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions")); + ActionManager::register_action (editor_actions, X_("EditPointMenu"), _("Edit Point")); + ActionManager::register_action (editor_actions, X_("FadeMenu"), _("Fade")); + ActionManager::register_action (editor_actions, X_("LatchMenu"), _("Latch")); + ActionManager::register_action (editor_actions, X_("Layering"), _("Layering")); + ActionManager::register_action (editor_actions, X_("Link"), _("Link")); + ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate To Markers")); + ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers")); ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff")); - ActionManager::register_action (editor_actions, X_("Solo"), _("Solo")); - ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades")); + ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold")); ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring")); - ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect")); - ActionManager::register_action (editor_actions, X_("Layering"), _("Layering")); - ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps")); + ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark")); + ActionManager::register_action (editor_actions, X_("MovePlayHeadMenu"), _("Playhead")); + ActionManager::register_action (editor_actions, X_("NudgeRegionMenu"), _("Nudge")); + ActionManager::register_action (editor_actions, X_("PlayMenu"), _("Play")); + ActionManager::register_action (editor_actions, X_("PrimaryClockMenu"), _("Primary Clock")); ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown")); + ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations")); + ActionManager::register_action (editor_actions, X_("RegionGainMenu"), _("Gain")); + ActionManager::register_action (editor_actions, X_("RulerMenu"), _("Rulers")); + ActionManager::register_action (editor_actions, X_("ScrollMenu"), _("Scroll")); + ActionManager::register_action (editor_actions, X_("SecondaryClockMenu"), _("Secondary Clock")); + ActionManager::register_action (editor_actions, X_("Select"), _("Select")); + ActionManager::register_action (editor_actions, X_("SelectMenu"), _("Select")); + ActionManager::register_action (editor_actions, X_("SeparateMenu"), _("Separate")); + ActionManager::register_action (editor_actions, X_("SetLoopMenu"), _("Loop")); + ActionManager::register_action (editor_actions, X_("SetPunchMenu"), _("Punch")); + ActionManager::register_action (editor_actions, X_("Solo"), _("Solo")); ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes")); - ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate To Markers")); + ActionManager::register_action (editor_actions, X_("TempoMenu"), _("Tempo")); + ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps")); + ActionManager::register_action (editor_actions, X_("Tools"), _("Tools")); + ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim")); + ActionManager::register_action (editor_actions, X_("View"), _("View")); + ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom")); + ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom")); + ActionManager::register_action (editor_actions, X_("ZoomFocusMenu"), _("Zoom Focus")); /* add named actions for the editor */ @@ -210,6 +233,10 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, true)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "playhead-forward-to-grid", _("Forward To Grid"), mem_fun(*this, &Editor::playhead_forward_to_grid)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "playhead-backward-to-grid", _("Backward To Grid"), mem_fun(*this, &Editor::playhead_backward_to_grid)); + ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true)); @@ -255,31 +282,39 @@ Editor::register_actions () 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); + ActionManager::region_selection_sensitive_actions.push_back (act); 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); + ActionManager::region_selection_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)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit point to end"), mem_fun(*this, &Editor::trim_region_to_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim To Loop"), mem_fun(*this, &Editor::trim_region_to_loop)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_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); + ActionManager::region_selection_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-loop-from-region", _("Set Loop From Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), false)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "loop-region", _("Loop Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), true)); 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-punch-from-region", _("Set Punch From Region"), mem_fun(*this, &Editor::set_punch_from_region)); ActionManager::session_sensitive_actions.push_back (act); - + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "pitch-shift-region", _("Transpose"), mem_fun(*this, &Editor::pitch_shift_regions)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_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); @@ -292,17 +327,23 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "align-regions-start", _("Align Regions Start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-start-relative", _("Align Regions Start Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::Start)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-end", _("Align Regions End"), bind (mem_fun(*this, &Editor::align), ARDOUR::End)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-end-relative", _("Align Regions End Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::End)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-sync", _("Align Regions Sync"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("Align Regions Sync Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "play-from-edit-point", _("Play From Edit Point"), mem_fun(*this, &Editor::play_from_edit_point)); ActionManager::session_sensitive_actions.push_back (act); @@ -312,19 +353,81 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "play-edit-range", _("Play Edit Range"), mem_fun(*this, &Editor::play_edit_range)); act = ActionManager::register_action (editor_actions, "play-selected-regions", _("Play Selected Region(s)"), mem_fun(*this, &Editor::play_selected_region)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region)); - ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-playhead", _("Set Playhead"), mem_fun(*this, &Editor::set_playhead_cursor)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-edit-point", _("Set Edit Point"), mem_fun(*this, &Editor::set_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + + act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "rename-region", _("Rename"), mem_fun(*this, &Editor::rename_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "auto-rename-region", _("Auto-Rename"), mem_fun(*this, &Editor::rename_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "split-region", _("Split Region"), mem_fun(*this, &Editor::split)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::set_region_sync_from_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "remove-region-sync", _("Remove Region Sync"), mem_fun(*this, &Editor::remove_region_sync)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "raise-region", _("Raise Region"), mem_fun(*this, &Editor::raise_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "lower-region", _("Lower Region"), mem_fun(*this, &Editor::lower_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "export-region", _("Export Region"), mem_fun(*this, &Editor::export_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (editor_actions, "lock-region", _("Lock Region"), mem_fun(*this, &Editor::toggle_region_lock)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (editor_actions, "glue-region", _("Glue Region To Bars&Beats"), bind (mem_fun (*this, &Editor::set_region_lock_style), Region::MusicTime)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "naturalize-region", _("Move To Original Position"), mem_fun (*this, &Editor::naturalize)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse"), mem_fun (*this, &Editor::reverse_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "monoize-region", _("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region))); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "region-fill-track", _("Fill Track"), (mem_fun(*this, &Editor::region_fill_track))); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); undo_action = act = ActionManager::register_action (editor_actions, "undo", _("Undo"), bind (mem_fun(*this, &Editor::undo), 1U)); ActionManager::session_sensitive_actions.push_back (act); @@ -338,8 +441,16 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut)); ActionManager::session_sensitive_actions.push_back (act); /* Note: for now, editor-delete does the exact same thing as editor-cut */ @@ -349,24 +460,7 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse Region"), mem_fun(*this, &Editor::reverse_region)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region)); ActionManager::session_sensitive_actions.push_back (act); @@ -377,6 +471,7 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "split-region-at-transients", _("Split Regions At Percussion Onsets"), mem_fun(*this, &Editor::split_region_at_transients)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "toggle-rhythm-ferret", _("Rhythm Ferret"), mem_fun(*this, &Editor::show_rhythm_ferret)); ActionManager::session_sensitive_actions.push_back (act); @@ -441,6 +536,10 @@ Editor::register_actions () ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); + ActionManager::register_action (editor_actions, "edit-point-marker", _("Marker"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtSelectedMarker)); + ActionManager::register_action (editor_actions, "edit-point-playhead", _("Playhead"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtPlayhead)); + ActionManager::register_action (editor_actions, "edit-point-mouse", _("Mouse"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtMouse)); + ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false)); ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true)); @@ -482,6 +581,20 @@ Editor::register_actions () ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to region sync"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionSync))); ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to region boundary"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionBoundary))); + /* RULERS */ + + Glib::RefPtr<ActionGroup> ruler_actions = ActionGroup::create (X_("Rulers")); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-tempo-ruler"), _("Tempo"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_tempo)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-meter-ruler"), _("Meter"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_meter)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-range-ruler"), _("Ranges"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_range_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-marker-ruler"), _("Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-cd-marker-ruler"), _("CD Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_cd_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-loop-punch-ruler"), _("Loop/Punch"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_transport_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-bbt-ruler"), _("Bars & Beats"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_frames)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-samples-ruler"), _("Samples"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_bbt)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_smpte)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_minsec)); + /* REGION LIST */ Glib::RefPtr<ActionGroup> rl_actions = ActionGroup::create (X_("RegionList")); @@ -583,6 +696,7 @@ Editor::register_actions () &Editor::subframes_per_frame_chosen), 100)); ActionManager::add_action_group (rl_actions); + ActionManager::add_action_group (ruler_actions); ActionManager::add_action_group (zoom_actions); ActionManager::add_action_group (mouse_mode_actions); ActionManager::add_action_group (snap_actions); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index bcf1af444f..0be6221be5 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2821,6 +2821,24 @@ Editor::separate_region_from_selection () } void +Editor::separate_region_from_punch () +{ + Location* loc = session->locations()->auto_punch_location(); + if (loc) { + separate_regions_using_location (*loc); + } +} + +void +Editor::separate_region_from_loop () +{ + Location* loc = session->locations()->auto_loop_location(); + if (loc) { + separate_regions_using_location (*loc); + } +} + +void Editor::separate_regions_using_location (Location& loc) { if (loc.is_mark()) { @@ -5487,3 +5505,29 @@ Editor::tab_to_transient (bool forward) } } } + +void +Editor::playhead_forward_to_grid () +{ + if (!session) return; + nframes64_t pos = playhead_cursor->current_frame; + if (pos < max_frames) { + pos++; + snap_to_internal (pos, 1, false); + session->request_locate (pos); + } +} + + +void +Editor::playhead_backward_to_grid () +{ + if (!session) return; + nframes64_t pos = playhead_cursor->current_frame; + if (pos > 1) { + pos--; + snap_to_internal (pos, -1, false); + session->request_locate (pos); + } +} + diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 6cd022cce1..1408351d47 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -795,6 +795,27 @@ Editor::region_selection_changed () (*i)->set_selected_regionviews (selection->regions); } + bool have_selected_regions = !selection->regions.empty(); + + for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::region_selection_sensitive_actions.begin(); + x != ActionManager::region_selection_sensitive_actions.end(); ++x) { + + string accel_path = (*x)->get_accel_path (); + AccelKey key; + + /* if there is an accelerator, it should always be sensitive + to allow for keyboard ops on entered regions. + */ + + bool known = ActionManager::lookup_entry (accel_path, key); + + if (known && ((key.get_key() != GDK_VoidSymbol) && (key.get_key() != 0))) { + (*x)->set_sensitive (true); + } else { + (*x)->set_sensitive (have_selected_regions); + } + } + zoomed_to_region = false; } diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 67de31ca82..62f43f37fd 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -975,7 +975,7 @@ ExportDialog::do_export () progress_connection = Glib::signal_timeout().connect (mem_fun(*this, &ExportDialog::progress_timeout), 100); cancel_label.set_text (_("Stop Export")); - export_audio_data(); + export_data(); progress_connection.disconnect (); end_dialog (); diff --git a/gtk2_ardour/export_dialog.h b/gtk2_ardour/export_dialog.h index 596467d3e1..a35322b854 100644 --- a/gtk2_ardour/export_dialog.h +++ b/gtk2_ardour/export_dialog.h @@ -48,7 +48,7 @@ class ExportDialog : public ArdourDialog virtual Gtk::FileChooserAction browse_action() const { return Gtk::FILE_CHOOSER_ACTION_SAVE; } protected: - ARDOUR::AudioExportSpecification spec; + ARDOUR::ExportSpecification spec; Gtk::Frame file_frame; struct ExportModelColumns : public Gtk::TreeModel::ColumnRecord @@ -77,7 +77,7 @@ class ExportDialog : public ArdourDialog // Gets called from within do_export. Is responsible for exporting the // audio data. spec has already been filled with user input before calling // this method. The dialog will be closed after this function exited. - virtual void export_audio_data() = 0; + virtual void export_data() = 0; virtual bool wants_dir() { return false; } diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc index 1184294a67..8bb93eb4aa 100644 --- a/gtk2_ardour/export_range_markers_dialog.cc +++ b/gtk2_ardour/export_range_markers_dialog.cc @@ -54,7 +54,7 @@ ExportRangeMarkersDialog::browse_action () const } void -ExportRangeMarkersDialog::export_audio_data () +ExportRangeMarkersDialog::export_data () { getSession().locations()->apply(*this, &ExportRangeMarkersDialog::process_range_markers_export); } @@ -83,7 +83,7 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList& getSession().request_locate(spec.start_frame, false); - if (getSession().start_audio_export(spec)){ + if (getSession().start_export(spec)){ // if export fails return; } diff --git a/gtk2_ardour/export_range_markers_dialog.h b/gtk2_ardour/export_range_markers_dialog.h index 7d231c62d5..9083b87b26 100644 --- a/gtk2_ardour/export_range_markers_dialog.h +++ b/gtk2_ardour/export_range_markers_dialog.h @@ -35,7 +35,7 @@ class ExportRangeMarkersDialog : public ExportDialog protected: virtual bool is_filepath_valid(string &filepath); - void export_audio_data(); + void export_data(); bool wants_dir() { return true; } diff --git a/gtk2_ardour/export_region_dialog.cc b/gtk2_ardour/export_region_dialog.cc index cb3804c11b..f73b990880 100644 --- a/gtk2_ardour/export_region_dialog.cc +++ b/gtk2_ardour/export_region_dialog.cc @@ -28,14 +28,14 @@ #include "i18n.h" -ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr<ARDOUR::Region> region) +ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr<ARDOUR::Region> reg) : ExportDialog(editor) + , region(reg) { - set_title (_("ardour: export region")); - file_frame.set_label (_("Export to File")), + assert(region); - audio_region = boost::dynamic_pointer_cast<ARDOUR::AudioRegion>(region); - assert(audio_region); + set_title (_("Ardour: Export Region")); + file_frame.set_label (_("Export to File")), do_not_allow_track_and_master_selection(); do_not_allow_channel_count_selection(); @@ -43,7 +43,7 @@ ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr< void -ExportRegionDialog::export_audio_data() +ExportRegionDialog::export_data() { pthread_t thr; pthread_create_and_store ("region export", &thr, 0, ExportRegionDialog::_export_region_thread, this); @@ -71,5 +71,6 @@ ExportRegionDialog::_export_region_thread (void *arg) void ExportRegionDialog::export_region () { - audio_region->exportme (getSession(), spec); + region->exportme (getSession(), spec); } + diff --git a/gtk2_ardour/export_region_dialog.h b/gtk2_ardour/export_region_dialog.h index a0457b7331..95c721bed0 100644 --- a/gtk2_ardour/export_region_dialog.h +++ b/gtk2_ardour/export_region_dialog.h @@ -33,10 +33,10 @@ class ExportRegionDialog : public ExportDialog void export_region (); protected: - void export_audio_data(); + void export_data(); private: - boost::shared_ptr<ARDOUR::AudioRegion> audio_region; + boost::shared_ptr<ARDOUR::Region> region; }; diff --git a/gtk2_ardour/export_session_dialog.cc b/gtk2_ardour/export_session_dialog.cc index 006f9675b3..4226a7e7ee 100644 --- a/gtk2_ardour/export_session_dialog.cc +++ b/gtk2_ardour/export_session_dialog.cc @@ -30,9 +30,9 @@ ExportSessionDialog::ExportSessionDialog (PublicEditor& editor) } void -ExportSessionDialog::export_audio_data () +ExportSessionDialog::export_data () { - if (getSession().start_audio_export (spec)) { + if (getSession().start_export (spec)) { return; } diff --git a/gtk2_ardour/export_session_dialog.h b/gtk2_ardour/export_session_dialog.h index 5aeec4ad10..a6e118fc85 100644 --- a/gtk2_ardour/export_session_dialog.h +++ b/gtk2_ardour/export_session_dialog.h @@ -30,7 +30,7 @@ class ExportSessionDialog : public ExportDialog void set_range (nframes_t start, nframes_t end); protected: - void export_audio_data(); + void export_data(); }; diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 0a4a3acc95..6adaf07186 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -38,7 +38,7 @@ namespace ARDOUR { class Session; - class AudioExportSpecification; + class ExportSpecification; class Region; class Playlist; class RouteGroup; |