~audio-recorder/audio-recorder/trunk

1 by Osmo Antero Maatta
Initial import 17.jan.2011
1
#ifndef _TIMER_H_
2
#define _TIMER_H_
3
4
#include <glib.h>
5
#include <gdk/gdk.h>
6
#include "log.h"
173 by Osmo Antero
Support new systems; Ubuntu 12.10, Fedora 18. Improved timer and VAD-modules. Better gst-pipeline.
7
#include <gst/gst.h>
62 by Osmo Antero
The recorder now obeys commands from Banshee Player.
8
9
// Uncomment this to show debug messages from timer.c and timer-parser.c
185 by osmoma at gmail
Uncommented DEBUG_TIMER in timer.h
10
//#define DEBUG_TIMER
62 by Osmo Antero
The recorder now obeys commands from Banshee Player.
11
12
#if defined(DEBUG_TIMER) || defined(DEBUG_ALL)
13
#define LOG_TIMER LOG_MSG
14
#else
15
#define LOG_TIMER(x, ...)
16
#endif
17
1 by Osmo Antero Maatta
Initial import 17.jan.2011
18
void parser_module_init();
19
void parser_module_exit();
20
21
void timer_module_init();
22
void timer_module_exit();
23
326 by Osmo Antero
Version 1.2. First build for Ubuntu 13.10 (Saucy Salamander). Renamed configure.in to configure.ac.
24
void timer_set_debug_flag(gboolean on);
49 by Osmo Antero Maatta
Employ listener (in gst-listener.c) ONLY when needed. Also listener process was created 2 times (was unstoppable)
25
1 by Osmo Antero Maatta
Initial import 17.jan.2011
26
void timer_func_start();
27
void timer_func_stop();
28
173 by Osmo Antero
Support new systems; Ubuntu 12.10, Fedora 18. Improved timer and VAD-modules. Better gst-pipeline.
29
void timer_evaluate_triggers(GstClockTimeDiff time_diff, gdouble rms);
30
40 by Osmo Antero Maatta
Added ability to record from multiple devices. Major changes in all modules.
31
void timer_module_reset(gint for_state);
1 by Osmo Antero Maatta
Initial import 17.jan.2011
32
33
typedef struct {
462 by Osmo Antero
Cleanups.
34
    gchar action;      // recording action:   'S' = start | 'T' = stop | 'P' = pause
1 by Osmo Antero Maatta
Initial import 17.jan.2011
35
    gchar action_prep; // action preposition: 'a' = after
462 by Osmo Antero
Cleanups.
36
    gchar data_type;   // data type:          't' = clock time h:m:s | 'd' = time duration h,m,s | 'f' = file size | 'l' = label
37
    gdouble val[3];    // data:               hours,minutes,seconds | file size | silence/voice/audio/sound duration
38
    gchar label[12];   // label:              "silence" | ("sound" | "voice" | "audio") | ("bytes" | "kb" | "mb" | "gb" | "tb")
1 by Osmo Antero Maatta
Initial import 17.jan.2011
39
173 by Osmo Antero
Support new systems; Ubuntu 12.10, Fedora 18. Improved timer and VAD-modules. Better gst-pipeline.
40
    gchar threshold_unit[10]; // level/threshold unit: "dB" (decibel) | "%" or empty
202 by osmoma at gmail
Changes towards v0.9.5 on Ubuntu 12.10 and Fedora 18.
41
    gdouble threshold;        // level/threshold value in dB, % or plain value [0 - 1.0]
42
43
    gint day_of_year;  // internal flag. Used to check if the clock has gone around to the next day
44
451 by Osmo Antero
Some improvements in timer.c. Check priority if timer-text has several commands (that can fire). This needs more thinking and testing. Work continues.
45
    gint64 norm_secs; // = tr->val[0]*3600 + tr->val[1]*60 + tr->val[2] seconds (less recalculations)
202 by osmoma at gmail
Changes towards v0.9.5 on Ubuntu 12.10 and Fedora 18.
46
    gdouble norm_threshold; // = threshold converted to [0 - 1.0] from threshold_unit (less recalculations)
47
48
    gdouble time_above;// internal value. Count seconds when value _above_ threshold
49
    gdouble time_below;// internal value. Count seconds when value _below_ threshold
50
1 by Osmo Antero Maatta
Initial import 17.jan.2011
51
} TimerRec;
52
53
GList *parser_parse_actions(gchar *txt);
54
55
void parser_print_rec(TimerRec *tr);
56
void parser_print_list(GList *list);
57
void parser_free_list();
58
59
void timer_settings_changed();
60
173 by Osmo Antero
Support new systems; Ubuntu 12.10, Fedora 18. Improved timer and VAD-modules. Better gst-pipeline.
61
const gchar *parser_get_action_name(gchar action);
62
1 by Osmo Antero Maatta
Initial import 17.jan.2011
63
#endif
64