summaryrefslogtreecommitdiff
path: root/apps/recorder/recording.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r--apps/recorder/recording.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index a085bbbc03..30e3c315c8 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -69,7 +69,86 @@
69#include "action.h" 69#include "action.h"
70#include "radio.h" 70#include "radio.h"
71#ifdef HAVE_RECORDING 71#ifdef HAVE_RECORDING
72/* This array holds the record timer interval lengths, in seconds */
73static const unsigned long rec_timer_seconds[] =
74{
75 0, /* 0 means OFF */
76 5*60, /* 00:05 */
77 10*60, /* 00:10 */
78 15*60, /* 00:15 */
79 30*60, /* 00:30 */
80 60*60, /* 01:00 */
81 74*60, /* 74:00 */
82 80*60, /* 80:00 */
83 2*60*60, /* 02:00 */
84 4*60*60, /* 04:00 */
85 6*60*60, /* 06:00 */
86 8*60*60, /* 08:00 */
87 10L*60*60, /* 10:00 */
88 12L*60*60, /* 12:00 */
89 18L*60*60, /* 18:00 */
90 24L*60*60 /* 24:00 */
91};
92
93static unsigned int rec_timesplit_seconds(void)
94{
95 return rec_timer_seconds[global_settings.rec_timesplit];
96}
97
98/* This array holds the record size interval lengths, in bytes */
99static const unsigned long rec_size_bytes[] =
100{
101 0, /* 0 means OFF */
102 5*1024*1024, /* 5MB */
103 10*1024*1024, /* 10MB */
104 15*1024*1024, /* 15MB */
105 32*1024*1024, /* 32MB */
106 64*1024*1024, /* 64MB */
107 75*1024*1024, /* 75MB */
108 100*1024*1024, /* 100MB */
109 128*1024*1024, /* 128MB */
110 256*1024*1024, /* 256MB */
111 512*1024*1024, /* 512MB */
112 650*1024*1024, /* 650MB */
113 700*1024*1024, /* 700MB */
114 1024*1024*1024, /* 1GB */
115 1536*1024*1024, /* 1.5GB */
116 1792*1024*1024, /* 1.75GB */
117};
118
119static unsigned long rec_sizesplit_bytes(void)
120{
121 return rec_size_bytes[global_settings.rec_sizesplit];
122}
123/*
124 * Time strings used for the trigger durations.
125 * Keep synchronous to trigger_times in settings_apply_trigger
126 */
127const char * const trig_durations[TRIG_DURATION_COUNT] =
128{
129 "0s", "1s", "2s", "5s",
130 "10s", "15s", "20s", "25s", "30s",
131 "1min", "2min", "5min", "10min"
132};
72 133
134void settings_apply_trigger(void)
135{
136 /* Keep synchronous to trig_durations and trig_durations_conf*/
137 static const long trigger_times[TRIG_DURATION_COUNT] = {
138 0, HZ, 2*HZ, 5*HZ,
139 10*HZ, 15*HZ, 20*HZ, 25*HZ, 30*HZ,
140 60*HZ, 2*60*HZ, 5*60*HZ, 10*60*HZ
141 };
142
143 peak_meter_define_trigger(
144 global_settings.rec_start_thres,
145 trigger_times[global_settings.rec_start_duration],
146 MIN(trigger_times[global_settings.rec_start_duration] / 2, 2*HZ),
147 global_settings.rec_stop_thres,
148 trigger_times[global_settings.rec_stop_postrec],
149 trigger_times[global_settings.rec_stop_gap]
150 );
151}
73/* recording screen status flags */ 152/* recording screen status flags */
74enum rec_status_flags 153enum rec_status_flags
75{ 154{