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 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.
timecode.negative = false;
return SECONDS;
}
-
+
timecode.negative = false;
wrap = decrement (timecode, subframes_per_frame);
if (!Timecode_IS_ZERO (timecode)) {
}
break;
}
-
+
if (wrap == SECONDS) {
if (timecode.seconds == 59) {
timecode.seconds = 0;
} else {
timecode.frames++;
}
-
+
return wrap;
}
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);
timecode.negative = true;
return SECONDS;
}
-
+
switch ((int)ceil (timecode.rate)) {
case 24:
if (timecode.frames == 0) {
}
break;
}
-
+
if (wrap == SECONDS) {
if (timecode.seconds == 0) {
timecode.seconds = 59;
} else {
timecode.frames--;
}
-
+
if (Timecode_IS_ZERO (timecode)) {
timecode.negative = false;
}
-
+
return wrap;
}
increment_subframes (Time& timecode, uint32_t subframes_per_frame)
{
Wrap wrap = NONE;
-
+
if (timecode.negative) {
timecode.negative = false;
wrap = decrement_subframes (timecode, subframes_per_frame);
}
return wrap;
}
-
+
timecode.subframes++;
if (timecode.subframes >= subframes_per_frame) {
timecode.subframes = 0;
decrement_subframes (Time& timecode, uint32_t subframes_per_frame)
{
Wrap wrap = NONE;
-
+
if (timecode.negative) {
timecode.negative = false;
wrap = increment_subframes (timecode, subframes_per_frame);
timecode.negative = true;
return wrap;
}
-
+
if (timecode.subframes <= 0) {
timecode.subframes = 0;
if (Timecode_IS_ZERO (timecode)) {
increment_seconds (Time& timecode, uint32_t subframes_per_frame)
{
Wrap wrap = NONE;
-
+
// Clear subframes
frames_floor (timecode);
-
+
if (timecode.negative) {
// Wrap second if on second boundary
wrap = increment (timecode, subframes_per_frame);
timecode.frames = 59;
break;
}
-
+
// Increment by one frame
wrap = increment (timecode, subframes_per_frame);
}
-
+
return wrap;
}
{
// Clear subframes
frames_floor (timecode);
-
+
// Go to lowest possible frame in this second
switch ((int)ceil (timecode.rate)) {
case 24:
}
break;
}
-
+
if (Timecode_IS_ZERO (timecode)) {
timecode.negative = false;
}
increment_minutes (Time& timecode, uint32_t subframes_per_frame)
{
Wrap wrap = NONE;
-
+
// Clear subframes
frames_floor (timecode);
-
+
if (timecode.negative) {
// Wrap if on minute boundary
wrap = increment_seconds (timecode, subframes_per_frame);
// Wrap minute by incrementing second
wrap = increment_seconds (timecode, subframes_per_frame);
}
-
+
return wrap;
}
increment_hours (Time& timecode, uint32_t subframes_per_frame)
{
Wrap wrap = NONE;
-
+
// Clear subframes
frames_floor (timecode);
-
+
if (timecode.negative) {
// Wrap if on hour boundary
wrap = increment_minutes (timecode, subframes_per_frame);
timecode.minutes = 59;
wrap = increment_minutes (timecode, subframes_per_frame);
}
-
+
return wrap;
}
timecode.seconds = 0;
timecode.frames = 0;
timecode.subframes = 0;
-
+
if (Timecode_IS_ZERO (timecode)) {
timecode.negative = false;
}
} // namespace Timecode
-std::ostream&
-operator<<(std::ostream& ostr, const Timecode::Time& t)
+std::ostream&
+operator<<(std::ostream& ostr, const Timecode::Time& t)
{
return t.print (ostr);
}