summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
AgeCommit message (Collapse)Author
2015-10-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-10-04globally remove all trailing whitespace from ardour code base.Paul Davis
Paul Davis was responsible for introducing almost all of this.
2015-06-25Try to avoid coincident tempo/meter markers when removing timeColin Fletcher
If a tempo or meter marker exists immediately after the range being removed by a 'remove time' operation, don't try to move the last marker within the range being removed to the same position. Ideally, TempoMap::remove_time() should do the same stuff as insert_time() to make sure that meter changes only occur on bar lines, but that's for another time.
2015-06-25rename TempoMap::cut_time() to remove_time()Colin Fletcher
Everywhere else, 'cut time' has been renamed to 'remove time': for consistency, rename this one remaining function to match.
2015-06-19also log session-load error to stderr.Robin Gareus
If the session fails to load, the editor and error-log window will never be visible.
2015-04-21Port 'Cut time' code from MixbusColin Fletcher
Copy the 'Cut time' code from Mixbus, making a few obvious fixes to work in A3 (e.g. nframes_t => framepos_t / framecnt_t). Seems to work to move & remove markers, tempo & meter markers, and regions on selected tracks. Still TODO: - use existing A3 'Insert time' dialogue - make it respect 'No selection = all tracks' - rename the command to something like 'Remove time' or 'Delete time': 'Cut' sounds to me as if the removed range should end up on the clipboard ready to be pasted somewhere, which of course it doesn't.
2015-04-21merge fix for tempo branchBen Loftis
2015-04-01remove race condition when editing tempo/meter information.Paul Davis
Lock was not held across a replace_{tempo,meter}() operation because of re-use of {remove,add}_{tempo,meter}. Moved functional code into _locked variants so that replace operation can hold lock across its entire active lifetime.
2015-03-31fix OSX/PPC 10.4 long mathsRobin Gareus
2015-03-09Make editing of meter work at the current positionColin Fletcher
Add a function TempoMap::meter_section_at(), similar to TempoMap::tempo_section_at() but returning the meter section at the given position, and use this to make editing meter changes from the main clock work on the meter that's in effect at the current position.
2015-01-19use C locale, because POSIX locale is not supported on windows, and ↵Ben Loftis
operation is undefined. C works on all platforms
2015-01-07MusicalTime => Beats.David Robillard
2014-11-22Fix quantization and other time-related ops.David Robillard
2014-11-22Wrap MusicalTime in a class.David Robillard
This lets us get a more explicit handle on time conversions, and is the main step towards using actual beat:tick time and getting away from floating point precision problems.
2014-11-22Fix const violation warnings in tempo.cc.David Robillard
2014-11-17Fix "maybe" rounding bug.David Robillard
Introduced in d63161426f256c293c92b73f1be4b375f962d298.
2014-11-16Add "maybe" rounding modes for rounding only if necessary.David Robillard
2014-11-16Use an enum for RoundMode instead of magic numbers.David Robillard
No functional changes in this one (for easier auditing), but towards having round up/down only if necessary modes, rather than kludging around that situation with a double round as we do currently.
2014-11-17add some assert() messages.Robin Gareus
as hints clang static analyzer "Called C++ object pointer is null"
2014-11-14add abort() to non-reached codeRobin Gareus
This cleans up a lot of false-positives in static analysis and also helps compilers to optimize code paths in general. (tagging the fatal stingstream operator as ‘noreturn’ is far less trivial)
2014-05-14don't use llrint on already-integral variablesDevin J. Pohly
This could trick people into thinking that there is a floating-point type hiding behind the typedef instead of an integer.
2014-05-14fix accumulated rounding error in BBT gridDevin J. Pohly
Though current_frame is an integral type (framepos_t), it was being added to as if it were floating-point, leading to an ever-increasing rounding error when creating the grid for bars/beats/ticks.
2012-11-17Sent precise transport information to LV2 plugins via events.David Robillard
We send the full transport state (frame position, BBT time, transport speed, meter) to the plugin: * At the start of a cycle whenever a relocate or transport speed change has occurred * On every occurrence of a meter change within a cycle This means the plugin gets a sample accurate meter/tempo map, even if the meter changes in the middle of a cycle. However, this is not quite right yet: things can get wonky if the tempo map is edited while rolling, since this code will not detect the change and fail to update the plugin at the start of the cycle. Other changes: * Factor out TempoMetric::set_metric() and simplify some tempo functions * Clean up LV2 URID stuff git-svn-id: svn://localhost/ardour2/branches/3.0@13513 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-11-16Tidy up tempo.h and add some documentation.David Robillard
Fix some const violating casts. No functional changes. git-svn-id: svn://localhost/ardour2/branches/3.0@13512 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-10-01do not add in ticks in the "at" position when computing BBT duration ↵Paul Davis
somewhere on the timeline (fixes issues with nudging etc. git-svn-id: svn://localhost/ardour2/branches/3.0@13201 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-25convert from Glib:: to Glib::Threads for all thread-related APIPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-25check for multiple tempo/meter marks at the same location, which somehow ↵Paul Davis
ardour2 allowed. don't handle it but at least report the error git-svn-id: svn://localhost/ardour2/branches/3.0@13082 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-24Remove over 500 unnecessary includes (including 54 of session.h).David Robillard
It's slightly possible that this causes trivial build failures on different configurations, but otherwise shouldn't cause any problems (i.e. no actual changes other than include/naming/namespace stuff). I deliberately avoided removing libardour-config.h since this can mysteriously break things, though a few of those do seem to be unnecessary. This commit only targets includes of ardour/*.h. There is also a very large number of unnecessary includes of stuff in gtk2_ardour; tackling that should also give a big improvement in build time when things are modified. git-svn-id: svn://localhost/ardour2/branches/3.0@12420 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-02more fixes/tweaks from the land of the lionPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@12150 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-02a variety of mostly unused parameter errors from OS X Lion's compilerPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@12148 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-20Fix some warnings.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@12048 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-15Update MidiRegion::_start_beats on trimming the front of a MIDI region; ↵Carl Hetherington
reset _start_beats with _start on MidiRegion::fix_negative_start(). May help with #4736. git-svn-id: svn://localhost/ardour2/branches/3.0@11984 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-15Fix overflow when computing framewalk_to_beats with -ve pos; fixes #4694.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11982 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-24Move reader lock to avoid deadlock when calling bbt_time().Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11342 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-24Remove unused variable.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11338 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-17fix initial filling out of tempo bars|beats map after loading from XML by ↵Paul Davis
extending it (at least) to the last tempo/meter metric git-svn-id: svn://localhost/ardour2/branches/3.0@11255 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-17fix bug with tempo computation where passed in positions or offsets are negativePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11252 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-08don't allow/create non-beat aligned tempo changes in response to meter ↵Paul Davis
changes. round the position of a tempo change the earlier beat that it would have followed according to its bar_offset value git-svn-id: svn://localhost/ardour2/branches/3.0@11199 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-08fix up a few zero-boundary condition errors in TempoMapPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11196 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-08tempo map debugging with dlpPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11193 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-07when moving tempo and metric sections around (or adding new ones), prevent ↵Paul Davis
the existence of two tempo markers within the same beat, as well as two meter markers within the same bar (though i think this was prevented already by snapping meter sections to beat=1; make round_to_beats() work when dir==0 ("true rounding"); a bit of code cleanup git-svn-id: svn://localhost/ardour2/branches/3.0@11185 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-07fix positioning of grid line after a non-beat aligned tempo changePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11182 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-07a better fix for timestamping non-beat-aligned tempo changesPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11181 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-06remove extra TempoMap::dump() callPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11180 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-06re-adjust computation of non-beat aligned tempo changePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11179 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-06adjust computation of non-beat aligned tempo change, and let ↵Paul Davis
TempoMap::dump() be used "wherever" git-svn-id: svn://localhost/ardour2/branches/3.0@11178 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-06fix frame/beat walking to pass unit testsPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11176 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-06partially revert some of the recent work on tempo to reflect new ↵Paul Davis
understanding of the problem. behaviour is now believed to be totally correct but awaiting a bit more testing git-svn-id: svn://localhost/ardour2/branches/3.0@11171 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-05fix some more crashes with tempo map manipulationsPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11170 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-05fix over-zealous optimization in tempo map, caused crashPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11168 d708f5d6-7413-0410-9779-e7cbd77b26cf