diff options
Diffstat (limited to 'apps/radio')
-rw-r--r-- | apps/radio/presets.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/radio/presets.c b/apps/radio/presets.c index f7531d8754..51bdabdfce 100644 --- a/apps/radio/presets.c +++ b/apps/radio/presets.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <stdio.h> | 23 | #include <stdio.h> |
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include "settings.h" | ||
26 | #include "rbpaths.h" | 27 | #include "rbpaths.h" |
27 | #include "general.h" | 28 | #include "general.h" |
28 | #include "radio.h" | 29 | #include "radio.h" |
@@ -110,7 +111,7 @@ static int find_closest_preset(int freq, int direction) | |||
110 | int f = presets[i].frequency; | 111 | int f = presets[i].frequency; |
111 | if (f == freq) | 112 | if (f == freq) |
112 | return i; /* Exact match = stop */ | 113 | return i; /* Exact match = stop */ |
113 | 114 | ||
114 | /* remember the highest and lowest presets for wraparound */ | 115 | /* remember the highest and lowest presets for wraparound */ |
115 | if (f < presets[lowpreset].frequency) | 116 | if (f < presets[lowpreset].frequency) |
116 | lowpreset = i; | 117 | lowpreset = i; |
@@ -223,7 +224,7 @@ void radio_load_presets(char *filename) | |||
223 | return; | 224 | return; |
224 | } | 225 | } |
225 | /* Temporary preset, loaded until player shuts down. */ | 226 | /* Temporary preset, loaded until player shuts down. */ |
226 | else if(filename[0] == '/') | 227 | else if(filename[0] == '/') |
227 | strlcpy(filepreset, filename, sizeof(filepreset)); | 228 | strlcpy(filepreset, filename, sizeof(filepreset)); |
228 | /* Preset from default directory. */ | 229 | /* Preset from default directory. */ |
229 | else | 230 | else |
@@ -361,7 +362,7 @@ int preset_list_load(void) | |||
361 | int preset_list_save(void) | 362 | int preset_list_save(void) |
362 | { | 363 | { |
363 | if(num_presets > 0) | 364 | if(num_presets > 0) |
364 | { | 365 | { |
365 | bool bad_file_name = true; | 366 | bool bad_file_name = true; |
366 | 367 | ||
367 | if(!dir_exists(FMPRESET_PATH)) /* Check if there is preset folder */ | 368 | if(!dir_exists(FMPRESET_PATH)) /* Check if there is preset folder */ |
@@ -426,11 +427,11 @@ int preset_list_clear(void) | |||
426 | return true; | 427 | return true; |
427 | } | 428 | } |
428 | 429 | ||
429 | MENUITEM_FUNCTION(radio_edit_preset_item, MENU_FUNC_CHECK_RETVAL, | 430 | MENUITEM_FUNCTION(radio_edit_preset_item, MENU_FUNC_CHECK_RETVAL, |
430 | ID2P(LANG_FM_EDIT_PRESET), | 431 | ID2P(LANG_FM_EDIT_PRESET), |
431 | radio_edit_preset, NULL, NULL, Icon_NOICON); | 432 | radio_edit_preset, NULL, NULL, Icon_NOICON); |
432 | MENUITEM_FUNCTION(radio_delete_preset_item, MENU_FUNC_CHECK_RETVAL, | 433 | MENUITEM_FUNCTION(radio_delete_preset_item, MENU_FUNC_CHECK_RETVAL, |
433 | ID2P(LANG_FM_DELETE_PRESET), | 434 | ID2P(LANG_FM_DELETE_PRESET), |
434 | radio_delete_preset, NULL, NULL, Icon_NOICON); | 435 | radio_delete_preset, NULL, NULL, Icon_NOICON); |
435 | static int radio_preset_callback(int action, | 436 | static int radio_preset_callback(int action, |
436 | const struct menu_item_ex *this_item, | 437 | const struct menu_item_ex *this_item, |
@@ -443,7 +444,7 @@ static int radio_preset_callback(int action, | |||
443 | (void)this_list; | 444 | (void)this_list; |
444 | } | 445 | } |
445 | MAKE_MENU(handle_radio_preset_menu, ID2P(LANG_PRESET), | 446 | MAKE_MENU(handle_radio_preset_menu, ID2P(LANG_PRESET), |
446 | radio_preset_callback, Icon_NOICON, &radio_edit_preset_item, | 447 | radio_preset_callback, Icon_NOICON, &radio_edit_preset_item, |
447 | &radio_delete_preset_item); | 448 | &radio_delete_preset_item); |
448 | /* present a list of preset stations */ | 449 | /* present a list of preset stations */ |
449 | static const char* presets_get_name(int selected_item, void *data, | 450 | static const char* presets_get_name(int selected_item, void *data, |