Index: apps/recorder/recording.c =================================================================== --- apps/recorder/recording.c (revision 17312) +++ apps/recorder/recording.c (working copy) @@ -297,11 +297,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 17312) +++ 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 17312) +++ 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 17312) +++ 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/tagtree.c =================================================================== --- apps/tagtree.c (revision 17312) +++ 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 17312) +++ 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)