additional Andrew provided Termux mods +
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / units.h
index 7456b662de9e5c62a38696fc86af14a5f4fd8fbf..208ab33ce4f5d6610af260efbfc5aab7e1a9500e 100644 (file)
@@ -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,9 @@
 #define TIME_HMS2__STR         "h:mm:ss"
 #define TIME_HMS3__STR         "hh:mm:ss"
 #define TIME_HMSF__STR         "h:mm:ss:ff"
+#define TIME_MS1__STR          "m:ss"
+#define TIME_MS2__STR          "+m:ss"
+#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 +80,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 +133,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--();
@@ -150,8 +159,8 @@ public:
        static void init();
        static void finit();
 
-       static int timeformat_totype(char *tcf);
-
+       static int timeformat_totype(const char *tcf);
+       static const char *timetype_toformat(int type);
 // No rounding.
        static float toframes(int64_t samples, int sample_rate, float framerate);
 // Round up if > .5
@@ -175,16 +184,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);