diff options
author | Robin Gareus <robin@gareus.org> | 2016-12-16 15:02:29 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-12-17 02:43:42 +0100 |
commit | e1826f8b1c4b0c4406de088e1302cde8154c4a85 (patch) | |
tree | a4b039545159cec1638104a6708bee58714650c2 /gtk2_ardour | |
parent | cd64f17a9c5442befd32fc52317a44e4ed288b82 (diff) |
Add API to query editor's playhead cursor position
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 3 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4c626f52b9..875d249207 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -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 () { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 5475e78fda..27d077c6ec 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -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); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 393c73a673..54abee9213 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -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; |