formatting timecode: use a semicolon to indicate DF
authorRobin Gareus <robin@gareus.org>
Sun, 14 Oct 2012 16:17:40 +0000 (16:17 +0000)
committerRobin Gareus <robin@gareus.org>
Sun, 14 Oct 2012 16:17:40 +0000 (16:17 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13272 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/timecode/src/time.cc
libs/timecode/timecode/time.h

index b993c3eba0d991a7adc309aa58452eec380726b3..5a4da106918c664a1617325874b16abd5fa34a39 100644 (file)
@@ -578,13 +578,15 @@ timecode_format_name (TimecodeFormat const t)
        return "??";
 }
 
-std::string timecode_format_time (Timecode::Time& TC)
+std::string timecode_format_time (Timecode::Time TC)
 {
        char buf[32];
        if (TC.negative) {
-               snprintf (buf, sizeof (buf), "-%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, TC.hours, TC.minutes, TC.seconds, TC.frames);
+               snprintf (buf, sizeof (buf), "-%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 "%c%02" PRIu32,
+                               TC.hours, TC.minutes, TC.seconds, TC.drop ? ';' : ':', TC.frames);
        } else {
-               snprintf (buf, sizeof (buf), " %02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, TC.hours, TC.minutes, TC.seconds, TC.frames);
+               snprintf (buf, sizeof (buf), " %02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 "%c%02" PRIu32,
+                               TC.hours, TC.minutes, TC.seconds, TC.drop ? ';' : ':', TC.frames);
        }
        return std::string(buf);
 }
index b1d34eebb80059b9a45ce7723b972a638f4f550d..8166ba8f39b1f73d668d3484adb0b5b8987d719b 100644 (file)
@@ -102,7 +102,7 @@ bool timecode_has_drop_frames(TimecodeFormat const t);
 
 std::string timecode_format_name (TimecodeFormat const t);
 
-std::string timecode_format_time (Timecode::Time& timecode);
+std::string timecode_format_time (Timecode::Time const timecode);
 
 std::string timecode_format_sampletime (
                int64_t sample,