add Drag::pixel_to_time() which reflects the Drag's _time_domain setting
This commit is contained in:
parent
fc155e76b4
commit
845b5d81a9
@ -279,6 +279,17 @@ Drag::Drag (Editor* e, ArdourCanvas::Item* i, Temporal::TimeDomain td, bool trac
|
||||
{
|
||||
|
||||
}
|
||||
timepos_t
|
||||
Drag::pixel_to_time (double x) const
|
||||
{
|
||||
samplepos_t p = _editor->pixel_to_sample (x);
|
||||
|
||||
if (_time_domain == Temporal::AudioTime) {
|
||||
return timepos_t (p);
|
||||
}
|
||||
|
||||
return timepos_t (timepos_t (p).beats ());
|
||||
}
|
||||
|
||||
void
|
||||
Drag::swap_grab (ArdourCanvas::Item* new_item, Gdk::Cursor* cursor, uint32_t /*time*/)
|
||||
|
@ -252,6 +252,8 @@ protected:
|
||||
return _grab_y;
|
||||
}
|
||||
|
||||
Temporal::timepos_t pixel_to_time (double x) const;
|
||||
|
||||
Temporal::timepos_t raw_grab_time () const {
|
||||
return _raw_grab_time;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user