summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/recording_menu.c73
1 files changed, 70 insertions, 3 deletions
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 1bc84e90d2..d37fe39bfe 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -42,6 +42,7 @@
42#include "sound.h" 42#include "sound.h"
43#ifdef HAVE_RECORDING 43#ifdef HAVE_RECORDING
44#include "audio.h" 44#include "audio.h"
45#include "recording.h"
45#if CONFIG_TUNER 46#if CONFIG_TUNER
46#include "radio.h" 47#include "radio.h"
47#endif 48#endif
@@ -305,12 +306,78 @@ MENUITEM_SETTING(rec_quality, &global_settings.rec_quality, NULL);
305MENUITEM_SETTING(rec_editable, &global_settings.rec_editable, NULL); 306MENUITEM_SETTING(rec_editable, &global_settings.rec_editable, NULL);
306#endif 307#endif
307 308
309/* Displays a menu for changing the countdown timer settings */
310static int countdown_timer_func(void)
311{
312 bool retval;
313 bool changed = false;
314 struct timer* timer = get_timerstat();
315
316 static const struct opt_items names[] = {
317 { STR(LANG_TIMER_DAYS) },
318 { STR(LANG_TIMER_HRS) },
319 { STR(LANG_TIMER_MINS) }
320 };
321
322 struct opt_settings settings[] = {
323 { &timer->days, 6 },
324 { &timer->hrs, 23 },
325 { &timer->mins, 59 }
326 };
327
328 retval = set_multi_int(str(LANG_TIMER_SET), names, settings, 3, &changed);
329
330 if (changed)
331 {
332 timer->countdown = false;
333 timer->secs = 0;
334 timer->timer_display = false;
335 }
336
337 return retval;
338}
339
340static int countdown_timer_repeat_func(void)
341{
342 struct timer* timer = get_timerstat();
343 bool retval;
344
345 static const struct opt_items names[] = {
346 { STR(LANG_TIMER_DAYS) },
347 { STR(LANG_TIMER_HRS) },
348 { STR(LANG_TIMER_MINS) }
349 };
350
351 struct opt_settings settings[] = {
352 { &timer->days_rpt, 6 },
353 { &timer->hrs_rpt, 23 },
354 { &timer->mins_rpt, 59 }
355 };
356 retval = set_multi_int(str(LANG_TIMER_REPEAT), names, settings, 3, NULL);
357
358 /* automatically select settings necessary for repeated recording */
359 if (timer->days_rpt || timer->hrs_rpt || timer->mins_rpt)
360 {
361 global_settings.rec_split_type = 1; /* Stop */
362 global_settings.rec_split_method = 0; /* Time */
363 global_settings.rec_trigger_mode = 0; /* The repeat timer isn't
364 compatible with the trigger */
365 }
366
367 return retval;
368}
369
370MENUITEM_FUNCTION(countdown_timer, 0, ID2P(LANG_TIMER_SET),
371 countdown_timer_func, NULL, NULL, Icon_Menu_setting);
372MENUITEM_FUNCTION(countdown_timer_repeat, 0, ID2P(LANG_TIMER_REPEAT),
373 countdown_timer_repeat_func, NULL, NULL, Icon_Menu_setting);
308MENUITEM_SETTING(rec_split_type, &global_settings.rec_split_type, NULL); 374MENUITEM_SETTING(rec_split_type, &global_settings.rec_split_type, NULL);
309MENUITEM_SETTING(rec_split_method, &global_settings.rec_split_method, NULL); 375MENUITEM_SETTING(rec_split_method, &global_settings.rec_split_method, NULL);
310MENUITEM_SETTING(rec_timesplit, &global_settings.rec_timesplit, NULL); 376MENUITEM_SETTING(rec_timesplit, &global_settings.rec_timesplit, NULL);
311MENUITEM_SETTING(rec_sizesplit, &global_settings.rec_sizesplit, NULL); 377MENUITEM_SETTING(rec_sizesplit, &global_settings.rec_sizesplit, NULL);
312MAKE_MENU(filesplitoptionsmenu, ID2P(LANG_RECORD_TIMESPLIT), NULL, Icon_NOICON, 378MAKE_MENU(timermenu, ID2P(LANG_RECORD_TIMESPLIT), NULL, Icon_NOICON,
313 &rec_split_method, &rec_split_type, &rec_timesplit, &rec_sizesplit); 379 &countdown_timer, &countdown_timer_repeat, &rec_split_method,
380 &rec_split_type, &rec_timesplit, &rec_sizesplit);
314 381
315 382
316MENUITEM_SETTING(rec_prerecord_time, &global_settings.rec_prerecord_time, NULL); 383MENUITEM_SETTING(rec_prerecord_time, &global_settings.rec_prerecord_time, NULL);
@@ -819,7 +886,7 @@ MAKE_MENU(recording_setting_menu, ID2P(LANG_RECORDING_SETTINGS), NULL, Icon_Reco
819#if CONFIG_CODEC == MAS3587F 886#if CONFIG_CODEC == MAS3587F
820 &rec_editable, 887 &rec_editable,
821#endif 888#endif
822 &filesplitoptionsmenu, 889 &timermenu,
823 &rec_prerecord_time, 890 &rec_prerecord_time,
824 &recdirectory, 891 &recdirectory,
825#ifdef HAVE_BACKLIGHT 892#ifdef HAVE_BACKLIGHT