- framepos_t snap_pixel_to_frame(double x);
-
- /** Snap a region relative frame 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_frame_to_frame(framepos_t x);
-
- /** Convert a timestamp in beats to frames (both relative to region start) */
- framepos_t beats_to_frames(double beats) const;
-
- /** Convert a timestamp in frames to beats (both relative to region start) */
- double frames_to_beats(framepos_t) const;
-
- void goto_previous_note ();
- void goto_next_note ();
- void change_note_lengths (bool, bool, Evoral::MusicalTime beats, bool start, bool end);
- void change_velocities (bool up, bool fine, bool allow_smush);
+ framepos_t snap_pixel_to_sample(double x, bool ensure_snap = false);
+
+ /** 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 */
+ framepos_t region_beats_to_absolute_frames(Evoral::Beats beats) const {
+ return _region->position() + region_beats_to_region_frames (beats);
+ }
+ /** Convert a timestamp in frames to beats (both relative to region position) */
+ Evoral::Beats region_frames_to_region_beats(framepos_t) const;
+ double region_frames_to_region_beats_double(framepos_t) const;
+
+ /** Convert a timestamp in beats measured from source start into absolute frames */
+ framepos_t source_beats_to_absolute_frames(Evoral::Beats beats) const;
+ /** Convert a timestamp in beats measured from source start into region-relative frames */
+ framepos_t source_beats_to_region_frames(Evoral::Beats beats) const {
+ return source_beats_to_absolute_frames (beats) - _region->position();
+ }
+ /** Convert a timestamp in absolute frames to beats measured from source start*/
+ Evoral::Beats absolute_frames_to_source_beats(framepos_t) const;
+
+ ARDOUR::BeatsFramesConverter const & region_relative_time_converter () const {
+ return _region_relative_time_converter;
+ }
+
+ ARDOUR::BeatsFramesConverter const & source_relative_time_converter () const {
+ return _source_relative_time_converter;
+ }
+
+ ARDOUR::DoubleBeatsFramesConverter const & region_relative_time_converter_double () const {
+ return _region_relative_time_converter_double;
+ }
+
+ void goto_previous_note (bool add_to_selection);
+ void goto_next_note (bool add_to_selection);
+ void change_note_lengths (bool, bool, Evoral::Beats beats, bool start, bool end);
+ void change_velocities (bool up, bool fine, bool allow_smush, bool all_together);