mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
fix rounding issue when dragging video with fractional fps
This commit is contained in:
parent
4c60dd983c
commit
badb902bc0
2 changed files with 2 additions and 2 deletions
|
|
@ -1687,7 +1687,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move)
|
||||||
}
|
}
|
||||||
|
|
||||||
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
|
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
|
||||||
dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(dt);
|
dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(_startdrag_video_offset+dt) - _startdrag_video_offset;
|
||||||
|
|
||||||
if (_max_backwards_drag >= 0 && dt <= - _max_backwards_drag) {
|
if (_max_backwards_drag >= 0 && dt <= - _max_backwards_drag) {
|
||||||
dt = - _max_backwards_drag;
|
dt = - _max_backwards_drag;
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
|
||||||
float get_apv(); /* audio samples per video frame; */
|
float get_apv(); /* audio samples per video frame; */
|
||||||
ARDOUR::framecnt_t get_duration () { return video_duration;}
|
ARDOUR::framecnt_t get_duration () { return video_duration;}
|
||||||
ARDOUR::frameoffset_t get_offset () { return video_offset;}
|
ARDOUR::frameoffset_t get_offset () { return video_offset;}
|
||||||
ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return floor(offset/get_apv())*get_apv(); }
|
ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return rint(offset/get_apv())*get_apv(); }
|
||||||
void set_offset (ARDOUR::frameoffset_t offset) { video_offset = quantify_frames_to_apv(offset); } // this function does not update video_offset_p, call save_undo() to finalize changes to this! - this fn is currently only used from editor_drag.cc
|
void set_offset (ARDOUR::frameoffset_t offset) { video_offset = quantify_frames_to_apv(offset); } // this function does not update video_offset_p, call save_undo() to finalize changes to this! - this fn is currently only used from editor_drag.cc
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue