Modify some functions to alleviate overflow / precision errors
authorJohn Emmas <johne53@tiscali.co.uk>
Thu, 27 Aug 2015 11:24:21 +0000 (12:24 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Thu, 27 Aug 2015 11:28:45 +0000 (12:28 +0100)
commitada32733c5168dd6b57244e995eef35d0841b49a
tree9a0f84d8925e74a8035e4e37ce25a116fc110ea1
parent1963c3ff10c483bd8e3dec9cbd88cce54656b029
Modify some functions to alleviate overflow / precision errors

'session_frame_to_track_frame()' and its complement, 'track_frame_to_session_frame()' both accept a double and an ARDOUR::framepost_t (int64_t). For convenience these both get converted to long double. However, the functions are often called with very large values (ARDOUR::max_framepos). When this happens, rounding and precision errors can cause overflow issues. This is an attempt to alleviate that problem. Not sure if it's strictly necessary to accommodate negative values - but I'm assuming these could happen if 'speed' was negative (reverse play?)

This is the reason why 'Select All Objects' (and similar functionality) don't work for some users.
libs/ardour/ardour/types.h