Clean up libtimecode, make license of bbt_time.h LGPL.

git-svn-id: svn://localhost/ardour2/branches/3.0@8272 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2010-12-14 19:07:50 +00:00
parent 4b861e6039
commit 9882fe9ab0
3 changed files with 142 additions and 143 deletions

View file

@ -1,19 +1,19 @@
/*
Copyright (C) 2006 Paul Davis
Copyright (C) 2006-2010 Paul Davis
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define Timecode_IS_AROUND_ZERO(sm) (!(sm).frames && !(sm).seconds && !(sm).minutes && !(sm).hours)
@ -123,7 +123,6 @@ decrement( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
if (timecode.negative || Timecode_IS_ZERO (timecode)) {
timecode.negative = false;
wrap = increment (timecode, subframes_per_frame);
@ -332,7 +331,6 @@ seconds_floor( Time& timecode )
if (!(timecode.drop)) {
timecode.frames = 0;
} else {
if ((timecode.minutes % 10) && (timecode.seconds == 0)) {
timecode.frames = 2;
} else {

View file

@ -1,20 +1,19 @@
/*
Copyright (C) 2002-2009 Paul Davis
Copyright (C) 2002-2010 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __timecode_bbt_time_h__

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2006 Paul Davis
Copyright (C) 2006-2010 Paul Davis
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@ -16,8 +16,8 @@
675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __ardour_timecode_h__
#define __ardour_timecode_h__
#ifndef __timecode_time_h__
#define __timecode_time_h__
#include <ostream>
#include <inttypes.h>
@ -57,7 +57,9 @@ struct Time {
if (negative) {
ostr << '-';
}
ostr << hours << ':' << minutes << ':' << seconds << ':' << frames << '.' << subframes << " @" << rate << (drop ? " drop" : " nondrop");
ostr << hours << ':' << minutes << ':' << seconds << ':'
<< frames << '.' << subframes
<< " @" << rate << (drop ? " drop" : " nondrop");
return ostr;
}
@ -79,4 +81,4 @@ void hours_floor( Time& timecode );
std::ostream& operator<< (std::ostream& ostr, const Timecode::Time& t);
#endif // __ardour_timecode_h__
#endif // __timecode_time_h__