summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-08-01 08:50:44 +0000
committerNils Wallménius <nils@rockbox.org>2007-08-01 08:50:44 +0000
commit0bfa3e76ce8f2c5465ff568b7f4dcf7b5fbb462f (patch)
treed84ec59c3b9fc00ce46329c01a66b8da46b0e204 /apps
parent3b3fd4997ee32cf5b0bc7cf07b3ac9a73cbcb388 (diff)
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
Diffstat (limited to 'apps')
-rw-r--r--apps/menus/playback_menu.c9
-rw-r--r--apps/menus/settings_menu.c6
-rw-r--r--apps/playback.c5
-rw-r--r--apps/playlist.c2
-rw-r--r--apps/plugins/battery_bench.c10
-rw-r--r--apps/plugins/jpeg.c4
-rw-r--r--apps/plugins/video.c7
-rw-r--r--apps/settings.c4
-rw-r--r--apps/settings.h3
-rw-r--r--apps/settings_list.c6
10 files changed, 42 insertions, 14 deletions
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index 1f6c96e421..c1de862cd0 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -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,
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 302a7428aa..2a68f80c79 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -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
diff --git a/apps/playback.c b/apps/playback.c
index 0533ddcf4c..7b9b664e9c 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -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 */
+
diff --git a/apps/playlist.c b/apps/playlist.c
index f0ac29d1ef..39d7cc1e3d 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -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)
{
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 3d8eadb639..8c71f0ecce 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -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 &&
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 54c8c6cb63..ad56475ebc 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -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
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index b56a9d0612..aca960f56e 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -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;
diff --git a/apps/settings.c b/apps/settings.c
index 0cf38266a6..958c410af8 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -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
diff --git a/apps/settings.h b/apps/settings.h
index f9ee1df7ec..4d7073bf3b 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -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 */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 76a3e41b60..74b1610411 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -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),