Relative snap - support magnetic mode (hackishly for now)

This commit is contained in:
nick_m 2015-05-17 04:26:05 +10:00
parent bbafb8f137
commit 91a34c596d
9 changed files with 92 additions and 11 deletions

View file

@ -254,12 +254,24 @@ public:
*/
double snap_to_pixel(double x);
/** Snap a region relative pixel coordinate to pixel units explicitly (no magnetic snap).
* @param x a pixel coordinate relative to region start
* @return the explicitly snapped pixel coordinate relative to region start
*/
double snap_to_pixel_no_magnets (double x);
/** Snap a region relative pixel coordinate to frame units.
* @param x a pixel coordinate relative to region start
* @return the snapped framepos_t coordinate relative to region start
*/
framepos_t snap_pixel_to_sample(double x);
/** Explicitly snap a region relative pixel coordinate to frame units (no magnetic snap).
* @param x a pixel coordinate relative to region start
* @return the explicitly snapped framepos_t coordinate relative to region start
*/
framepos_t snap_pixel_to_sample_no_magnets (double x);
/** Convert a timestamp in beats into frames (both relative to region position) */
framepos_t region_beats_to_region_frames(Evoral::Beats beats) const;
/** Convert a timestamp in beats into absolute frames */