1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2003 Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
30 #include "exported_menus.h"
31 #include "sound_menu.h" /* recording_menu() */
34 #include "recording.h" /* recording_screen() */
36 #if defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC
37 #define FM_RECORDING_SCREEN
38 static int fm_recording_screen(void)
42 /* switch recording source to FMRADIO for the duration */
43 int rec_source
= global_settings
.rec_source
;
44 global_settings
.rec_source
= AUDIO_SRC_FMRADIO
;
45 ret
= recording_screen(true);
47 /* safe to reset as changing sources is prohibited here */
48 global_settings
.rec_source
= rec_source
;
53 MENUITEM_FUNCTION(recscreen_item
, 0, ID2P(LANG_RECORDING
),
54 fm_recording_screen
, NULL
, NULL
, Icon_Recording
);
55 #endif /* defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC */
57 #if defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC
58 #define FM_RECORDING_SETTINGS
59 static int fm_recording_settings(void)
61 bool ret
= recording_menu(true);
63 #if CONFIG_CODEC != SWCODEC
66 struct audio_recording_options rec_options
;
67 rec_init_recording_options(&rec_options
);
68 rec_options
.rec_source
= AUDIO_SRC_LINEIN
;
69 rec_set_recording_options(&rec_options
);
76 MENUITEM_FUNCTION(recsettings_item
, 0, ID2P(LANG_RECORDING_SETTINGS
),
77 fm_recording_settings
, NULL
, NULL
, Icon_Recording
);
78 #endif /* defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC */
79 #endif /* HAVE_RECORDING */
82 MENUITEM_FUNCTION(radio_presets_item
, 0, ID2P(LANG_PRESET
),
83 handle_radio_presets
, NULL
, NULL
, Icon_NOICON
);
86 MENUITEM_FUNCTION(radio_addpreset_item
, 0, ID2P(LANG_FM_ADD_PRESET
),
87 handle_radio_add_preset
, NULL
, NULL
, Icon_NOICON
);
90 MENUITEM_FUNCTION(presetload_item
, 0, ID2P(LANG_FM_PRESET_LOAD
),
91 preset_list_load
, NULL
, NULL
, Icon_NOICON
);
92 MENUITEM_FUNCTION(presetsave_item
, 0, ID2P(LANG_FM_PRESET_SAVE
),
93 preset_list_save
, NULL
, NULL
, Icon_NOICON
);
94 MENUITEM_FUNCTION(presetclear_item
, 0, ID2P(LANG_FM_PRESET_CLEAR
),
95 preset_list_clear
, NULL
, NULL
, Icon_NOICON
);
97 MENUITEM_SETTING(set_region
, &global_settings
.fm_region
, NULL
);
98 MENUITEM_SETTING(force_mono
, &global_settings
.fm_force_mono
, NULL
);
101 extern int radio_mode
;
102 static char* get_mode_text(int selected_item
, void * data
, char *buffer
)
106 snprintf(buffer
, MAX_PATH
, "%s %s", str(LANG_MODE
),
107 radio_mode
? str(LANG_PRESET
) :
108 str(LANG_RADIO_SCAN_MODE
));
111 static int toggle_radio_mode(void)
113 radio_mode
= (radio_mode
== RADIO_SCAN_MODE
) ?
114 RADIO_PRESET_MODE
: RADIO_SCAN_MODE
;
117 MENUITEM_FUNCTION_DYNTEXT(radio_mode_item
, 0,
118 toggle_radio_mode
, NULL
,
119 get_mode_text
, NULL
, NULL
, NULL
, Icon_NOICON
);
122 MENUITEM_FUNCTION(scan_presets_item
, MENU_FUNC_USEPARAM
,
123 ID2P(LANG_FM_SCAN_PRESETS
),
124 presets_scan
, NULL
, NULL
, Icon_NOICON
);
126 MAKE_MENU(radio_settings_menu
, ID2P(LANG_FM_MENU
), NULL
,
131 #ifndef FM_PRESET_ADD
132 &radio_addpreset_item
,
134 &presetload_item
, &presetsave_item
, &presetclear_item
,
139 &set_region
, &sound_settings
,
140 #ifdef FM_RECORDING_SCREEN
143 #ifdef FM_RECORDING_SETTINGS