summaryrefslogtreecommitdiff
path: root/libs/timecode
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-10-14 16:17:40 +0000
committerRobin Gareus <robin@gareus.org>2012-10-14 16:17:40 +0000
commit96f035e629519965e4b36a029fa5ce3f16a1c0b7 (patch)
treefbe9526eb1aa7c002d1b37d34a29961cc5694c0f /libs/timecode
parenta9c9d5072c9d206616e599b49a7be8317623271a (diff)
formatting timecode: use a semicolon to indicate DF
git-svn-id: svn://localhost/ardour2/branches/3.0@13272 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/timecode')
-rw-r--r--libs/timecode/src/time.cc8
-rw-r--r--libs/timecode/timecode/time.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/libs/timecode/src/time.cc b/libs/timecode/src/time.cc
index b993c3eba0..5a4da10691 100644
--- a/libs/timecode/src/time.cc
+++ b/libs/timecode/src/time.cc
@@ -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);
}
diff --git a/libs/timecode/timecode/time.h b/libs/timecode/timecode/time.h
index b1d34eebb8..8166ba8f39 100644
--- a/libs/timecode/timecode/time.h
+++ b/libs/timecode/timecode/time.h
@@ -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,