summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/tempo.h
AgeCommit message (Collapse)Author
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-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-04-14Fix a few framecnt / framepos type confusions.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11975 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-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-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 (?) 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-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-03More test friends.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11138 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-03Fix test build.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11134 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-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-13more fun and games with meter and the tempo map: rename ↵Paul Davis
Meter::beats_per_bar() to Meter::divisions_per_bar() so that its clear(er) on what it is actually returning; use Meter::divisions_per_bar() in more (all?) places that need it; fix up dragging meter marks by removing the relevant meter section from the map while we drag; operator<< for some tempo-related objects git-svn-id: svn://localhost/ardour2/branches/3.0@10995 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-12fundamentally alter how we compute frames_per_beat(). this follows much ↵Paul Davis
discussion on IRC. fundamentally, tempo and ONLY tempo affects the computation of frames_per_beat(), meter has no effect at all. However, following typical DAW conventions, we continue to want the "grid" to show metric divisions, not fixed beats, so add a new method (Meter::frames_per_division()) that retains the old math which takes meter into account. This commit will alter the behaviour of MIDI notes in any session with multiple time signatures. They will likely break. Unfortunately, there is no alternative to this breakage at this time. git-svn-id: svn://localhost/ardour2/branches/3.0@10988 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-11Keep track of MIDI region's start positions in beats, toCarl Hetherington
match the source, so that starts are not corrupted when tempos change (#4494). git-svn-id: svn://localhost/ardour2/branches/3.0@10976 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-10Slightly simpler implementation of framewalk_to_beats.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@10967 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-10Add fixed-up framepos_plus_beats() and use it for the BeatsFramesConverter, ↵Carl Hetherington
since it only ever passed in beats to framepos_plus_bbt anyway. git-svn-id: svn://localhost/ardour2/branches/3.0@10964 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-01Fix broken whitespace. I'd apologize for the compile times if it was my ↵David Robillard
fault :D git-svn-id: svn://localhost/ardour2/branches/3.0@9654 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-14move ticks per beat from Meter to Timecode::BBT_Time, add new constructor ↵Paul Davis
for BBT_Time based on a double value; reduce BeatFramesConverted to 1 liners pending likely removal git-svn-id: svn://localhost/ardour2/branches/3.0@8277 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-14implement methods in TempoMap for walking a given distance along a tempo map ↵Paul Davis
and returning the resulting time; add a new property, _length_beats, to MidiRegion; use previously mentioned methods to keep _length_beats up to date as regions are moved AND as tempo map changes occur git-svn-id: svn://localhost/ardour2/branches/3.0@8274 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-14Rename libmusictime libtimecode (consistent with already used namespace ↵David Robillard
"Timecode"). Move BBT_Time to libtimecode. git-svn-id: svn://localhost/ardour2/branches/3.0@8271 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-03Remove all use of nframes_t.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-17megaopus patch #2 for today: remove nframes64_t and sframes_t from sourcePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7792 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-02Prevent multiple tempo / meter changes being inserted at the same pointCarl Hetherington
on the timeline; adding a new change at the same time as an existing one will replace the existing one. Should prevent #769 from happening. Some cleanups and tweaks to tempo / meter dialogues. Desensitize Remove menu option for those changes that can't be removed. git-svn-id: svn://localhost/ardour2/branches/3.0@7045 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-02-19change PropertyChange from a bitfield into a real object, with all the many ↵Paul Davis
widespread changes that causes git-svn-id: svn://localhost/ardour2/branches/3.0@6701 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-02-18the Properties & 64bit region commitPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@6695 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-02-10Move ARDOUR::Change into PBD so that Stateful can be aware ofCarl Hetherington
what Change a State reflects. Hence allow Stateful to do some of the work of set/get_state in Region. git-svn-id: svn://localhost/ardour2/branches/3.0@6671 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-19use new syntax for connecting to backend signals that enforces explicit ↵Paul Davis
connection scope, plus a few other related matters git-svn-id: svn://localhost/ardour2/branches/3.0@6376 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-17switch to using boost::signals2 instead of sigc++, at least for libardour. ↵Paul Davis
not finished yet, but compiles, loads sessions, records and can close a session without a crash git-svn-id: svn://localhost/ardour2/branches/3.0@6372 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-28* libardour uses ARDOUR::nframes_t and ARDOUR::nframes64_t explicitly in headersPaul Davis
* use explicit operator<< and operator>> that in turn use PBD::EnumWriter when serializing and deserializing to/from rc files * adds scrolling in mixer window (from 2.X) * BBT math stuff - untested, but basically operational * move LocaleGuard into its own file(s) in libs/pbd * Tempo now uses nframes64_t everywhere (except for sample rate values) * as in 2.X, use mkstemp and hack to avoid temp file nonsense, and remove erroneous free() from disk stats output git-svn-id: svn://localhost/ardour2/branches/3.0@5961 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-28Add bbt_add that does not take Metric parameter.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5955 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-27Update BBT_Time add and subtract interfaces (stubs, just for unit test ↵David Robillard
building). Build unit tests against libardour itself rather than compiling in bits. git-svn-id: svn://localhost/ardour2/branches/3.0@5949 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-27new SnapBBT debug option, split out BBT_time and start work on BBT ↵Paul Davis
arithmetic framework. this will cause a full recompile, so find something else to do git-svn-id: svn://localhost/ardour2/branches/3.0@5936 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-25Remove Session dependency from BeatsFramesConverter.David Robillard
More constey TempoMap accessors. git-svn-id: svn://localhost/ardour2/branches/3.0@5916 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15rework Stateful::set_state() patch to avoid default version argumentPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5787 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15Part 1 of loading 2.X sessions; some things work, some things don't, hacks ↵Carl Hetherington
a-plenty. LOADING 2.X SESSIONS WITH THIS COMMIT IN PLACE WILL (PROBABLY) CORRUPT THE .ardour FILE, MAKING THE SESSION UNLOADABLE ON 2.X AND LOSING INFORMATION. So don't do that unless you make a backup of the session file first. git-svn-id: svn://localhost/ardour2/branches/3.0@5786 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-14Strip trailing whitespace and fix other whitespace errors (e.g. space/tab ↵David Robillard
mixing). Whitespace changes only. Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-03the basics of step editing, more details to followPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5629 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-08-27lots of MIDI editing stuff. to be explained on the website when its donePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5596 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-06-08Allow Insert Time option to move tempos and time sig changes, as per #1951.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@5132 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-12Remove most using declarations from header files.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@5069 d708f5d6-7413-0410-9779-e7cbd77b26cf