add Editor::default_time_domain()

Not 100% certain about the logic here, but at least the method exists now
This commit is contained in:
Paul Davis 2021-01-15 15:57:47 -07:00
parent af9bc21a07
commit 5074553f15
3 changed files with 17 additions and 0 deletions

View File

@ -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;
}

View File

@ -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 {

View File

@ -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.
*/