summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_clock.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-11-13 02:25:59 +0000
committerRobin Gareus <robin@gareus.org>2012-11-13 02:25:59 +0000
commit06fa1b73e581558ee1b21d0e313db8c2560d422e (patch)
tree0a629a132cbe2f073292c9099a10887fcfce2ca3 /gtk2_ardour/audio_clock.cc
parent3fa84d0caa2fb74471619cff2e44f5db3f0a12c6 (diff)
parse keyboard entered drop-frame timecode delta
git-svn-id: svn://localhost/ardour2/branches/3.0@13476 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r--gtk2_ardour/audio_clock.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index ca1c525a6b..505c06cafa 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -1897,9 +1897,10 @@ bool
AudioClock::timecode_validate_edit (const string&)
{
Timecode::Time TC;
+ char ignored[2];
- if (sscanf (_layout->get_text().c_str(), "%" PRId32 ":%" PRId32 ":%" PRId32 ":%" PRId32,
- &TC.hours, &TC.minutes, &TC.seconds, &TC.frames) != 4) {
+ if (sscanf (_layout->get_text().c_str(), "%" PRId32 ":%" PRId32 ":%" PRId32 "%[:;]%" PRId32,
+ &TC.hours, &TC.minutes, &TC.seconds, &ignored, &TC.frames) != 5) {
return false;
}
@@ -1945,8 +1946,9 @@ AudioClock::frames_from_timecode_string (const string& str) const
Timecode::Time TC;
framepos_t sample;
+ char ignored[2];
- if (sscanf (str.c_str(), "%d:%d:%d:%d", &TC.hours, &TC.minutes, &TC.seconds, &TC.frames) != 4) {
+ if (sscanf (str.c_str(), "%d:%d:%d%[:;]%d", &TC.hours, &TC.minutes, &TC.seconds, &ignored, &TC.frames) != 4) {
error << string_compose (_("programming error: %1 %2"), "badly formatted timecode clock string", str) << endmsg;
return 0;
}