X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Funits.C;h=c8e5e482650ab23dba66f36ab1ec3e97206e0d85;hp=cf48af1722b85a9733f56ba89f4dec9d9297ed3b;hb=c4c898707e3fdbf2979b7bc43ac0e1b0fa779663;hpb=a718f58e6d8061f83bd0c0b10848ac415cd21fcd diff --git a/cinelerra-5.1/guicast/units.C b/cinelerra-5.1/guicast/units.C index cf48af17..c8e5e482 100644 --- a/cinelerra-5.1/guicast/units.C +++ b/cinelerra-5.1/guicast/units.C @@ -321,7 +321,7 @@ int64_t Units::fromtext(const char *text, int samplerate, int time_format, case TIME_HMS3: { hours = get_int64(text); skip_seperators(text); minutes = get_int64(text); skip_seperators(text); - seconds = get_int64(text); + seconds = get_double(text); total_seconds = seconds + minutes*60 + hours*3600; break; } @@ -330,7 +330,7 @@ int64_t Units::fromtext(const char *text, int samplerate, int time_format, hours = get_int64(text); skip_seperators(text); minutes = get_int64(text); skip_seperators(text); seconds = get_int64(text); skip_seperators(text); - frames = get_int64(text); + frames = get_double(text); total_seconds = frames/frame_rate + seconds + minutes*60 + hours*3600; if( time_format == TIME_TIMECODE ) total_seconds -= timecode_offset; @@ -382,8 +382,26 @@ double Units::text_to_seconds(const char *text, int samplerate, int time_format, +const char *Units::timetype_toformat(int type) +{ + switch( type ) { + case TIME_HMS: return TIME_HMS__STR; + case TIME_HMSF: return TIME_HMSF__STR; + case TIME_SAMPLES: return TIME_SAMPLES__STR; + case TIME_SAMPLES_HEX: return TIME_SAMPLES_HEX__STR; + case TIME_FRAMES: return TIME_FRAMES__STR; + case TIME_FEET_FRAMES: return TIME_FEET_FRAMES__STR; + case TIME_HMS2: return TIME_HMS2__STR; + case TIME_HMS3: return TIME_HMS3__STR; + case TIME_SECONDS: return TIME_SECONDS__STR; + case TIME_MS1: return TIME_MS1__STR; + case TIME_MS2: return TIME_MS2__STR; + case TIME_TIMECODE: return TIME_TIMECODE__STR; + } + return "(err)"; +} -int Units::timeformat_totype(char *tcf) +int Units::timeformat_totype(const char *tcf) { if (!strcmp(tcf,TIME_SECONDS__STR)) return(TIME_SECONDS); if (!strcmp(tcf,TIME_HMS__STR)) return(TIME_HMS);