summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
AgeCommit message (Collapse)Author
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
2011-12-13Remove meter from beats calculations now that it is noCarl Hetherington
longer important. git-svn-id: svn://localhost/ardour2/branches/3.0@10997 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-13fix up XML property name for Meter::beats_per_bar (w/backward compat)Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@10996 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-11Similar hacks to framepos_minus_beats to handle -veCarl Hetherington
positions as were appled to framepos_plus_beats. git-svn-id: svn://localhost/ardour2/branches/3.0@10984 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-10Fix framewalk_to_beats when it traverses more than oneCarl Hetherington
metric change. git-svn-id: svn://localhost/ardour2/branches/3.0@10970 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-12-09Fix framewalk_to_beats with non-beat-aligned starting positions.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@10956 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-01significantly reduce rounding error when doing framepos_t + BBT mathPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@10852 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-11-24If a tempo change is inserted some way through a bar, fix up the time ↵Carl Hetherington
signature of the previous bar so that the tempo map remains consistent. Should help with #4200. git-svn-id: svn://localhost/ardour2/branches/3.0@10816 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-09-06Correct fix for previous commit.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@10058 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-09-06Do not move the initial tempo / meter changes at 0 time when inserting time ↵Carl Hetherington
(#4313). git-svn-id: svn://localhost/ardour2/branches/3.0@10057 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
2011-05-23Assorted doxygen fixes; no functional changes.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@9575 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-15Fix weird whitespace.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@9154 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-15Fix undefined operations (according to gcc 4.5.2).David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@9153 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-15Fix more broken whitespace.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@9152 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-02-26Add comment about some inaccuracies in framepos_plus_bbt.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8972 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-17Fix comment. Fix believed erroneous add of ticks to a fractional beats value.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8293 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-17fix BeatFramesConverter so that it at least works even if its not optimally ↵Paul Davis
named/designed git-svn-id: svn://localhost/ardour2/branches/3.0@8290 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-16Fix comment.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8288 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-07-23catch thrown exception when rounding backwards from a position too close to zeroPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7481 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-27Use bbt_add and bbt_subtract to do proper BBT maths in ↵Carl Hetherington
round_to_beat_subdivision. git-svn-id: svn://localhost/ardour2/branches/3.0@7172 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-05-01Fix snap to bars to account for the fact that the beats are counted from 1 ↵Carl Hetherington
rather than 0. git-svn-id: svn://localhost/ardour2/branches/3.0@7034 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
2009-12-20remove a couple of boost::signals2 trouble spots; fix some --strict compile ↵Paul Davis
time warnings git-svn-id: svn://localhost/ardour2/branches/3.0@6378 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-12-06Merged revisions 6293,6296-6306,6308 via svnmerge from Taybin Rutkin
svn+ssh://ardoursvn@subversion.ardour.org/ardour2/branches/build_fixes ........ r6293 | trutkin | 2009-12-05 08:49:37 -0500 (Sat, 05 Dec 2009) | 2 lines fix if-statement in build script ........ r6296 | trutkin | 2009-12-05 09:30:19 -0500 (Sat, 05 Dec 2009) | 5 lines rearrange GTKOSX and darwin dependencies - moved some GTKOSX include paths to generic darwin - made GTKOSX dependent on being on darwin anyways ........ r6297 | trutkin | 2009-12-05 09:35:09 -0500 (Sat, 05 Dec 2009) | 2 lines move coreaudio and audiounit handling to darwin section ........ r6298 | trutkin | 2009-12-05 09:53:40 -0500 (Sat, 05 Dec 2009) | 3 lines use True/False instead of 1/0 fix another if-statement where it should be an elif-statement ........ r6299 | trutkin | 2009-12-05 14:11:09 -0500 (Sat, 05 Dec 2009) | 10 lines fixes to get libardour building - can't cast away volatile, so copy _transport_frame before emitting it. - const_reverse_iterator::operator!=() isn't defined in this version of gcc. - removed annoying HERE WE ARE CAAudioFile.h #warning. - removed unnecessary include of sndfile.h in session.h. - we don't want to set -march=i686 on the mac, so indent this if-statement so it's only run on linux. - DEBUG_STR() fails in the NDEBUG case, so wrap its use in an #ifndef NDEBUG ........ r6300 | trutkin | 2009-12-05 15:48:29 -0500 (Sat, 05 Dec 2009) | 2 lines remove old scons-style CXXFLAGS_FOO in favor of just CXXFLAGS ........ r6301 | trutkin | 2009-12-05 16:01:10 -0500 (Sat, 05 Dec 2009) | 8 lines clean up configure flags - removed useless --aubio and --syslibs flags. The syslibs value is ignored as we don't bring our own libraries with us anymoreand we use aubio automatically if it's available - added ways to turn off fpu_optimization and NLS - fixed compiling on the mac without fpu_optimization ........ r6302 | trutkin | 2009-12-05 18:12:46 -0500 (Sat, 05 Dec 2009) | 5 lines go back to prior uselib method for COREAUDIO, AUDIOUNIT, and GTKOSX - fixed compile of CoreAudioSource - re-did inclusion of coremidi_midiport.cc to depend on COREAUDIO presence ........ r6303 | trutkin | 2009-12-05 18:59:02 -0500 (Sat, 05 Dec 2009) | 5 lines fixed compiler warnings about classes with virtual member functions, but no virtual destructor. - Changed Metering to not use foo() = 0; to indicate it shouldn't be instantiated, but private: Metering(), which is more idiomatic. ........ r6304 | trutkin | 2009-12-05 19:25:41 -0500 (Sat, 05 Dec 2009) | 2 lines TOP_MENUBAR isn't used when building ardour.menus. Removed. ........ r6305 | trutkin | 2009-12-05 19:46:11 -0500 (Sat, 05 Dec 2009) | 5 lines fix some AudioUnit compile errors - update AudioUnit to use ChanCount - fix some namespacing issues in audio_unit.h ........ r6306 | trutkin | 2009-12-05 20:08:48 -0500 (Sat, 05 Dec 2009) | 2 lines make --extra-warn useful ........ r6308 | trutkin | 2009-12-05 22:59:42 -0500 (Sat, 05 Dec 2009) | 10 lines fix compiling/linking with --coreaudio - rearrange ardour_ui.h header in editor.cc to avoid conflict - midi++ depends on OSX as well as COREAUDIO - fixed including frameworks - tweaked --extra-warn again. it's kinda redundent with --strict - improved indentation in wscript - use #ifdef HAVE_COREMIDI, not #if HAVE_COREMIDI. #if isn't interchangable with #ifdef and won't work if HAVE_COREMIDI is defined with no value. ........ git-svn-id: svn://localhost/ardour2/branches/3.0@6310 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-11-18use a simpler (and likely correct) round-to-nearest-bar implementationPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@6119 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-11-12comments for BBT math methods; remove chunks from GUI; split location UI ↵Paul Davis
into a widget and a window; add the widget part to the editor RHS notebook. this is unfinished - it looks absurd. but its the starting point for a reworking of the location UI in its rightful place git-svn-id: svn://localhost/ardour2/branches/3.0@6071 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-11-12Fix uninitialised variable in BBT maths.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@6069 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-21Fix unused parameter warnings since GCC apparently doesn't feel like ↵David Robillard
listening to -Wno-unused-parameter git-svn-id: svn://localhost/ardour2/branches/3.0@5835 d708f5d6-7413-0410-9779-e7cbd77b26cf