Add API to query editor's playhead cursor position
authorRobin Gareus <robin@gareus.org>
Fri, 16 Dec 2016 14:02:29 +0000 (15:02 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 17 Dec 2016 01:43:42 +0000 (02:43 +0100)
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/public_editor.h

index 4c626f52b98cff1f610f14500c561ff544e8ae54..875d249207c4156b5f5cecbe0173d318bac16489 100644 (file)
@@ -4546,6 +4546,12 @@ Editor::set_samples_per_pixel (framecnt_t spp)
        instant_save ();
 }
 
+framepos_t
+Editor::playhead_cursor_sample () const
+{
+       return playhead_cursor->current_frame();
+}
+
 void
 Editor::queue_visual_videotimeline_update ()
 {
index 5475e78fdad9b8bdcf1b7cc60ad55644204e7a4f..27d077c6ec43bd9d0a9d1325eb87040fcaa3d97e 100644 (file)
@@ -1015,7 +1015,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        friend class EditorCursor;
 
-       EditorCursor*        playhead_cursor;
+       EditorCursor* playhead_cursor;
+       framepos_t playhead_cursor_sample () const;
 
        framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
 
index 393c73a673e0352f663de38a7df46d5769a67036..54abee9213b3b40f09b46b332021a458908319ea 100644 (file)
@@ -197,6 +197,7 @@ class PublicEditor : public Gtkmm2ext::Tabbable {
 
        virtual void transition_to_rolling (bool fwd) = 0;
        virtual framepos_t pixel_to_sample (double pixel) const = 0;
+       virtual framepos_t playhead_cursor_sample () const = 0;
        virtual double sample_to_pixel (framepos_t frame) const = 0;
        virtual double sample_to_pixel_unrounded (framepos_t frame) const = 0;
        virtual Selection& get_selection () const = 0;