#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
#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"
#define TIME_MS2 10
#define TIME_MS2_TEXT _("Minutes:Seconds")
+#define TIME_TIMECODE 11
+#define TIME_TIMECODE_TEXT _("Timecode")
+
class Units;
class DB
// 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--();
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
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);