1
0
Fork 0
forked from len0rd/rockbox

Patch #2711 by Alexander Spyridakis with some changes by me: adds load/save of presets to different files;

Also fix the preset menu context menu not working on the remote


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9425 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Hristo Kovachev 2006-04-02 12:23:08 +00:00
parent b0b333f95e
commit 009853f40e
10 changed files with 419 additions and 86 deletions

View file

@ -45,6 +45,10 @@
#include "keyboard.h"
#endif
#ifdef CONFIG_TUNER
#include "radio.h"
#endif
#ifndef SIMULATOR
static int boot_size = 0;
static int boot_cluster;
@ -277,6 +281,9 @@ int ft_load(struct tree_context* c, const char* tempdir)
(*c->dirfilter == SHOW_WPS && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_WPS) ||
#ifdef HAVE_REMOTE_LCD
(*c->dirfilter == SHOW_RWPS && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_RWPS) ||
#endif
#ifdef CONFIG_TUNER
(*c->dirfilter == SHOW_FMR && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_FMR) ||
#endif
(*c->dirfilter == SHOW_CFG && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_CFG) ||
(*c->dirfilter == SHOW_LNG && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_LNG) ||
@ -418,6 +425,34 @@ int ft_enter(struct tree_context* c)
}
break;
#ifdef CONFIG_TUNER
/* fmr preset file */
case TREE_ATTR_FMR:
/* Preset inside the default folder. */
if(!strncasecmp(FMPRESET_PATH, buf, strlen(FMPRESET_PATH)))
{
set_file(buf, global_settings.fmr_file, MAX_FILENAME);
radio_load_presets(global_settings.fmr_file);
if(get_radio_status() != FMRADIO_PLAYING &&
get_radio_status() != FMRADIO_PAUSED)
radio_screen();
}
/*
* Preset outside default folder, we can choose such only
* if we are out of the radio screen, so the check for the
* radio status isn't neccessary
*/
else
{
radio_load_presets(buf);
radio_screen();
}
break;
#endif
/* wps config file */
case TREE_ATTR_WPS:
wps_data_load(gui_wps[0].data, buf, true);