#ifndef _TIMER_H_ #define _TIMER_H_ #include #include #include "log.h" // Uncomment this to show debug messages from timer.c and timer-parser.c // #define DEBUG_TIMER #if defined(DEBUG_TIMER) || defined(DEBUG_ALL) #define LOG_TIMER LOG_MSG #else #define LOG_TIMER(x, ...) #endif void parser_module_init(); void parser_module_exit(); void timer_module_init(); void timer_module_exit(); void timer_set_debug_flag(gboolean on_off); void timer_func_start(); void timer_func_stop(); void timer_module_reset(gint for_state); typedef struct { gchar action; // recording action: 'S' = start, 'T' = stop, 'P' = pause gchar action_prep; // action preposition: 'a' = after gchar data_type; // data type: 't' = time data, 'f' = file size, 'l' = label double val[3]; // data: hh, mm, ss | file size | silence/voice/audio/sound duration gchar label[12]; // textual action: "silence" | ("sound" | "voice" | "audio") | ("bytes" | "kb" | "mb" | "gb" | "tb") gchar level_unit[10]; // level unit: "dB" (decibel) | "%" double level; // level value in dB or % gint day_of_year; // Internal flag. Used to check if the clock has gone around to next day. gint64 seconds; // Internal value. Count seconds for this command. gint64 seconds_x; // Internal value. Count seconds to resume recording after "silence" command. // Or count seconds to pause recording if started with "sound", "voice" or "audio" commands. gboolean done; // Internal value. TRUE when this timer command has been executed. } TimerRec; GList *parser_parse_actions(gchar *txt); void parser_print_rec(TimerRec *tr); void parser_print_list(GList *list); void parser_free_list(); void timer_settings_changed(); #endif