summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
AgeCommit message (Collapse)Author
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
2012-01-05remove debugging outputPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11167 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-05make extending the tempo map O(N) in the section to be filled in, rather ↵Paul Davis
than O(N) in the overall length of the map, and clean up some other details git-svn-id: svn://localhost/ardour2/branches/3.0@11166 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-05remove un-needed TempoMap::frame_time_rt()Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11165 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-05possibly fix deadlocking issues with tempo map by rearranging code and ↵Paul Davis
adding RT variants for a couple of functions that would normally try to rebuild the map when necessary; instead the variants throw an exception and the RT code that called them tries to do something reasonable git-svn-id: svn://localhost/ardour2/branches/3.0@11164 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-04try to clean up locking issues with TempoMapPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11161 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-04fix error in framepos_{plus,minus}_bbt() which miscounted beats while ↵Paul Davis
stepping through bars - stops dragged MIDI notes from ending up in the wrong place, and more git-svn-id: svn://localhost/ardour2/branches/3.0@11159 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-04fix (?) tricky locking issues in the tempo map by adding a second lock and ↵Paul Davis
independently locking the metrics and the map itself git-svn-id: svn://localhost/ardour2/branches/3.0@11157 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-04implement TempoMap::framepos_minus_beats() using new bar|beat map structure, ↵Paul Davis
and fix accuracy of TempoMap::framepos_plus_bbt() git-svn-id: svn://localhost/ardour2/branches/3.0@11155 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-04use BBTPoint::is_bar() rather than ::beat == 1 ; implement ↵Paul Davis
TempoMap::framepos_plus_{beats,bbt}() with new map structure (not totally finished or accurate yet); prevent crash when dragging a marker to replace the initial tempo/meter markers git-svn-id: svn://localhost/ardour2/branches/3.0@11154 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-03Remove unused variables.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11153 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-03save 4 bytes per Bar|Beat point in the tempo mapPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11147 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-03return two iterators into the Bars|Beats list of the tempo map rather than ↵Paul Davis
making a copy; use iterators in the GUI git-svn-id: svn://localhost/ardour2/branches/3.0@11146 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-03more tempo fixes, including handling multiple metrics at the same place, and ↵Paul Davis
fixing round_to_beat_subdivision(). almost done now... git-svn-id: svn://localhost/ardour2/branches/3.0@11145 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-03Remove unused variables.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11135 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-02intermediate commit as all tempo/meter stuff starts to walk the precompute ↵Paul Davis
Bars|Beats list. Still have ::round_to_beat_subdivision() to fix. haven't really done any thorough testing at this point, but basic stuff seems OK git-svn-id: svn://localhost/ardour2/branches/3.0@11131 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-02new approach to tempo/meter: compute and store the entire map (every ↵Paul Davis
bar|beat point), thus enabling us to use the same computation to set the BBT points AND the metric markers (tempo + meter) on the audio timeline. It is known that snapping to the BBT grid doesn't work correctly right now, but this probably caused by the separate code in TempoMap::round_to_type() and i'll dig into that tomorrow. Note that the Bar|beat point list is evaluated "lazily" - we'll never store more than anyone actually needs to display or know, other than 1 minute's worth starting from frame zero git-svn-id: svn://localhost/ardour2/branches/3.0@11129 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-30Add assert.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11119 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-29clean up comments and commented codePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11110 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-29next iteration of tempo map stuff - fixes off-by-one issues with bar ↵Paul Davis
offset<->beat math git-svn-id: svn://localhost/ardour2/branches/3.0@11109 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-28a huge set of changes to tempo+meter handling. testing feedback requested. ↵Paul Davis
the_CLA, you know who i mean :) git-svn-id: svn://localhost/ardour2/branches/3.0@11103 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-21followup to the previous tempo-dragging commit: use argument to ↵Paul Davis
Drag::aborted() to know if we moved; update the frame position of tempo map metrics when we remove a tempo mark (should fix visual glitches when dragging tempo) git-svn-id: svn://localhost/ardour2/branches/3.0@11049 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-19rename Timecode::BBT_Time::ticks_per_beat to ↵Paul Davis
Timecode::BBT_Time::ticks_per_bar_division which is a more accurate and informative name. The number doesn't describe the smallest division of a "beat" (which is only defined contextually anyway), but rather the smallest division of the the divisions of a bar. If using a meter of 4/8, there are 4 divisions per bar, and we can divide each one into ticks_per_bar_division pieces; in a separate meter (section) of 3/8, there are 3 divisions per bar, each of which can be divided into ticks_per_bar_division_pieces. git-svn-id: svn://localhost/ardour2/branches/3.0@11022 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-19fix a number of errors with BBT time computations, mostly notably ones ↵Paul Davis
related to tempo-only change git-svn-id: svn://localhost/ardour2/branches/3.0@11020 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-16update position of tempo map metrics when a meter marker is removedPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@11013 d708f5d6-7413-0410-9779-e7cbd77b26cf