forked from len0rd/rockbox
* Move playback menu to the new sysetm
(http://forums.rockbox.org/index.php?topic=8703.0 if I broke any of those settings accidently). * Add set_int_ex() which is the same as set_int() but adds a param which is a callback that returns the voice ID to talk for the selected value * Change the "pause on headphone unplug" to use meaningful strings in the config instead of numbers, this setting will be reset. * saves ~500bytes on the rec build :D git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12285 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b0810520be
commit
fb62831faa
9 changed files with 378 additions and 564 deletions
|
|
@ -13,6 +13,7 @@ main_menu.c
|
|||
menu.c
|
||||
menus/display_menu.c
|
||||
menus/main_menu.c
|
||||
menus/playback_menu.c
|
||||
menus/playlist_menu.c
|
||||
#ifdef HAVE_RECORDING
|
||||
menus/recording_menu.c
|
||||
|
|
|
|||
|
|
@ -631,14 +631,15 @@ int do_menu(const struct menu_item_ex *start_menu)
|
|||
}
|
||||
if (setting->flags&F_INT_SETTING)
|
||||
{
|
||||
set_int(str(setting->lang_id),
|
||||
set_int_ex(str(setting->lang_id),
|
||||
NULL,
|
||||
setting->int_setting->unit,var,
|
||||
setting->int_setting->option_callback,
|
||||
setting->int_setting->step,
|
||||
setting->int_setting->min,
|
||||
setting->int_setting->max,
|
||||
setting->int_setting->formatter);
|
||||
setting->int_setting->formatter,
|
||||
setting->int_setting->get_talk_id);
|
||||
}
|
||||
else if (setting->flags&F_CHOICE_SETTING)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
extern const struct menu_item_ex
|
||||
main_menu_, /* main_menu.c */
|
||||
display_menu, /* display_menu.c */
|
||||
// playback_settings, /* playback_menu.c */
|
||||
playback_menu_item, /* playback_menu.c */
|
||||
#ifdef HAVE_RECORDING
|
||||
recording_settings_menu, /* recording_menu.c */
|
||||
#endif
|
||||
|
|
|
|||
209
apps/menus/playback_menu.c
Normal file
209
apps/menus/playback_menu.c
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
|
||||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id: $
|
||||
*
|
||||
* Copyright (C) 2007 Jonathan Gordon
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include "config.h"
|
||||
#include "lang.h"
|
||||
#include "action.h"
|
||||
#include "splash.h"
|
||||
#include "settings.h"
|
||||
#include "menu.h"
|
||||
#include "sound_menu.h"
|
||||
#include "kernel.h"
|
||||
#include "playlist.h"
|
||||
#include "dsp.h"
|
||||
#include "scrobbler.h"
|
||||
#include "audio.h"
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int setcrossfadeonexit_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
(void)this_item;
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
audio_set_crossfade(global_settings.crossfade);
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/***********************************/
|
||||
/* PLAYBACK MENU */
|
||||
int playback_callback(int action,const struct menu_item_ex *this_item);
|
||||
|
||||
MENUITEM_SETTING(shuffle_item, &global_settings.playlist_shuffle, playback_callback);
|
||||
MENUITEM_SETTING(repeat_mode, &global_settings.repeat_mode, playback_callback);
|
||||
MENUITEM_SETTING(play_selected, &global_settings.play_selected, NULL);
|
||||
MENUITEM_SETTING(resume, &global_settings.resume, NULL);
|
||||
|
||||
MENUITEM_SETTING(ff_rewind_accel, &global_settings.ff_rewind_accel, NULL);
|
||||
MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL);
|
||||
MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0,
|
||||
&ff_rewind_min_step, &ff_rewind_accel);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int buffermargin_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
(void)this_item;
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
audio_set_buffer_margin(global_settings.buffer_margin);
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
#else
|
||||
# define buffermargin_callback NULL
|
||||
#endif
|
||||
MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
|
||||
buffermargin_callback);
|
||||
MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL);
|
||||
MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* crossfade submenu */
|
||||
MENUITEM_SETTING(crossfade, &global_settings.crossfade, setcrossfadeonexit_callback);
|
||||
MENUITEM_SETTING(crossfade_fade_in_delay,
|
||||
&global_settings.crossfade_fade_in_delay, setcrossfadeonexit_callback);
|
||||
MENUITEM_SETTING(crossfade_fade_in_duration,
|
||||
&global_settings.crossfade_fade_in_duration, setcrossfadeonexit_callback);
|
||||
MENUITEM_SETTING(crossfade_fade_out_delay,
|
||||
&global_settings.crossfade_fade_out_delay, setcrossfadeonexit_callback);
|
||||
MENUITEM_SETTING(crossfade_fade_out_duration,
|
||||
&global_settings.crossfade_fade_out_duration, setcrossfadeonexit_callback);
|
||||
MENUITEM_SETTING(crossfade_fade_out_mixmode,
|
||||
&global_settings.crossfade_fade_out_mixmode,NULL);
|
||||
MAKE_MENU(crossfade_settings_menu,ID2P(LANG_CROSSFADE),0,
|
||||
&crossfade, &crossfade_fade_in_delay, &crossfade_fade_in_duration,
|
||||
&crossfade_fade_out_delay, &crossfade_fade_out_duration,
|
||||
&crossfade_fade_out_mixmode);
|
||||
|
||||
/* replay gain submenu */
|
||||
|
||||
int replaygain_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
(void)this_item;
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
dsp_set_replaygain(true);
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
MENUITEM_SETTING(replaygain, &global_settings.replaygain ,replaygain_callback);
|
||||
MENUITEM_SETTING(replaygain_noclip, &global_settings.replaygain_noclip ,replaygain_callback);
|
||||
MENUITEM_SETTING(replaygain_type, &global_settings.replaygain_type ,replaygain_callback);
|
||||
MENUITEM_SETTING(replaygain_preamp, &global_settings.replaygain_preamp ,replaygain_callback);
|
||||
MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0,
|
||||
&replaygain,&replaygain_noclip,
|
||||
&replaygain_type,&replaygain_preamp);
|
||||
|
||||
MENUITEM_SETTING(beep, &global_settings.beep ,NULL);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL);
|
||||
#endif
|
||||
MENUITEM_SETTING(id3_v1_first, &global_settings.id3_v1_first, NULL);
|
||||
MENUITEM_SETTING(next_folder, &global_settings.next_folder, NULL);
|
||||
int audioscrobbler_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
(void)this_item;
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
if (!scrobbler_is_enabled() && global_settings.audioscrobbler)
|
||||
gui_syncsplash(HZ*2, true, str(LANG_PLEASE_REBOOT));
|
||||
|
||||
if(scrobbler_is_enabled() && !global_settings.audioscrobbler)
|
||||
scrobbler_shutdown();
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
MENUITEM_SETTING(audioscrobbler, &global_settings.audioscrobbler, audioscrobbler_callback);
|
||||
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
MENUITEM_SETTING(unplug_mode, &global_settings.unplug_mode, NULL);
|
||||
MENUITEM_SETTING(unplug_rw, &global_settings.unplug_rw, NULL);
|
||||
MENUITEM_SETTING(unplug_autoresume, &global_settings.unplug_autoresume, NULL);
|
||||
MAKE_MENU(unplug_menu, ID2P(LANG_UNPLUG), 0,
|
||||
&unplug_mode, &unplug_rw, &unplug_autoresume);
|
||||
#endif
|
||||
|
||||
MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0,
|
||||
&shuffle_item, &repeat_mode, &play_selected, &resume,
|
||||
&ff_rewind_settings_menu,
|
||||
&buffer_margin, &fade_on_stop, &party_mode,
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&crossfade_settings_menu, &replaygain_settings_menu, &beep,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
&spdif_enable,
|
||||
#endif
|
||||
&id3_v1_first, &next_folder, &audioscrobbler
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
,&unplug_menu
|
||||
#endif
|
||||
);
|
||||
int playback_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
static bool old_shuffle = false;
|
||||
static int old_repeat_mode = 0;
|
||||
(void)this_item;
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ENTER_MENUITEM:
|
||||
if (this_item == &shuffle_item)
|
||||
old_shuffle = global_settings.playlist_shuffle;
|
||||
else if (this_item == &repeat_mode)
|
||||
old_repeat_mode = global_settings.repeat_mode;
|
||||
break;
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
if ((this_item == &shuffle_item) &&
|
||||
(old_shuffle != global_settings.playlist_shuffle)
|
||||
&& (audio_status() & AUDIO_STATUS_PLAY))
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
dsp_set_replaygain(true);
|
||||
#endif
|
||||
if (global_settings.playlist_shuffle)
|
||||
{
|
||||
playlist_randomise(NULL, current_tick, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
playlist_sort(NULL, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
/* PLAYBACK MENU */
|
||||
/***********************************/
|
||||
|
|
@ -1022,11 +1022,15 @@ bool set_bool_options(const char* string, bool* variable,
|
|||
return result;
|
||||
}
|
||||
|
||||
static void talk_unit(int unit, int value)
|
||||
static void talk_unit(int unit, int value, long (*get_talk_id)(int value))
|
||||
{
|
||||
if (global_settings.talk_menu)
|
||||
{
|
||||
if (unit < UNIT_LAST)
|
||||
if (get_talk_id)
|
||||
{
|
||||
talk_id(get_talk_id(value),false);
|
||||
}
|
||||
else if (unit < UNIT_LAST)
|
||||
{ /* use the available unit definition */
|
||||
talk_value(value, unit, false);
|
||||
}
|
||||
|
|
@ -1046,7 +1050,8 @@ struct value_setting_data {
|
|||
int voice_unit;
|
||||
const char * unit;
|
||||
void (*formatter)(char* dest, int dest_length,
|
||||
int variable, const char* unit);
|
||||
int value, const char* unit);
|
||||
long (*get_talk_id)(int value);
|
||||
/* used for BOOL and "choice" settings */
|
||||
struct opt_items* options;
|
||||
};
|
||||
|
|
@ -1100,7 +1105,7 @@ static bool do_set_setting(const unsigned char* string, void *variable,
|
|||
if (global_settings.talk_menu)
|
||||
{
|
||||
if (cb_data->type == INT && !cb_data->options)
|
||||
talk_unit(cb_data->voice_unit, *(int*)variable);
|
||||
talk_unit(cb_data->voice_unit, *(int*)variable, cb_data->get_talk_id);
|
||||
else talk_id(cb_data->options[selected].voice_id, false);
|
||||
}
|
||||
|
||||
|
|
@ -1121,7 +1126,7 @@ static bool do_set_setting(const unsigned char* string, void *variable,
|
|||
{
|
||||
value = cb_data->max -
|
||||
gui_synclist_get_sel_pos(&lists)*cb_data->step;
|
||||
talk_unit(cb_data->voice_unit, value);
|
||||
talk_unit(cb_data->voice_unit, value, cb_data->get_talk_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1195,6 +1200,34 @@ static const char *unit_strings[] =
|
|||
[UNIT_KBIT]
|
||||
= "kb/s",
|
||||
};
|
||||
bool set_int_ex(const unsigned char* string,
|
||||
const char* unit,
|
||||
int voice_unit,
|
||||
int* variable,
|
||||
void (*function)(int),
|
||||
int step,
|
||||
int min,
|
||||
int max,
|
||||
void (*formatter)(char*, int, int, const char*),
|
||||
long (*get_talk_id)(int))
|
||||
{
|
||||
#if CONFIG_KEYPAD != PLAYER_PAD
|
||||
struct value_setting_data data = {
|
||||
INT,max, step, voice_unit,unit,formatter,get_talk_id,NULL };
|
||||
if (unit == NULL)
|
||||
data.unit = unit_strings[voice_unit];
|
||||
return do_set_setting(string,variable,(max-min)/step + 1,
|
||||
(max-*variable)/step, &data,function);
|
||||
#else
|
||||
int count = (max-min)/step + 1;
|
||||
struct value_setting_data data = {
|
||||
INT,min, -step, voice_unit,unit,formatter,get_talk_id,NULL };
|
||||
if (unit == NULL)
|
||||
data.unit = unit_strings[voice_unit];
|
||||
return do_set_setting(string,variable,count,
|
||||
count - ((max-*variable)/step), &data,function);
|
||||
#endif
|
||||
}
|
||||
bool set_int(const unsigned char* string,
|
||||
const char* unit,
|
||||
int voice_unit,
|
||||
|
|
@ -1205,24 +1238,9 @@ bool set_int(const unsigned char* string,
|
|||
int max,
|
||||
void (*formatter)(char*, int, int, const char*) )
|
||||
{
|
||||
#if CONFIG_KEYPAD != PLAYER_PAD
|
||||
struct value_setting_data data = {
|
||||
INT,max, step, voice_unit,unit,formatter,NULL };
|
||||
if (unit == NULL)
|
||||
data.unit = unit_strings[voice_unit];
|
||||
return do_set_setting(string,variable,(max-min)/step + 1,
|
||||
(max-*variable)/step, &data,function);
|
||||
#else
|
||||
int count = (max-min)/step + 1;
|
||||
struct value_setting_data data = {
|
||||
INT,min, -step, voice_unit,unit,formatter,NULL };
|
||||
if (unit == NULL)
|
||||
data.unit = unit_strings[voice_unit];
|
||||
return do_set_setting(string,variable,count,
|
||||
count - ((max-*variable)/step), &data,function);
|
||||
#endif
|
||||
return set_int_ex(string, unit, voice_unit, variable, function,
|
||||
step, min, max, formatter, NULL);
|
||||
}
|
||||
|
||||
/* NOTE: the 'type' parameter specifies the actual type of the variable
|
||||
that 'variable' points to. not the value within. Only variables with
|
||||
type 'bool' should use parameter BOOL.
|
||||
|
|
@ -1234,7 +1252,7 @@ bool set_option(const char* string, void* variable, enum optiontype type,
|
|||
const struct opt_items* options, int numoptions, void (*function)(int))
|
||||
{
|
||||
struct value_setting_data data = {
|
||||
type,0, 0, 0,NULL,NULL,(struct opt_items*)options };
|
||||
type,0, 0, 0,NULL,NULL,NULL,(struct opt_items*)options };
|
||||
int selected;
|
||||
if (type == BOOL)
|
||||
selected = *(bool*)variable ? 1 : 0;
|
||||
|
|
|
|||
|
|
@ -241,6 +241,12 @@ bool set_int(const unsigned char* string, const char* unit, int voice_unit,
|
|||
int* variable,
|
||||
void (*function)(int), int step, int min, int max,
|
||||
void (*formatter)(char*, int, int, const char*) );
|
||||
/* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
|
||||
bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
|
||||
int* variable,
|
||||
void (*function)(int), int step, int min, int max,
|
||||
void (*formatter)(char*, int, int, const char*),
|
||||
long (*get_talk_id)(int));
|
||||
|
||||
/* the following are either not in setting.c or shouldnt be */
|
||||
bool set_time_screen(const char* string, struct tm *tm);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "config.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "lang.h"
|
||||
#include "talk.h"
|
||||
#include "lcd.h"
|
||||
|
|
@ -27,6 +27,9 @@
|
|||
#include "settings_list.h"
|
||||
#include "sound.h"
|
||||
#include "dsp.h"
|
||||
#include "debug.h"
|
||||
#include "mpeg.h"
|
||||
#include "audio.h"
|
||||
|
||||
/* some sets of values which are used more than once, to save memory */
|
||||
static const char off_on[] = "off,on";
|
||||
|
|
@ -76,6 +79,34 @@ static const char trig_durations_conf [] =
|
|||
static const char backlight_times_conf [] =
|
||||
"off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
|
||||
#endif
|
||||
/* ffwd/rewind and scan acceleration stuff */
|
||||
static int ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60};
|
||||
static long ff_rewind_min_step_getlang(int value)
|
||||
{
|
||||
return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC);
|
||||
}
|
||||
static void ff_rewind_min_step_formatter(char *buffer, int buffer_size,
|
||||
int val, const char *unit)
|
||||
{
|
||||
(void)unit;
|
||||
snprintf(buffer, buffer_size, "%ds", ff_rewind_min_stepvals[val]);
|
||||
}
|
||||
static long scanaccel_getlang(int value)
|
||||
{
|
||||
if (value == 0)
|
||||
return LANG_OFF;
|
||||
return TALK_ID(value, UNIT_SEC);
|
||||
}
|
||||
static void scanaccel_formatter(char *buffer, int buffer_size,
|
||||
int val, const char *unit)
|
||||
{
|
||||
(void)unit;
|
||||
if (val == 0)
|
||||
strcpy(buffer, str(LANG_OFF));
|
||||
else
|
||||
snprintf(buffer, buffer_size, "2x/%ds", val);
|
||||
}
|
||||
|
||||
|
||||
#define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
|
||||
/** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
|
||||
|
|
@ -155,13 +186,21 @@ static const char backlight_times_conf [] =
|
|||
{cb, count, {.talks = (int[]){__VA_ARGS__}}}}}}
|
||||
|
||||
/* for settings which use the set_int() setting screen.
|
||||
unit is the UNIT_ define to display/talk. */
|
||||
#define INT_SETTING(flags, var, lang_id, default, name, \
|
||||
unit, min, max, step, formatter, cb) \
|
||||
unit is the UNIT_ define to display/talk.
|
||||
the first one saves a string to the config file,
|
||||
the second one saves the variable value to the config file */
|
||||
#define INT_SETTING_W_CFGVALS(flags, var, lang_id, default, name, cfg_vals, \
|
||||
unit, min, max, step, formatter, get_talk_id, cb) \
|
||||
{flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
|
||||
lang_id, INT(default), \
|
||||
name, NULL, {.int_setting = (struct int_setting[]){ \
|
||||
{cb, unit, min, max, step, formatter}}}}
|
||||
lang_id, INT(default), name, cfg_vals, \
|
||||
{.int_setting = (struct int_setting[]){ \
|
||||
{cb, unit, min, max, step, formatter, get_talk_id}}}}
|
||||
#define INT_SETTING(flags, var, lang_id, default, name, \
|
||||
unit, min, max, step, formatter, get_talk_id, cb) \
|
||||
{flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
|
||||
lang_id, INT(default), name, NULL, \
|
||||
{.int_setting = (struct int_setting[]){ \
|
||||
{cb, unit, min, max, step, formatter, get_talk_id}}}}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static void crossfeed_format(char* buffer, int buffer_size, int value,
|
||||
|
|
@ -188,6 +227,16 @@ static void crossfeed_hf_cutoff_helper(int val)
|
|||
global_settings.crossfeed_cross_gain
|
||||
+ global_settings.crossfeed_hf_attenuation, val);
|
||||
}
|
||||
|
||||
static void replaygain_preamp_format(char* buffer, int buffer_size, int value,
|
||||
const char* unit)
|
||||
{
|
||||
int v = abs(value);
|
||||
|
||||
snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "",
|
||||
v / 10, v % 10, unit);
|
||||
}
|
||||
|
||||
#endif
|
||||
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
||||
static void set_mdb_enable(bool value)
|
||||
|
|
@ -277,7 +326,7 @@ const struct settings_list settings[] = {
|
|||
SYSTEM_SETTING(NVRAM(4),topruntime,0),
|
||||
#if MEM > 1
|
||||
INT_SETTING(0,max_files_in_playlist,LANG_MAX_FILES_IN_PLAYLIST,10000,
|
||||
"max files in playlist", UNIT_INT,1000,20000,1000,NULL,NULL),
|
||||
"max files in playlist", UNIT_INT,1000,20000,1000,NULL,NULL,NULL),
|
||||
{F_T_INT,&global_settings.max_files_in_dir,LANG_MAX_FILES_IN_DIR,
|
||||
INT(400),"max files in dir",NULL,UNUSED},
|
||||
#else
|
||||
|
|
@ -398,16 +447,21 @@ const struct settings_list settings[] = {
|
|||
OFFON_SETTING(0,play_selected,LANG_PLAY_SELECTED,true,"play selected",NULL),
|
||||
OFFON_SETTING(0,party_mode,LANG_PARTY_MODE,false,"party mode",NULL),
|
||||
OFFON_SETTING(0,fade_on_stop,LANG_FADE_ON_STOP,true,"volume fade",NULL),
|
||||
{F_T_INT,&global_settings.ff_rewind_min_step,LANG_FFRW_STEP,INT(FF_REWIND_1000),
|
||||
"scan min step","1,2,3,4,5,6,8,10,15,20,25,30,45,60",UNUSED},
|
||||
{F_T_INT,&global_settings.ff_rewind_accel,LANG_FFRW_ACCEL,INT(3),
|
||||
"scan accel",NULL,UNUSED},
|
||||
INT_SETTING_W_CFGVALS(0, ff_rewind_min_step, LANG_FFRW_STEP, FF_REWIND_1000,
|
||||
"scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60", UNIT_SEC,
|
||||
13, 0, -1, ff_rewind_min_step_formatter,
|
||||
ff_rewind_min_step_getlang, NULL),
|
||||
INT_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 3, "scan accel",
|
||||
UNIT_SEC, 16, 0, -1, scanaccel_formatter, scanaccel_getlang, NULL),
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
{F_T_INT,&global_settings.buffer_margin,LANG_MP3BUFFER_MARGIN,INT(0),"antiskip",
|
||||
"5s,15s,30s,1min,2min,3min,5min,10min",UNUSED},
|
||||
STRINGCHOICE_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,"antiskip",
|
||||
"5s,15s,30s,1min,2min,3min,5min,10min",NULL, 8,
|
||||
TALK_ID(5, UNIT_SEC), TALK_ID(15, UNIT_SEC),
|
||||
TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN), TALK_ID(2, UNIT_MIN),
|
||||
TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
|
||||
#else
|
||||
{F_T_INT,&global_settings.buffer_margin,LANG_MP3BUFFER_MARGIN,INT(0),
|
||||
"antiskip",NULL,UNUSED},
|
||||
INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip", \
|
||||
UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
|
||||
#endif
|
||||
/* disk */
|
||||
#ifndef HAVE_MMC
|
||||
|
|
@ -482,9 +536,9 @@ const struct settings_list settings[] = {
|
|||
"sort files","alpha,oldest,newest,type",UNUSED},
|
||||
{F_T_INT,&global_settings.sort_dir,LANG_SORT_DIR,INT(0),
|
||||
"sort dirs","alpha,oldest,newest",UNUSED},
|
||||
BOOL_SETTING(0,id3_v1_first,LANG_ID3_ORDER,false,
|
||||
"id3 tag priority","v2-v1,v1-v2",
|
||||
LANG_ID3_V2_FIRST,LANG_ID3_V1_FIRST,NULL),
|
||||
BOOL_SETTING(0, id3_v1_first, LANG_ID3_ORDER, false,
|
||||
"id3 tag priority", "v2-v1,v1-v2",
|
||||
LANG_ID3_V2_FIRST, LANG_ID3_V1_FIRST, mpeg_id3_options),
|
||||
|
||||
#ifdef HAVE_RECORDING
|
||||
/* recording */
|
||||
|
|
@ -567,57 +621,61 @@ const struct settings_list settings[] = {
|
|||
#endif /* HAVE_RECORDING */
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
OFFON_SETTING(0,spdif_enable,LANG_SPDIF_ENABLE,false,"spdif enable",NULL),
|
||||
OFFON_SETTING(0, spdif_enable, LANG_SPDIF_ENABLE, false,
|
||||
"spdif enable", spdif_power_enable),
|
||||
#endif
|
||||
{F_T_INT,&global_settings.next_folder,LANG_NEXT_FOLDER,INT(FOLDER_ADVANCE_OFF),
|
||||
"folder navigation","off,on,random",UNUSED},
|
||||
CHOICE_SETTING(0, next_folder, LANG_NEXT_FOLDER, FOLDER_ADVANCE_OFF,
|
||||
"folder navigation", "off,on,random",NULL ,3,
|
||||
ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES), ID2P(LANG_RANDOM)),
|
||||
OFFON_SETTING(0,runtimedb,LANG_RUNTIMEDB_ACTIVE,false,"gather runtime data",NULL),
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* replay gain */
|
||||
OFFON_SETTING(0,replaygain,LANG_REPLAYGAIN,false,"replaygain",NULL),
|
||||
{F_T_INT,&global_settings.replaygain_type,LANG_REPLAYGAIN_MODE,INT(REPLAYGAIN_ALBUM),
|
||||
"replaygain type","track,album,track shuffle",UNUSED},
|
||||
OFFON_SETTING(0,replaygain_noclip,LANG_REPLAYGAIN_NOCLIP,
|
||||
false,"replaygain noclip",NULL),
|
||||
{F_T_INT,&global_settings.replaygain_preamp,LANG_REPLAYGAIN_PREAMP,
|
||||
INT(0),"replaygain preamp",NULL,UNUSED},
|
||||
|
||||
{F_T_INT,&global_settings.beep,LANG_BEEP,INT(0),"beep","off,weak,moderate,strong",UNUSED},
|
||||
OFFON_SETTING(0, replaygain, LANG_REPLAYGAIN, false, "replaygain", NULL),
|
||||
CHOICE_SETTING(0, replaygain_type, LANG_REPLAYGAIN_MODE, REPLAYGAIN_ALBUM,
|
||||
"replaygain type", "track,album,track shuffle", NULL, 3,
|
||||
ID2P(LANG_TRACK_GAIN), ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN)),
|
||||
OFFON_SETTING(0, replaygain_noclip, LANG_REPLAYGAIN_NOCLIP,
|
||||
false, "replaygain noclip", NULL),
|
||||
INT_SETTING(0, replaygain_preamp, LANG_REPLAYGAIN_PREAMP, 0, "replaygain preamp",
|
||||
UNIT_DB, -120, 120, 1, replaygain_preamp_format, NULL, NULL),
|
||||
|
||||
CHOICE_SETTING(0, beep, LANG_BEEP, 0,
|
||||
"beep", "off,weak,moderate,strong", NULL, 3,
|
||||
ID2P(LANG_OFF), ID2P(LANG_WEAK), ID2P(LANG_MODERATE), ID2P(LANG_STRONG)),
|
||||
|
||||
/* crossfade */
|
||||
{F_T_INT,&global_settings.crossfade,LANG_CROSSFADE_ENABLE,INT(0),"crossfade",
|
||||
"off,shuffle,track skip,shuffle and track skip,always",UNUSED},
|
||||
{F_T_INT,&global_settings.crossfade_fade_in_delay,LANG_CROSSFADE_FADE_IN_DELAY,INT(0),
|
||||
"crossfade fade in delay",NULL,UNUSED},
|
||||
{F_T_INT,&global_settings.crossfade_fade_out_delay,
|
||||
LANG_CROSSFADE_FADE_OUT_DELAY,INT(0),
|
||||
"crossfade fade out delay",NULL,UNUSED},
|
||||
{F_T_INT,&global_settings.crossfade_fade_in_duration,
|
||||
LANG_CROSSFADE_FADE_IN_DURATION,INT(0),
|
||||
"crossfade fade in duration",NULL,UNUSED},
|
||||
{F_T_INT,&global_settings.crossfade_fade_out_duration,
|
||||
LANG_CROSSFADE_FADE_OUT_DURATION,INT(0),
|
||||
"crossfade fade out duration",NULL,UNUSED},
|
||||
{F_T_INT,&global_settings.crossfade_fade_out_mixmode,
|
||||
LANG_CROSSFADE_FADE_OUT_MODE,INT(0),
|
||||
"crossfade fade out mode","crossfade,mix",UNUSED},
|
||||
CHOICE_SETTING(0, crossfade, LANG_CROSSFADE_ENABLE, 0, "crossfade",
|
||||
"off,shuffle,track skip,shuffle and track skip,always",NULL, 5,
|
||||
ID2P(LANG_OFF), ID2P(LANG_SHUFFLE), ID2P(LANG_TRACKSKIP),
|
||||
ID2P(LANG_SHUFFLE_TRACKSKIP), ID2P(LANG_ALWAYS)),
|
||||
INT_SETTING(0, crossfade_fade_in_delay, LANG_CROSSFADE_FADE_IN_DELAY, 0,
|
||||
"crossfade fade in delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
|
||||
INT_SETTING(0, crossfade_fade_out_delay, LANG_CROSSFADE_FADE_OUT_DELAY, 0,
|
||||
"crossfade fade out delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
|
||||
INT_SETTING(0, crossfade_fade_in_duration, LANG_CROSSFADE_FADE_IN_DURATION, 0,
|
||||
"crossfade fade in duration", UNIT_SEC, 0, 15, 1, NULL, NULL, NULL),
|
||||
INT_SETTING(0, crossfade_fade_out_duration, LANG_CROSSFADE_FADE_OUT_DURATION, 0,
|
||||
"crossfade fade out duration", UNIT_SEC, 0, 15, 1, NULL, NULL, NULL),
|
||||
CHOICE_SETTING(0, crossfade_fade_out_mixmode, LANG_CROSSFADE_FADE_OUT_MODE,
|
||||
0, "crossfade fade out mode", "crossfade,mix" ,NULL, 2,
|
||||
ID2P(LANG_CROSSFADE), ID2P(LANG_MIX)),
|
||||
|
||||
/* crossfeed */
|
||||
OFFON_SETTING(0,crossfeed, LANG_CROSSFEED, false,
|
||||
"crossfeed", dsp_set_crossfeed),
|
||||
INT_SETTING(0, crossfeed_direct_gain, LANG_CROSSFEED_DIRECT_GAIN, 15,
|
||||
"crossfeed direct gain", UNIT_DB, 0, 60, 5,
|
||||
crossfeed_format, dsp_set_crossfeed_direct_gain),
|
||||
crossfeed_format, NULL, dsp_set_crossfeed_direct_gain),
|
||||
INT_SETTING(0, crossfeed_cross_gain, LANG_CROSSFEED_CROSS_GAIN, 60,
|
||||
"crossfeed cross gain", UNIT_DB, 30, 120, 5,
|
||||
crossfeed_format, crossfeed_cross_gain_helper),
|
||||
crossfeed_format, NULL, crossfeed_cross_gain_helper),
|
||||
INT_SETTING(0, crossfeed_hf_attenuation, LANG_CROSSFEED_HF_ATTENUATION, 160,
|
||||
"crossfeed hf attenuation", UNIT_DB, 60, 240, 5,
|
||||
crossfeed_format, crossfeed_hf_att_helper),
|
||||
crossfeed_format, NULL, crossfeed_hf_att_helper),
|
||||
INT_SETTING(0, crossfeed_hf_cutoff, LANG_CROSSFEED_HF_CUTOFF,700,
|
||||
"crossfeed hf cutoff", UNIT_HERTZ, 500, 2000, 100,
|
||||
crossfeed_format, crossfeed_hf_cutoff_helper),
|
||||
crossfeed_format, NULL, crossfeed_hf_cutoff_helper),
|
||||
/* equalizer */
|
||||
OFFON_SETTING(0,eq_enabled,LANG_EQUALIZER_ENABLED,false,"eq enabled",NULL),
|
||||
{F_T_INT,&global_settings.eq_precut,LANG_EQUALIZER_PRECUT,INT(0),
|
||||
|
|
@ -763,10 +821,11 @@ const struct settings_list settings[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
{F_T_INT,&global_settings.unplug_mode,LANG_UNPLUG,INT(0),
|
||||
"pause on headphone unplug",NULL,UNUSED},
|
||||
{F_T_INT,&global_settings.unplug_rw,LANG_UNPLUG_RW,INT(0),
|
||||
"rewind duration on pause",NULL,UNUSED},
|
||||
CHOICE_SETTING(0, unplug_mode, LANG_UNPLUG, 0,
|
||||
"pause on headphone unplug", "off,pause,pause and resume", NULL, 3,
|
||||
ID2P(LANG_OFF), ID2P(LANG_PAUSE), ID2P(LANG_UNPLUG_RESUME)),
|
||||
INT_SETTING(0, unplug_rw, LANG_UNPLUG_RW, 0, "rewind duration on pause",
|
||||
UNIT_SEC, 0, 15, 1, NULL, NULL,NULL) ,
|
||||
OFFON_SETTING(0,unplug_autoresume,LANG_UNPLUG_DISABLE_AUTORESUME,false,
|
||||
"disable autoresume if phones not present",NULL),
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ struct int_setting {
|
|||
int max;
|
||||
int step;
|
||||
void (*formatter)(char*, int, int, const char*);
|
||||
long (*get_talk_id)(int);
|
||||
};
|
||||
#define F_INT_SETTING 0x80
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ void dac_line_in(bool enable);
|
|||
#if LCD_DEPTH > 1
|
||||
#include "backdrop.h"
|
||||
#endif
|
||||
#include "menus/exported_menus.h"
|
||||
|
||||
#ifdef CONFIG_CHARGING
|
||||
static bool car_adapter_mode(void)
|
||||
|
|
@ -733,40 +734,6 @@ static bool peak_meter_menu(void)
|
|||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
static bool shuffle(void)
|
||||
{
|
||||
return set_bool( str(LANG_SHUFFLE), &global_settings.playlist_shuffle );
|
||||
}
|
||||
|
||||
static bool repeat_mode(void)
|
||||
{
|
||||
bool result;
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_OFF) },
|
||||
{ STR(LANG_REPEAT_ALL) },
|
||||
{ STR(LANG_REPEAT_ONE) },
|
||||
{ STR(LANG_SHUFFLE) },
|
||||
#if (AB_REPEAT_ENABLE == 1)
|
||||
{ STR(LANG_REPEAT_AB) }
|
||||
#endif
|
||||
};
|
||||
int old_repeat = global_settings.repeat_mode;
|
||||
|
||||
result = set_option( str(LANG_REPEAT), &global_settings.repeat_mode,
|
||||
INT, names, NUM_REPEAT_MODES, NULL );
|
||||
|
||||
if (old_repeat != global_settings.repeat_mode &&
|
||||
(audio_status() & AUDIO_STATUS_PLAY))
|
||||
audio_flush_and_reload_tracks();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool play_selected(void)
|
||||
{
|
||||
return set_bool( str(LANG_PLAY_SELECTED), &global_settings.play_selected );
|
||||
}
|
||||
|
||||
static bool dir_filter(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
|
|
@ -825,23 +792,6 @@ static bool sort_dir(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static bool resume(void)
|
||||
{
|
||||
return set_bool( str(LANG_RESUME), &global_settings.resume);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
static bool spdif(void)
|
||||
{
|
||||
bool rc = set_bool_options(str(LANG_SPDIF_ENABLE),
|
||||
&global_settings.spdif_enable,
|
||||
STR(LANG_ON),
|
||||
STR(LANG_OFF),
|
||||
spdif_power_enable);
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool autocreatebookmark(void)
|
||||
{
|
||||
bool retval = false;
|
||||
|
|
@ -1153,68 +1103,6 @@ static bool max_files_in_playlist(void)
|
|||
NULL, 1000, 1000, 20000, NULL );
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static bool buffer_margin(void)
|
||||
{
|
||||
int ret;
|
||||
static const struct opt_items names[] = {
|
||||
{ "5s", TALK_ID(5, UNIT_SEC) },
|
||||
{ "15s", TALK_ID(15, UNIT_SEC) },
|
||||
{ "30s", TALK_ID(30, UNIT_SEC) },
|
||||
{ "1min", TALK_ID(1, UNIT_MIN) },
|
||||
{ "2min", TALK_ID(2, UNIT_MIN) },
|
||||
{ "3min", TALK_ID(3, UNIT_MIN) },
|
||||
{ "5min", TALK_ID(5, UNIT_MIN) },
|
||||
{ "10min", TALK_ID(10, UNIT_MIN) }
|
||||
};
|
||||
|
||||
ret = set_option(str(LANG_MP3BUFFER_MARGIN), &global_settings.buffer_margin,
|
||||
INT, names, 8, NULL);
|
||||
audio_set_buffer_margin(global_settings.buffer_margin);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
static bool buffer_margin(void)
|
||||
{
|
||||
return set_int(str(LANG_MP3BUFFER_MARGIN), "s", UNIT_SEC,
|
||||
&global_settings.buffer_margin,
|
||||
audio_set_buffer_margin, 1, 0, 7, NULL );
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool ff_rewind_min_step(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ "1s", TALK_ID(1, UNIT_SEC) },
|
||||
{ "2s", TALK_ID(2, UNIT_SEC) },
|
||||
{ "3s", TALK_ID(3, UNIT_SEC) },
|
||||
{ "4s", TALK_ID(4, UNIT_SEC) },
|
||||
{ "5s", TALK_ID(5, UNIT_SEC) },
|
||||
{ "6s", TALK_ID(6, UNIT_SEC) },
|
||||
{ "8s", TALK_ID(8, UNIT_SEC) },
|
||||
{ "10s", TALK_ID(10, UNIT_SEC) },
|
||||
{ "15s", TALK_ID(15, UNIT_SEC) },
|
||||
{ "20s", TALK_ID(20, UNIT_SEC) },
|
||||
{ "25s", TALK_ID(25, UNIT_SEC) },
|
||||
{ "30s", TALK_ID(30, UNIT_SEC) },
|
||||
{ "45s", TALK_ID(45, UNIT_SEC) },
|
||||
{ "60s", TALK_ID(60, UNIT_SEC) }
|
||||
};
|
||||
return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step,
|
||||
INT, names, 14, NULL );
|
||||
}
|
||||
|
||||
static bool set_fade_on_stop(void)
|
||||
{
|
||||
return set_bool( str(LANG_FADE_ON_STOP), &global_settings.fade_on_stop );
|
||||
}
|
||||
|
||||
static bool set_party_mode(void)
|
||||
{
|
||||
return set_bool( str(LANG_PARTY_MODE), &global_settings.party_mode );
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
static bool set_bl_filter_first_keypress(void)
|
||||
{
|
||||
|
|
@ -1234,30 +1122,6 @@ static bool set_remote_bl_filter_first_keypress(void)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static bool ff_rewind_accel(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_OFF) },
|
||||
{ "2x/1s", TALK_ID(1, UNIT_SEC) },
|
||||
{ "2x/2s", TALK_ID(2, UNIT_SEC) },
|
||||
{ "2x/3s", TALK_ID(3, UNIT_SEC) },
|
||||
{ "2x/4s", TALK_ID(4, UNIT_SEC) },
|
||||
{ "2x/5s", TALK_ID(5, UNIT_SEC) },
|
||||
{ "2x/6s", TALK_ID(6, UNIT_SEC) },
|
||||
{ "2x/7s", TALK_ID(7, UNIT_SEC) },
|
||||
{ "2x/8s", TALK_ID(8, UNIT_SEC) },
|
||||
{ "2x/9s", TALK_ID(9, UNIT_SEC) },
|
||||
{ "2x/10s", TALK_ID(10, UNIT_SEC) },
|
||||
{ "2x/11s", TALK_ID(11, UNIT_SEC) },
|
||||
{ "2x/12s", TALK_ID(12, UNIT_SEC) },
|
||||
{ "2x/13s", TALK_ID(13, UNIT_SEC) },
|
||||
{ "2x/14s", TALK_ID(14, UNIT_SEC) },
|
||||
{ "2x/15s", TALK_ID(15, UNIT_SEC) }
|
||||
};
|
||||
return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel,
|
||||
INT, names, 16, NULL );
|
||||
}
|
||||
|
||||
static bool browse_current(void)
|
||||
{
|
||||
return set_bool( str(LANG_FOLLOW), &global_settings.browse_current );
|
||||
|
|
@ -1373,62 +1237,6 @@ static bool button_bar(void)
|
|||
#endif /* CONFIG_KEYPAD == RECORDER_PAD */
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
static bool ff_rewind_settings_menu(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_FFRW_STEP), ff_rewind_min_step },
|
||||
{ ID2P(LANG_FFRW_ACCEL), ff_rewind_accel },
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool id3_order(void)
|
||||
{
|
||||
return set_bool_options( str(LANG_ID3_ORDER),
|
||||
&global_settings.id3_v1_first,
|
||||
STR(LANG_ID3_V1_FIRST),
|
||||
STR(LANG_ID3_V2_FIRST),
|
||||
mpeg_id3_options);
|
||||
}
|
||||
|
||||
static bool next_folder(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_SET_BOOL_NO) },
|
||||
{ STR(LANG_SET_BOOL_YES) },
|
||||
{ STR(LANG_RANDOM) },
|
||||
};
|
||||
return set_option(str(LANG_NEXT_FOLDER),
|
||||
&global_settings.next_folder,
|
||||
INT, names, 3, NULL );
|
||||
}
|
||||
|
||||
static bool audioscrobbler(void)
|
||||
{
|
||||
bool result = set_bool_options(str(LANG_AUDIOSCROBBLER),
|
||||
&global_settings.audioscrobbler,
|
||||
STR(LANG_ON),
|
||||
STR(LANG_OFF),
|
||||
NULL);
|
||||
|
||||
if (!scrobbler_is_enabled() && global_settings.audioscrobbler)
|
||||
gui_syncsplash(HZ*2, true, str(LANG_PLEASE_REBOOT));
|
||||
|
||||
if(scrobbler_is_enabled() && !global_settings.audioscrobbler)
|
||||
scrobbler_shutdown();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool codepage_setting(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
|
|
@ -1451,193 +1259,6 @@ static bool codepage_setting(void)
|
|||
INT, names, 13, set_codepage );
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static bool replaygain(void)
|
||||
{
|
||||
bool result = set_bool(str(LANG_REPLAYGAIN_ENABLE),
|
||||
&global_settings.replaygain);
|
||||
|
||||
dsp_set_replaygain(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool replaygain_mode(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_TRACK_GAIN) },
|
||||
{ STR(LANG_ALBUM_GAIN) },
|
||||
{ STR(LANG_SHUFFLE_GAIN) },
|
||||
};
|
||||
bool result = set_option(str(LANG_REPLAYGAIN_MODE),
|
||||
&global_settings.replaygain_type, INT, names, 3, NULL);
|
||||
|
||||
dsp_set_replaygain(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool replaygain_noclip(void)
|
||||
{
|
||||
bool result = set_bool(str(LANG_REPLAYGAIN_NOCLIP),
|
||||
&global_settings.replaygain_noclip);
|
||||
|
||||
dsp_set_replaygain(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void replaygain_preamp_format(char* buffer, int buffer_size, int value,
|
||||
const char* unit)
|
||||
{
|
||||
int v = abs(value);
|
||||
|
||||
snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "",
|
||||
v / 10, v % 10, unit);
|
||||
}
|
||||
|
||||
static bool replaygain_preamp(void)
|
||||
{
|
||||
bool result = set_int(str(LANG_REPLAYGAIN_PREAMP), str(LANG_UNIT_DB),
|
||||
UNIT_DB, &global_settings.replaygain_preamp, NULL, 1, -120, 120,
|
||||
replaygain_preamp_format);
|
||||
|
||||
dsp_set_replaygain(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool replaygain_settings_menu(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_REPLAYGAIN_ENABLE), replaygain },
|
||||
{ ID2P(LANG_REPLAYGAIN_NOCLIP), replaygain_noclip },
|
||||
{ ID2P(LANG_REPLAYGAIN_MODE), replaygain_mode },
|
||||
{ ID2P(LANG_REPLAYGAIN_PREAMP), replaygain_preamp },
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool crossfade(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_OFF) },
|
||||
{ STR(LANG_SHUFFLE) },
|
||||
{ STR(LANG_TRACKSKIP) },
|
||||
{ STR(LANG_SHUFFLE_TRACKSKIP) },
|
||||
{ STR(LANG_ALWAYS) },
|
||||
};
|
||||
|
||||
bool ret;
|
||||
|
||||
ret=set_option( str(LANG_CROSSFADE_ENABLE),
|
||||
&global_settings.crossfade, INT, names, 5, NULL);
|
||||
audio_set_crossfade(global_settings.crossfade);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool crossfade_fade_in_delay(void)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = set_int(str(LANG_CROSSFADE_FADE_IN_DELAY), "s", UNIT_SEC,
|
||||
&global_settings.crossfade_fade_in_delay,
|
||||
NULL, 1, 0, 7, NULL );
|
||||
audio_set_crossfade(global_settings.crossfade);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool crossfade_fade_out_delay(void)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = set_int(str(LANG_CROSSFADE_FADE_OUT_DELAY), "s", UNIT_SEC,
|
||||
&global_settings.crossfade_fade_out_delay,
|
||||
NULL, 1, 0, 7, NULL );
|
||||
audio_set_crossfade(global_settings.crossfade);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool crossfade_fade_in_duration(void)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = set_int(str(LANG_CROSSFADE_FADE_IN_DURATION), "s", UNIT_SEC,
|
||||
&global_settings.crossfade_fade_in_duration,
|
||||
NULL, 1, 0, 15, NULL );
|
||||
audio_set_crossfade(global_settings.crossfade);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool crossfade_fade_out_duration(void)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = set_int(str(LANG_CROSSFADE_FADE_OUT_DURATION), "s", UNIT_SEC,
|
||||
&global_settings.crossfade_fade_out_duration,
|
||||
NULL, 1, 0, 15, NULL );
|
||||
audio_set_crossfade(global_settings.crossfade);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool crossfade_fade_out_mixmode(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_CROSSFADE) },
|
||||
{ STR(LANG_MIX) },
|
||||
};
|
||||
bool ret;
|
||||
ret=set_option( str(LANG_CROSSFADE_FADE_OUT_MODE),
|
||||
&global_settings.crossfade_fade_out_mixmode, INT, names, 2, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu to configure the crossfade settings.
|
||||
*/
|
||||
static bool crossfade_settings_menu(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_CROSSFADE_ENABLE), crossfade },
|
||||
{ ID2P(LANG_CROSSFADE_FADE_IN_DELAY), crossfade_fade_in_delay },
|
||||
{ ID2P(LANG_CROSSFADE_FADE_IN_DURATION), crossfade_fade_in_duration },
|
||||
{ ID2P(LANG_CROSSFADE_FADE_OUT_DELAY), crossfade_fade_out_delay },
|
||||
{ ID2P(LANG_CROSSFADE_FADE_OUT_DURATION), crossfade_fade_out_duration },
|
||||
{ ID2P(LANG_CROSSFADE_FADE_OUT_MODE), crossfade_fade_out_mixmode },
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool beep(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_OFF) },
|
||||
{ STR(LANG_WEAK) },
|
||||
{ STR(LANG_MODERATE) },
|
||||
{ STR(LANG_STRONG) },
|
||||
};
|
||||
bool ret;
|
||||
ret=set_option( str(LANG_BEEP),
|
||||
&global_settings.beep, INT, names, 4, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_DIRCACHE
|
||||
static bool dircache(void)
|
||||
{
|
||||
|
|
@ -1716,111 +1337,9 @@ static bool tagcache_settings_menu(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
static bool unplug_mode(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
{ STR(LANG_OFF) },
|
||||
{ STR(LANG_PAUSE) },
|
||||
{ STR(LANG_UNPLUG_RESUME) },
|
||||
};
|
||||
bool ret;
|
||||
ret=set_option( str(LANG_UNPLUG),
|
||||
&global_settings.unplug_mode, INT, names, 3, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool unplug_rw(void)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = set_int(str(LANG_UNPLUG_RW), "s", UNIT_SEC,
|
||||
&global_settings.unplug_rw,
|
||||
NULL, 1, 0, 15, NULL );
|
||||
audio_set_crossfade(global_settings.unplug_rw);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool unplug_autoresume(void)
|
||||
{
|
||||
return set_bool( str(LANG_UNPLUG_DISABLE_AUTORESUME),
|
||||
&global_settings.unplug_autoresume );
|
||||
}
|
||||
|
||||
static bool unplug_menu(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_UNPLUG), unplug_mode },
|
||||
{ ID2P(LANG_UNPLUG_RW), unplug_rw },
|
||||
{ ID2P(LANG_UNPLUG_DISABLE_AUTORESUME), unplug_autoresume },
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool playback_settings_menu(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_SHUFFLE), shuffle },
|
||||
{ ID2P(LANG_REPEAT), repeat_mode },
|
||||
{ ID2P(LANG_PLAY_SELECTED), play_selected },
|
||||
{ ID2P(LANG_RESUME), resume },
|
||||
{ ID2P(LANG_WIND_MENU), ff_rewind_settings_menu },
|
||||
{ ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin },
|
||||
{ ID2P(LANG_FADE_ON_STOP), set_fade_on_stop },
|
||||
{ ID2P(LANG_PARTY_MODE), set_party_mode },
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
{ ID2P(LANG_CROSSFADE), crossfade_settings_menu },
|
||||
{ ID2P(LANG_REPLAYGAIN), replaygain_settings_menu },
|
||||
{ ID2P(LANG_BEEP), beep },
|
||||
#endif
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
{ ID2P(LANG_SPDIF_ENABLE), spdif },
|
||||
#endif
|
||||
{ ID2P(LANG_ID3_ORDER), id3_order },
|
||||
{ ID2P(LANG_NEXT_FOLDER), next_folder },
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
{ ID2P(LANG_UNPLUG), unplug_menu },
|
||||
#endif
|
||||
{ ID2P(LANG_AUDIOSCROBBLER), audioscrobbler}
|
||||
};
|
||||
|
||||
bool old_shuffle = global_settings.playlist_shuffle;
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
|
||||
if ((old_shuffle != global_settings.playlist_shuffle)
|
||||
&& (audio_status() & AUDIO_STATUS_PLAY))
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
dsp_set_replaygain(true);
|
||||
#endif
|
||||
|
||||
if (global_settings.playlist_shuffle)
|
||||
{
|
||||
playlist_randomise(NULL, current_tick, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
playlist_sort(NULL, true);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return do_menu(&playback_menu_item);
|
||||
}
|
||||
|
||||
static bool bookmark_settings_menu(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue