13
0

formatting timecode: use a semicolon to indicate DF

git-svn-id: svn://localhost/ardour2/branches/3.0@13272 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus 2012-10-14 16:17:40 +00:00
parent a9c9d5072c
commit 96f035e629
2 changed files with 6 additions and 4 deletions

View File

@ -578,13 +578,15 @@ timecode_format_name (TimecodeFormat const t)
return "??"; return "??";
} }
std::string timecode_format_time (Timecode::Time& TC) std::string timecode_format_time (Timecode::Time TC)
{ {
char buf[32]; char buf[32];
if (TC.negative) { 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 { } 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); return std::string(buf);
} }

View 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_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 ( std::string timecode_format_sampletime (
int64_t sample, int64_t sample,