2 Copyright (C) 2002-2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "timecode/bbt_time.h"
23 using namespace Timecode;
25 const double BBT_Time::ticks_per_beat = 1920.0;
27 BBT_Time::BBT_Time (double dbeats)
29 /* NOTE: this does not construct a BBT time in a canonical form,
30 in that beats may be a very large number, and bars will
35 beats = rint (floor (dbeats));
36 ticks = rint (floor (BBT_Time::ticks_per_beat * fmod (dbeats, 1.0)));