Index: apps/playlist.c =================================================================== --- apps/playlist.c (revision 17281) +++ apps/playlist.c (working copy) @@ -1289,11 +1289,7 @@ case SYS_TIMEOUT: playlist = ¤t_playlist; - if (playlist->control_fd >= 0 -# ifndef SIMULATOR - && ata_disk_is_active() -# endif - ) + if ((playlist->control_fd >= 0) && ata_disk_is_active()) { if (playlist->num_cached > 0) { Index: apps/recorder/recording.c =================================================================== --- apps/recorder/recording.c (revision 17281) +++ apps/recorder/recording.c (working copy) @@ -295,11 +295,7 @@ peak_valid_mem[peak_time % 3] = *peak_l; if (((peak_valid_mem[0] == peak_valid_mem[1]) && (peak_valid_mem[1] == peak_valid_mem[2])) && - ((*peak_l < 32767) -#ifndef SIMULATOR - || ata_disk_is_active() -#endif - )) + ((*peak_l < 32767) || ata_disk_is_active())) return false; if (*peak_r > *peak_l) Index: apps/recorder/peakmeter.c =================================================================== --- apps/recorder/peakmeter.c (revision 17281) +++ apps/recorder/peakmeter.c (working copy) @@ -1324,7 +1324,7 @@ long next_refresh = current_tick; long next_big_refresh = current_tick + HZ / 10; int i; -#if (CONFIG_CODEC == SWCODEC) || defined(SIMULATOR) +#if (CONFIG_CODEC == SWCODEC) bool highperf = false; #else /* On MAS targets, we need to poll as often as possible in order to not Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 17281) +++ apps/plugin.c (working copy) @@ -236,9 +236,7 @@ read_line, settings_parseline, ata_sleep, -#ifndef SIMULATOR ata_disk_is_active, -#endif ata_spin, ata_spindown, reload_directory, Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 17281) +++ apps/plugin.h (working copy) @@ -333,9 +333,7 @@ int (*read_line)(int fd, char* buffer, int buffer_size); bool (*settings_parseline)(char* line, char** name, char** value); void (*ata_sleep)(void); -#ifndef SIMULATOR bool (*ata_disk_is_active)(void); -#endif void (*ata_spin)(void); void (*ata_spindown)(int seconds); void (*reload_directory)(void); Index: apps/buffering.c =================================================================== --- apps/buffering.c (revision 17281) +++ apps/buffering.c (working copy) @@ -51,10 +51,6 @@ #include "events.h" #include "metadata.h" -#ifdef SIMULATOR -#define ata_disk_is_active() 1 -#endif - #if MEM > 1 #define GUARD_BUFSIZE (32*1024) #else Index: apps/tagtree.c =================================================================== --- apps/tagtree.c (revision 17281) +++ apps/tagtree.c (working copy) @@ -1058,7 +1058,7 @@ /* Show search progress straight away if the disk needs to spin up, otherwise show it after the normal 1/2 second delay */ show_search_progress( -#if !defined(HAVE_FLASH_STORAGE) && !defined(SIMULATOR) +#if !defined(HAVE_FLASH_STORAGE) ata_disk_is_active() #else true Index: uisimulator/common/stubs.c =================================================================== --- uisimulator/common/stubs.c (revision 17281) +++ uisimulator/common/stubs.c (working copy) @@ -31,6 +31,7 @@ #include "ata.h" /* for volume definitions */ extern char having_new_lcd; +static bool ata_spinning = false; #if CONFIG_CODEC != SWCODEC void audio_set_buffer_margin(int seconds) @@ -106,6 +107,7 @@ void ata_spin(void) { + ata_spinning = true; } void ata_sleep(void) @@ -113,9 +115,19 @@ DEBUGF("ata_sleep()\n"); } +bool ata_disk_is_active(void) +{ + if (ata_spinning) { + ata_spinning = false; + return true; + } + return false; +} + void ata_spindown(int s) { (void)s; + ata_spinning = false; } void rtc_init(void)