mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 14:45:43 +01:00
parse keyboard entered drop-frame timecode delta
git-svn-id: svn://localhost/ardour2/branches/3.0@13476 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3fa84d0caa
commit
06fa1b73e5
1 changed files with 5 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue