diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 5e0cc0706d..1189e7c60a 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -6410,3 +6410,13 @@ Editor::duration_to_pixels_unrounded (timecnt_t const & dur) const { return sample_to_pixel_unrounded (dur.samples()); } + +Temporal::TimeDomain +Editor::default_time_domain () const +{ + if (_grid_type == GridTypeNone || _snap_mode == SnapOff) { + return AudioTime; + } + + return BeatTime; +} diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 4ab308ee3c..4eb64bcec8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -168,6 +168,8 @@ public: bool pending_locate_request() const { return _pending_locate_request; } + Temporal::TimeDomain default_time_domain() const; + samplepos_t leftmost_sample() const { return _leftmost_sample; } samplecnt_t current_page_samples() const { diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index e0fb808144..bdc88369e1 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -130,6 +130,11 @@ public: virtual void setup_tooltips() = 0; + /* returns the time domain to be used when there's no other overriding + * reason to choose one. + */ + virtual Temporal::TimeDomain default_time_domain() const = 0; + /** Attach this editor to a Session. * @param s Session to connect to. */