Merge with 2.0-ongoing R3082.
authorDavid Robillard <d@drobilla.net>
Tue, 19 Feb 2008 22:10:27 +0000 (22:10 +0000)
committerDavid Robillard <d@drobilla.net>
Tue, 19 Feb 2008 22:10:27 +0000 (22:10 +0000)
Superficial generification of export stuff.

git-svn-id: svn://localhost/ardour2/branches/3.0@3088 d708f5d6-7413-0410-9779-e7cbd77b26cf

31 files changed:
gtk2_ardour/SAE-de.bindings.in
gtk2_ardour/actions.cc
gtk2_ardour/ardour-sae.menus
gtk2_ardour/ardour.menus
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/audio_region_view.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_actions.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/editor_selection.cc
gtk2_ardour/export_dialog.cc
gtk2_ardour/export_dialog.h
gtk2_ardour/export_range_markers_dialog.cc
gtk2_ardour/export_range_markers_dialog.h
gtk2_ardour/export_region_dialog.cc
gtk2_ardour/export_region_dialog.h
gtk2_ardour/export_session_dialog.cc
gtk2_ardour/export_session_dialog.h
gtk2_ardour/public_editor.h
libs/ardour/ardour/audioregion.h
libs/ardour/ardour/export.h
libs/ardour/ardour/midi_region.h
libs/ardour/ardour/region.h
libs/ardour/ardour/session.h
libs/ardour/audioanalyser.cc
libs/ardour/audioregion.cc
libs/ardour/midi_region.cc
libs/ardour/session_export.cc
libs/ardour/tempo.cc
libs/ardour/transient_detector.cc

index e0758e5c04a6d5978be9c411d857467d4c687817..a1dedef2f989e0c54f25950da18589034b1d80c8 100644 (file)
@@ -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")
 
 ;; 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")
 (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")
 
 (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.
index 1484c01454309bdfb9724461b432c42f87a9a70c..a383371c9828f1effcdd84d416bed1b1d99adf72 100644 (file)
@@ -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;
        }
index 16f00955f36802de8ec052b919eb6e3686f45a03..e8b8a20b5e26dba1415ec72d1c79e8d7d08e545a 100644 (file)
@@ -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/>
            <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'/>
                <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'>
index 73f65ef157d9bcd9267a74c2c47eed5c3f5db8eb..c333b03b615f7a7e7492350f83cad845c22d9dab 100644 (file)
               </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'/>
index c94fb1ba9d8abad5bcc9aba943fc7727e05055ae..d12165bbb74c38eb4bdbe852fde3bf36faf6f666 100644 (file)
@@ -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);
index c3e3b9a0368b8af1fa7ac3dbfbc61f48f236a269..a98958f8a80b8acfb153c14bdfa7bc6aacc1715c 100644 (file)
@@ -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);
                }
 
index 4d05d5dac6147542540c250e1dc0114c6883560d..6330265dc6ccc3fe3a333f9bac5c7030f78076cb 100644 (file)
@@ -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) {
index 1e0f47edfc0334f241dab51df9d5d8dec99deb96..62d62a330f69000cc8800c3b508952f9fde47de3 100644 (file)
@@ -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;
 };
 
index 4d4ab99046904cdd89810ac68970367dafd5febc..d6e4a5a2140006a21e436dc475958f5a4343aa25 100644 (file)
@@ -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);
index bcf1af444f5e2108783277be9590db83ee4abb77..0be6221be5f37d0e0cdf32b2a8b377e892034c1f 100644 (file)
@@ -2820,6 +2820,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)
 {
@@ -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);
+       }
+}
+
index 6cd022cce185f53f9d8b73e88bdf7f52fe3a3a8e..1408351d4768f0665871bf6c3b5d0c1b87378e8e 100644 (file)
@@ -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;
 }
 
index 67de31ca82bb4bdccf35cb4bd12be2b6c7075c29..62f43f37fddebc5c3af61e76475c741b2efd6502 100644 (file)
@@ -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 ();
index 596467d3e1e0c2057844dc8a90e7a760e66926c9..a35322b854951f727de8d103ead3ffbb66b756c8 100644 (file)
@@ -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; }
        
index 1184294a6712e6f5fd6314f80ade182486650ba9..8bb93eb4aa0214e8d19880be37f9e9e60fbad0ac 100644 (file)
@@ -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;
                        }
index 7d231c62d5f84bd39d749e057404541f5f2e3f98..9083b87b265d253bbc090712a6270380231f91b1 100644 (file)
@@ -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; }
   
index cb3804c11b224f3694c4d6264cd3a22f3ada6b11..f73b990880fe9d7ecf3d95501ba58b46f8151aa3 100644 (file)
 #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);
 }
+
index a0457b7331669130890a4e46e62b3fc66c69b5fc..95c721bed0599743c70027165aaead96befad925 100644 (file)
@@ -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;
 };
 
 
index 006f9675b3c8640787873920cda5fd32d0fce555..4226a7e7ee7640dc850665cb54b19694839dacc9 100644 (file)
@@ -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;
        }
 
index 5aeec4ad10bdd76d9e8424111c09b57b3c9bcdc4..a6e118fc854b7f31045f67fd3c71e614b6131a0f 100644 (file)
@@ -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();
 };
 
 
index 0a4a3acc950cbe93524582160da6c388e29e24a5..6adaf07186c9cd605e80a06b6cc5c60dbfef22d8 100644 (file)
@@ -38,7 +38,7 @@
 
 namespace ARDOUR {
        class Session;
-       class AudioExportSpecification;
+       class ExportSpecification;
        class Region;
        class Playlist;
        class RouteGroup;
index 3fddfc55b4b6b76debb028ea3c408c3b52a17595..e88e10d521a8ae38b641ba2b461ca42f0f6d0ada 100644 (file)
@@ -125,7 +125,7 @@ class AudioRegion : public Region
 
        /* export */
 
-       int exportme (ARDOUR::Session&, ARDOUR::AudioExportSpecification&);
+       int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&);
 
        /* xfade/fade interactions */
 
index bf1297d3cb991b935573271a80707e7bef804427..141786873d2db5302158e3613cb8b2f25428c28f 100644 (file)
@@ -42,12 +42,12 @@ namespace ARDOUR
        class Port;
 
        typedef pair<Port *, uint32_t> PortChannelPair;
-       typedef map<uint32_t, vector<PortChannelPair> > AudioExportPortMap;
+       typedef map<uint32_t, vector<PortChannelPair> > ExportPortMap;
 
-       struct AudioExportSpecification : public SF_INFO, public sigc::trackable {
+       struct ExportSpecification : public SF_INFO, public sigc::trackable {
 
-           AudioExportSpecification();
-           ~AudioExportSpecification ();
+           ExportSpecification();
+           ~ExportSpecification ();
 
            void init ();
            void clear ();
@@ -62,36 +62,36 @@ namespace ARDOUR
            string              path;
            nframes_t      sample_rate;
 
-           int                 src_quality;
-           SNDFILE*            out;
+           int            src_quality;
+           SNDFILE*       out;
            uint32_t       channels;
-           AudioExportPortMap  port_map;
+           ExportPortMap  port_map;
            nframes_t      start_frame;
            nframes_t      end_frame;
-           GDitherType         dither_type;
-           bool                do_freewheel;
+           GDitherType    dither_type;
+           bool           do_freewheel;
 
            /* used exclusively during export */
 
            nframes_t      frame_rate;
-           GDither             dither;
-           float*              dataF;
-           float*              dataF2;
-           float*              leftoverF;
+           GDither        dither;
+           float*         dataF;
+           float*         dataF2;
+           float*         leftoverF;
            nframes_t      leftover_frames;
            nframes_t      max_leftover_frames;
-           void*               output_data;
+           void*          output_data;
            nframes_t      out_samples_max;
-           uint32_t        sample_bytes;
-           uint32_t        data_width;
+           uint32_t       sample_bytes;
+           uint32_t       data_width;
 
            nframes_t      total_frames;
-           SF_INFO             sfinfo;
-           SRC_DATA            src_data;
-           SRC_STATE*          src_state;
+           SF_INFO        sfinfo;
+           SRC_DATA       src_data;
+           SRC_STATE*     src_state;
            nframes_t      pos;
 
-           sigc::connection    freewheel_connection;
+           sigc::connection freewheel_connection;
 
            /* shared between UI thread and audio thread */
 
@@ -99,9 +99,9 @@ namespace ARDOUR
            volatile bool  stop;      /* UI sets this */
            volatile bool  running;   /* audio thread sets to false when export is done */
 
-           int   status;
-
+           int status;
        };
+
 } // namespace ARDOUR
 
 #endif /* __ardour_export_h__ */
index 50c6b8bce7850d8ca7b324c29f4e87d55b133d03..cd2b0d6132121be6f1383ff8267ab639d767b7cb 100644 (file)
@@ -84,6 +84,8 @@ class MidiRegion : public Region
 
        boost::shared_ptr<const AutomationControl> control(Parameter id) const
                        { return midi_source()->model()->control(id); }
+       
+       int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&);
 
   private:
        friend class RegionFactory;
index d793e8ca23b23a56cd73409b0839fff18f1760d7..4196aac886bea1799af86bf39ae4146589c44bfe 100644 (file)
@@ -37,6 +37,7 @@ namespace ARDOUR {
 
 class Playlist;
 class Filter;
+class ExportSpecification;
 
 enum RegionEditState {
        EditChangesNothing = 0,
@@ -222,6 +223,8 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
        virtual bool is_dependent() const { return false; }
        virtual bool depends_on (boost::shared_ptr<Region> other) const { return false; }
 
+       virtual int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&) = 0;
+
        virtual int get_transients (AnalysisFeatureList&, bool force_new = false) { 
                // no transients, but its OK
                return 0;
index 10167ae5b324c900c8bab9ea8793403268d1a258..bc77157e9fd8687919725c39e878c072ca727174 100644 (file)
@@ -109,7 +109,7 @@ class SMFSource;
 
 class SessionDirectory;
 
-struct AudioExportSpecification;
+struct ExportSpecification;
 struct RouteGroup;
 
 using std::vector;
@@ -606,8 +606,8 @@ class Session : public PBD::StatefulDestructible
        SlaveSource post_export_slave;
        nframes_t post_export_position;
 
-       int start_audio_export (ARDOUR::AudioExportSpecification&);
-       int stop_audio_export (ARDOUR::AudioExportSpecification&);
+       int start_export (ARDOUR::ExportSpecification&);
+       int stop_export (ARDOUR::ExportSpecification&);
        void finalize_audio_export ();
 
        void add_source (boost::shared_ptr<Source>);
@@ -1037,7 +1037,7 @@ class Session : public PBD::StatefulDestructible
        void process_without_events (nframes_t);
        void process_with_events    (nframes_t);
        void process_audition       (nframes_t);
-       int  process_export         (nframes_t, ARDOUR::AudioExportSpecification*);
+       int  process_export         (nframes_t, ARDOUR::ExportSpecification*);
        
        /* slave tracking */
 
@@ -1062,7 +1062,7 @@ class Session : public PBD::StatefulDestructible
        void set_slave_source (SlaveSource);
 
        bool _exporting;
-       int prepare_to_export (ARDOUR::AudioExportSpecification&);
+       int prepare_to_export (ARDOUR::ExportSpecification&);
 
        void prepare_diskstreams ();
        void commit_diskstreams (nframes_t, bool& session_requires_butler);
index 9da404e5bf5e7c3df83eec5b3be7349fc4418c00..eccc38434d9c0b39b1e6d3faf5521e67ea7a5e3e 100644 (file)
@@ -119,7 +119,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
                /* zero fill buffer if necessary */
 
                if (to_read != bufsize) {
-                       memset (data + to_read, 0, (bufsize - to_read));
+                       memset (data + to_read, 0, (bufsize - to_read) * sizeof (Sample));
                }
                
                features = plugin->process (bufs, RealTime::fromSeconds ((double) pos / sample_rate));
@@ -128,7 +128,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
                        goto out;
                }
 
-               pos += stepsize;
+               pos += min (stepsize, to_read);
 
                if (pos >= len) {
                        done = true;
index 7e2b709abd30e0d2d392bc3b74e8c84b10eec3c8..5e0cd136ff17c40aa7eb691cbb4e393af543dbb4 100644 (file)
@@ -1022,7 +1022,7 @@ AudioRegion::read_raw_internal (Sample* buf, nframes_t pos, nframes_t cnt) const
 
 
 int
-AudioRegion::exportme (Session& session, AudioExportSpecification& spec)
+AudioRegion::exportme (Session& session, ARDOUR::ExportSpecification& spec)
 {
        const nframes_t blocksize = 4096;
        nframes_t to_read;
index b0b7e4575fcdd535771e8d9608f9c5c0f607ddc6..ababd41a8d29e078a3e16952b5bde4ad1306a035 100644 (file)
@@ -310,6 +310,12 @@ MidiRegion::separate_by_channel (Session& session, vector<MidiRegion*>& v) const
        return -1;
 }
 
+int
+MidiRegion::exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&)
+{
+       return -1;
+}
+
 boost::shared_ptr<MidiSource>
 MidiRegion::midi_source (uint32_t n) const
 {
index b1058f2e7e4e50335bce3beddc2059a504d569ba..49b6d9b1503851a941a787c06529ba7ddcf12bde 100644 (file)
@@ -57,7 +57,7 @@ using namespace ARDOUR;
 using namespace PBD;
 
 static int
-convert_spec_to_info (AudioExportSpecification& spec, SF_INFO& sfinfo)
+convert_spec_to_info (ExportSpecification& spec, SF_INFO& sfinfo)
 {
        if (spec.path.length() == 0) {
                error << _("Export: no output file specified") << endmsg;
@@ -76,18 +76,18 @@ convert_spec_to_info (AudioExportSpecification& spec, SF_INFO& sfinfo)
        return 0;
 }
 
-AudioExportSpecification::AudioExportSpecification ()
+ExportSpecification::ExportSpecification ()
 {
        init ();
 }
 
-AudioExportSpecification::~AudioExportSpecification ()
+ExportSpecification::~ExportSpecification ()
 {
        clear ();
 }
 
 void
-AudioExportSpecification::init ()
+ExportSpecification::init ()
 {
        src_state = 0;
        pos = 0;
@@ -113,7 +113,7 @@ AudioExportSpecification::init ()
 }
 
 void
-AudioExportSpecification::clear ()
+ExportSpecification::clear ()
 {
        if (out) {
                sf_close (out);
@@ -153,7 +153,7 @@ AudioExportSpecification::clear ()
 }
 
 int
-AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate)
+ExportSpecification::prepare (nframes_t blocksize, nframes_t frate)
 {
        char errbuf[256];
        GDitherSize dither_size;
@@ -161,7 +161,7 @@ AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate)
        frame_rate = frate;
 
        if (channels == 0) {
-               error << _("illegal frame range in export specification") << endmsg;
+               error << _("illegal channel count in export specification") << endmsg;
                return -1;
        }
 
@@ -258,7 +258,7 @@ AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate)
 }
 
 int
-AudioExportSpecification::process (nframes_t nframes)
+ExportSpecification::process (nframes_t nframes)
 {
        float* float_buffer = 0;
        uint32_t chn;
@@ -426,7 +426,7 @@ AudioExportSpecification::process (nframes_t nframes)
 }
 
 int
-Session::start_audio_export (AudioExportSpecification& spec)
+Session::start_export (ExportSpecification& spec)
 {
        if (!_engine.connected()) {
                return -1;
@@ -448,7 +448,7 @@ Session::start_audio_export (AudioExportSpecification& spec)
 }
 
 int
-Session::stop_audio_export (AudioExportSpecification& spec)
+Session::stop_export (ExportSpecification& spec)
 {
        /* don't stop freewheeling but do stop paying attention to it for now */
 
@@ -459,7 +459,7 @@ Session::stop_audio_export (AudioExportSpecification& spec)
 }
 
 int 
-Session::prepare_to_export (AudioExportSpecification& spec)
+Session::prepare_to_export (ExportSpecification& spec)
 {
        int ret = -1;
 
@@ -521,7 +521,7 @@ Session::prepare_to_export (AudioExportSpecification& spec)
 }
 
 int
-Session::process_export (nframes_t nframes, AudioExportSpecification* spec)
+Session::process_export (nframes_t nframes, ExportSpecification* spec)
 {
        uint32_t chn;
        uint32_t x;
@@ -551,7 +551,7 @@ Session::process_export (nframes_t nframes, AudioExportSpecification* spec)
                
        if (!spec->running || spec->stop || (this_nframes = min ((spec->end_frame - spec->pos), nframes)) == 0) {
                process_without_events (nframes);
-               return stop_audio_export (*spec);
+               return stop_export (*spec);
        }
 
        /* make sure we've caught up with disk i/o, since
@@ -574,7 +574,7 @@ Session::process_export (nframes_t nframes, AudioExportSpecification* spec)
        
        for (chn = 0; chn < spec->channels; ++chn) {
                
-               AudioExportPortMap::iterator mi = spec->port_map.find (chn);
+               ExportPortMap::iterator mi = spec->port_map.find (chn);
                
                if (mi == spec->port_map.end()) {
                        /* no ports exported to this channel */
@@ -588,17 +588,18 @@ Session::process_export (nframes_t nframes, AudioExportSpecification* spec)
                        /* OK, this port's output is supposed to appear on this channel 
                         */
 
-                       AudioPort* const port = dynamic_cast<AudioPort*>((*t).first);
-                       if (port == 0) {
-                               cerr << "FIXME: Non-audio export" << endl;
-                               continue;
-                       }
-                       Sample* port_buffer = port->get_audio_buffer().data();
+                       AudioPort* const aport = dynamic_cast<AudioPort*>((*t).first);
+                       MidiPort* const mport = dynamic_cast<MidiPort*>((*t).first);
+                       if (aport != 0) {
+                               Sample* port_buffer = aport->get_audio_buffer().data();
 
-                       /* now interleave the data from the channel into the float buffer */
-                               
-                       for (x = 0; x < nframes; ++x) {
-                               spec->dataF[chn+(x*spec->channels)] += (float) port_buffer[x];
+                               /* now interleave the data from the channel into the float buffer */
+
+                               for (x = 0; x < nframes; ++x) {
+                                       spec->dataF[chn+(x*spec->channels)] += (float) port_buffer[x];
+                               }
+                       } else if (mport != 0) {
+                               cerr << "EXPORT MIDI PORT" << endl;
                        }
                }
        }
index 3170d588a1c1c80ee7a3ba09cad4cfe4cda21362..bcbb01d9c962a5fc063baf4d52e82d3f9d20deb8 100644 (file)
@@ -1141,16 +1141,16 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type)
        case Bar:
                if (dir < 0) {
                        /* relax */
-
                } else if (dir > 0) {
                        if (bbt.beats > 0) {
                                bbt.bars++;
+                       } else if (metric.frame() < frame) {
+                               bbt.bars++;
                        }
                } else {
                        if (bbt.beats > metric.meter().beats_per_bar()/2) {
                                bbt.bars++;
                        }
-
                }
                bbt.beats = 1;
                bbt.ticks = 0;
@@ -1162,6 +1162,8 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type)
                } else if (dir > 0) {
                        if (bbt.ticks > 0) {
                                bbt.beats++;
+                       } else if (metric.frame() < frame) {
+                               bbt.beats++;
                        }
                } else {
                        if (bbt.ticks >= (Meter::ticks_per_beat/2)) {
@@ -1177,11 +1179,9 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type)
        
        }
 
-       /* 
-          cerr << "for " << frame << " round to " << bbt << " using "
-          << metric.start()
-          << endl;
-       */
+       cerr << "for " << frame << " round to " << bbt << " using "
+            << metric.start()
+            << endl;
 
        return metric.frame() + count_frames_between (metric.start(), bbt);
 }
index d24c4c9442f678cf1016be4ac8e2558cccc63e20..d3200d72e4b9917c83c2474c1de5b6ae283960ec 100644 (file)
@@ -54,7 +54,7 @@ TransientDetector::use_features (Plugin::FeatureSet& features, ostream* out)
                        if (out) {
                                (*out) << (*f).timestamp.toString() << endl;
                        } 
-
+                       
                        current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
                }
        }