X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Funits.h;h=6de33118da06cf24fa46b256645da2bad41ad766;hp=7e2243ef498b673f29798760756a55a1f0be38fb;hb=c9c0e07706fad701a70ee0d1ffb0fcb6304f138c;hpb=d830901b11606a7838791bc45e39130329db99f0 diff --git a/cinelerra-5.1/guicast/units.h b/cinelerra-5.1/guicast/units.h index 7e2243ef..6de33118 100644 --- a/cinelerra-5.1/guicast/units.h +++ b/cinelerra-5.1/guicast/units.h @@ -34,7 +34,7 @@ #define TOTALFREQS 1024 // slots per octave #define OCTAVE 105 -#define TOTAL_TIMEFORMATS 7 +#define TOTAL_TIMEFORMATS 8 // h:mm:ss.sss #define TIME_HMS 0 @@ -55,6 +55,7 @@ #define TIME_HMS2__STR "h:mm:ss" #define TIME_HMS3__STR "hh:mm:ss" #define TIME_HMSF__STR "h:mm:ss:ff" +#define TIME_TIMECODE__STR "timecode" #define TIME_SAMPLES__STR "audio samples" #define TIME_SAMPLES_HEX__STR "audio samples (hex)" #define TIME_FRAMES__STR "video frames" @@ -77,6 +78,9 @@ #define TIME_MS2 10 #define TIME_MS2_TEXT _("Minutes:Seconds") +#define TIME_TIMECODE 11 +#define TIME_TIMECODE_TEXT _("Timecode") + class Units; class DB @@ -178,16 +182,20 @@ public: static int64_t tosamples(double frames, int sample_rate, float framerate); // give text representation as time static char* totext(char *text, int64_t samples, int time_format, - int samplerate, float frame_rate = 0, float frames_per_foot = 0); + int samplerate, float frame_rate = 0, float frames_per_foot = 0, + double timecode_offset = 0); // give text representation as time static char* totext(char *text, double seconds, int time_format, - int sample_rate = 0, float frame_rate = 0, float frames_per_foot = 0); + int sample_rate = 0, float frame_rate = 0, float frames_per_foot = 0, + double timecode_offset = 0); // convert time to samples static int64_t fromtext(const char *text, int samplerate, - int time_format, float frame_rate, float frames_per_foot); + int time_format, float frame_rate, float frames_per_foot, + double timecode_offset); // Convert text to seconds static double text_to_seconds(const char *text, int samplerate, - int time_format, float frame_rate = 0, float frames_per_foot = 0); + int time_format, float frame_rate = 0, float frames_per_foot = 0, + double timecode_offset = 0); static char* size_totext(int64_t bytes, char *text); static float xy_to_polar(int x, int y);