forked from len0rd/rockbox
Disable 'Disk spindown' and 'Anti skip buffer' settings and some related stuff for flash storage targets as they make no sense
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14110 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3b3fd4997e
commit
0bfa3e76ce
17 changed files with 62 additions and 15 deletions
|
@ -62,6 +62,7 @@ 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, Icon_NOICON,
|
||||
&ff_rewind_min_step, &ff_rewind_accel);
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int buffermargin_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
|
@ -79,6 +80,7 @@ int buffermargin_callback(int action,const struct menu_item_ex *this_item)
|
|||
#endif
|
||||
MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
|
||||
buffermargin_callback);
|
||||
#endif /*HAVE_FLASH_STORAGE */
|
||||
MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL);
|
||||
MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL);
|
||||
|
||||
|
@ -172,8 +174,11 @@ MAKE_MENU(unplug_menu, ID2P(LANG_UNPLUG), 0, Icon_NOICON,
|
|||
MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0,
|
||||
Icon_Playback_menu,
|
||||
&shuffle_item, &repeat_mode, &play_selected,
|
||||
&ff_rewind_settings_menu,
|
||||
&buffer_margin, &fade_on_stop, &party_mode,
|
||||
&ff_rewind_settings_menu,
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
&buffer_margin,
|
||||
#endif
|
||||
&fade_on_stop, &party_mode,
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&crossfade_settings_menu, &replaygain_settings_menu, &beep,
|
||||
|
|
|
@ -160,8 +160,9 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON,
|
|||
);
|
||||
#endif /* SIMULATOR */
|
||||
/* Disk */
|
||||
#ifndef HAVE_MMC
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
|
||||
#endif
|
||||
#ifdef HAVE_DIRCACHE
|
||||
static int dircache_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
|
@ -186,8 +187,11 @@ static int dircache_callback(int action,const struct menu_item_ex *this_item)
|
|||
}
|
||||
MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
|
||||
#endif
|
||||
#if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE)
|
||||
MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
&disk_spindown,
|
||||
#endif
|
||||
#ifdef HAVE_DIRCACHE
|
||||
&dircache,
|
||||
#endif
|
||||
|
|
|
@ -792,6 +792,7 @@ int audio_get_file_pos(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
void audio_set_buffer_margin(int setting)
|
||||
{
|
||||
static const int lookup[] = {5, 15, 30, 60, 120, 180, 300, 600};
|
||||
|
@ -799,6 +800,7 @@ void audio_set_buffer_margin(int setting)
|
|||
logf("buffer margin: %ld", buffer_margin);
|
||||
set_filebuf_watermark(buffer_margin);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Take nescessary steps to enable or disable the crossfade setting */
|
||||
void audio_set_crossfade(int enable)
|
||||
|
@ -3839,5 +3841,8 @@ void audio_init(void)
|
|||
#ifdef HAVE_WM8758
|
||||
eq_hw_enable(global_settings.eq_hw_enabled);
|
||||
#endif
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
audio_set_buffer_margin(global_settings.buffer_margin);
|
||||
#endif
|
||||
} /* audio_init */
|
||||
|
||||
|
|
|
@ -1172,9 +1172,11 @@ static void playlist_thread(void)
|
|||
|
||||
int sleep_time = 5;
|
||||
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
if (global_settings.disk_spindown > 1 &&
|
||||
global_settings.disk_spindown <= 5)
|
||||
sleep_time = global_settings.disk_spindown - 1;
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
|
|
@ -188,15 +188,17 @@ void thread(void)
|
|||
#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
|
||||
unsigned int last_state = 0;
|
||||
#endif
|
||||
long sleep_time;
|
||||
long sleep_time = 5 * HZ;
|
||||
|
||||
struct event ev;
|
||||
|
||||
buffelements = sizeof(bat)/sizeof(struct batt_info);
|
||||
|
||||
sleep_time = (rb->global_settings->disk_spindown > 1) ?
|
||||
(rb->global_settings->disk_spindown - 1) * HZ : 5 * HZ;
|
||||
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
if(rb->global_settings->disk_spindown > 1)
|
||||
sleep_time = (rb->global_settings->disk_spindown - 1) * HZ;
|
||||
#endif
|
||||
|
||||
do
|
||||
{
|
||||
if(!in_usb_mode && got_info &&
|
||||
|
|
|
@ -2541,7 +2541,7 @@ int show_menu(void) /* return 1 to quit */
|
|||
break;
|
||||
}
|
||||
|
||||
#ifndef SIMULATOR
|
||||
#if !defined(SIMULATOR) && !defined(HAVE_FLASH_STORAGE)
|
||||
/* change ata spindown time based on slideshow time setting */
|
||||
immediate_ata_off = false;
|
||||
rb->ata_spindown(rb->global_settings->disk_spindown);
|
||||
|
@ -3325,7 +3325,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef SIMULATOR
|
||||
#if !defined(SIMULATOR) && !defined(HAVE_FLASH_STORAGE)
|
||||
/* set back ata spindown time in case we changed it */
|
||||
rb->ata_spindown(rb->global_settings->disk_spindown);
|
||||
#endif
|
||||
|
|
|
@ -650,8 +650,11 @@ int PlayTick(int fd)
|
|||
* gFileHdr.bps_peak / 8 / HZ;
|
||||
}
|
||||
|
||||
if (!gPlay.bRefilling
|
||||
&& rb->global_settings->disk_spindown < 20) /* condition for test only */
|
||||
if (!gPlay.bRefilling
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
&& rb->global_settings->disk_spindown < 20 /* condition for test only */
|
||||
#endif
|
||||
)
|
||||
{
|
||||
rb->ata_sleep(); /* no point in leaving the disk run til timeout */
|
||||
gPlay.bDiskSleep = true;
|
||||
|
|
|
@ -658,7 +658,9 @@ void settings_apply(void)
|
|||
DEBUGF( "settings_apply()\n" );
|
||||
sound_settings_apply();
|
||||
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
audio_set_buffer_margin(global_settings.buffer_margin);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_CONTRAST
|
||||
lcd_set_contrast(global_settings.contrast);
|
||||
|
@ -702,7 +704,9 @@ void settings_apply(void)
|
|||
#ifdef HAVE_BUTTON_LIGHT
|
||||
button_backlight_set_timeout(global_settings.button_light_timeout);
|
||||
#endif
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
ata_spindown(global_settings.disk_spindown);
|
||||
#endif
|
||||
#if (CONFIG_CODEC == MAS3507D) && !defined(SIMULATOR)
|
||||
dac_line_in(global_settings.line_in);
|
||||
#endif
|
||||
|
|
|
@ -446,8 +446,11 @@ struct user_settings
|
|||
bool play_selected; /* Plays selected file even in shuffle mode */
|
||||
int ff_rewind_min_step; /* FF/Rewind minimum step size */
|
||||
int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
|
||||
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
int disk_spindown; /* time until disk spindown, in seconds (0=off) */
|
||||
int buffer_margin; /* MP3 buffer watermark margin, in seconds */
|
||||
#endif
|
||||
|
||||
int peak_meter_release; /* units per read out */
|
||||
int peak_meter_hold; /* hold time for peak meter in 1/100 s */
|
||||
|
|
|
@ -628,15 +628,15 @@ const struct settings_list settings[] = {
|
|||
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
|
||||
#elif !defined(HAVE_FLASH_STORAGE)
|
||||
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
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
|
||||
UNIT_SEC, 3, 254, 1, NULL, NULL, ata_spindown),
|
||||
#endif /* HAVE_MMC */
|
||||
#endif /* HAVE_FLASH_STORAGE */
|
||||
/* browser */
|
||||
CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
|
||||
"all,supported,music,playlists", NULL, 4, ID2P(LANG_FILTER_ALL),
|
||||
|
|
|
@ -96,7 +96,9 @@ struct mp3entry* audio_next_track(void);
|
|||
bool audio_has_changed_track(void);
|
||||
void audio_get_debugdata(struct audio_debug *dbgdata);
|
||||
void audio_set_crossfade(int type);
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
void audio_set_buffer_margin(int seconds);
|
||||
#endif
|
||||
unsigned int audio_error(void);
|
||||
void audio_error_clear(void);
|
||||
int audio_get_file_pos(void);
|
||||
|
|
|
@ -84,6 +84,9 @@
|
|||
|
||||
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
|
||||
|
||||
/* define this if you have a flash memory storage */
|
||||
#define HAVE_FLASH_STORAGE
|
||||
|
||||
/** Non-simulator section **/
|
||||
#ifndef SIMULATOR
|
||||
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
#define MAX_CONTRAST_SETTING 63
|
||||
#define DEFAULT_CONTRAST_SETTING 40
|
||||
|
||||
/* define this if you have a flash memory storage */
|
||||
#define HAVE_FLASH_STORAGE
|
||||
|
||||
#ifndef SIMULATOR
|
||||
|
||||
/* Define this if you have a Philips PNX0101 */
|
||||
|
|
|
@ -70,6 +70,9 @@
|
|||
/* We can fade the backlight by using PWM */
|
||||
#define HAVE_BACKLIGHT_PWM_FADING
|
||||
|
||||
/* define this if you have a flash memory storage */
|
||||
#define HAVE_FLASH_STORAGE
|
||||
|
||||
#ifndef SIMULATOR
|
||||
|
||||
/* Define this if you have a PortalPlayer PP5022 */
|
||||
|
|
|
@ -48,6 +48,9 @@
|
|||
|
||||
#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */
|
||||
|
||||
/* define this if you have a flash memory storage */
|
||||
#define HAVE_FLASH_STORAGE
|
||||
|
||||
#ifndef SIMULATOR
|
||||
|
||||
/* Define this if you have a SH7034 */
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
|
||||
#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */
|
||||
|
||||
/* define this if you have a flash memory storage */
|
||||
#define HAVE_FLASH_STORAGE
|
||||
|
||||
#ifndef SIMULATOR
|
||||
|
||||
/* Define this if you have a SH7034 */
|
||||
|
|
|
@ -158,7 +158,7 @@ static int last_dma_tick = 0;
|
|||
static int last_dma_chunk_size;
|
||||
|
||||
static long low_watermark; /* Dynamic low watermark level */
|
||||
static long low_watermark_margin; /* Extra time in seconds for watermark */
|
||||
static long low_watermark_margin = 0; /* Extra time in seconds for watermark */
|
||||
static long lowest_watermark_level; /* Debug value to observe the buffer
|
||||
usage */
|
||||
#if CONFIG_CODEC == MAS3587F
|
||||
|
@ -592,10 +592,12 @@ static void recalculate_watermark(int bitrate)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
void audio_set_buffer_margin(int seconds)
|
||||
{
|
||||
low_watermark_margin = seconds;
|
||||
}
|
||||
#endif
|
||||
|
||||
void audio_get_debugdata(struct audio_debug *dbgdata)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue