add Editor::canvas_event_time()
See comments in header for more
This commit is contained in:
parent
0114059c9d
commit
6a44dcbdad
@ -2121,6 +2121,13 @@ private:
|
||||
*/
|
||||
samplepos_t canvas_event_sample (GdkEvent const*, double* px = 0, double* py = 0) const;
|
||||
|
||||
/** computes the timeline position for an event whose coordinates
|
||||
* are in canvas units (pixels, scroll offset included). The time
|
||||
* domain used by the return value will match ::default_time_domain()
|
||||
* at the time of calling.
|
||||
*/
|
||||
Temporal::timepos_t canvas_event_time (GdkEvent const*, double* px = 0, double* py = 0) const;
|
||||
|
||||
/** computes the timeline sample (sample) of an event whose coordinates
|
||||
* are in window units (pixels, no scroll offset).
|
||||
*/
|
||||
|
@ -169,6 +169,20 @@ Editor::window_event_sample (GdkEvent const * event, double* pcx, double* pcy) c
|
||||
return pixel_to_sample (d.x);
|
||||
}
|
||||
|
||||
timepos_t
|
||||
Editor::canvas_event_time (GdkEvent const * event, double* pcx, double* pcy) const
|
||||
{
|
||||
timepos_t pos (canvas_event_sample (event, pcx, pcy));
|
||||
|
||||
if (default_time_domain() == Temporal::AudioTime) {
|
||||
cerr << "E::cet returns audio\n";
|
||||
return pos;
|
||||
}
|
||||
|
||||
cerr << "E::cet returns beats\n";
|
||||
return timepos_t (pos.beats());
|
||||
}
|
||||
|
||||
samplepos_t
|
||||
Editor::canvas_event_sample (GdkEvent const * event, double* pcx, double* pcy) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user