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=7456b662de9e5c62a38696fc86af14a5f4fd8fbf;hb=c9c0e07706fad701a70ee0d1ffb0fcb6304f138c;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/guicast/units.h b/cinelerra-5.1/guicast/units.h index 7456b662..6de33118 100644 --- a/cinelerra-5.1/guicast/units.h +++ b/cinelerra-5.1/guicast/units.h @@ -32,7 +32,9 @@ #define INFINITYGAIN -96 #define MAXGAIN 50 #define TOTALFREQS 1024 -#define TOTAL_TIMEFORMATS 7 +// slots per octave +#define OCTAVE 105 +#define TOTAL_TIMEFORMATS 8 // h:mm:ss.sss #define TIME_HMS 0 @@ -53,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" @@ -75,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 @@ -125,7 +131,8 @@ public: // return index of frequency int fromfreq(); static int fromfreq(int index); - + static double tofreq_f(double index); + static double fromfreq_f(double freq); // increment frequency by one Freq& operator++(); Freq& operator--(); @@ -175,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);