PlaySound fix

This commit is contained in:
Damjan Adamic
2016-04-03 19:33:32 +02:00
parent 2990e9b9a3
commit 839296ac1b
3 changed files with 168 additions and 163 deletions
+5
View File
@@ -20,6 +20,7 @@ option(AUTOSWITCH "Automatic switch detection in menus" ON)
option(JITTER_MEASURE "Enable ADC jitter measurement" OFF) option(JITTER_MEASURE "Enable ADC jitter measurement" OFF)
option(JITTER_FILTER "Enable ADC jitter filtering" ON) option(JITTER_FILTER "Enable ADC jitter filtering" ON)
option(WATCHDOG_DISABLED "Disable hardware Watchdog on Horus" OFF) # TODO remove it when it's OK option(WATCHDOG_DISABLED "Disable hardware Watchdog on Horus" OFF) # TODO remove it when it's OK
option(SIMU_AUDIO "Enable simulator audio" OFF)
enable_language(ASM) enable_language(ASM)
set(OPT s) set(OPT s)
@@ -858,6 +859,10 @@ if(WATCHDOG_DISABLED)
add_definitions(-DWATCHDOG_DISABLED) add_definitions(-DWATCHDOG_DISABLED)
endif() endif()
if(SIMU_AUDIO)
add_definitions(-DSIMU_AUDIO)
endif()
if(SDCARD) if(SDCARD)
add_definitions(-DSDCARD) add_definitions(-DSDCARD)
include_directories(${FATFS_DIR} ${FATFS_DIR}/option) include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
+1 -3
View File
@@ -1004,10 +1004,9 @@ void audioEvent(unsigned int index, unsigned int freq)
char filename[AUDIO_FILENAME_MAXLEN + 1]; char filename[AUDIO_FILENAME_MAXLEN + 1];
if (index < AU_SPECIAL_SOUND_FIRST && isAudioFileReferenced(index, filename)) { if (index < AU_SPECIAL_SOUND_FIRST && isAudioFileReferenced(index, filename)) {
audioQueue.playFile(filename); audioQueue.playFile(filename);
return;
} }
else
#endif #endif
if (index < AU_SPECIAL_SOUND_FIRST) {
switch (index) { switch (index) {
case AU_INACTIVITY: case AU_INACTIVITY:
audioQueue.playTone(2250, 80, 20, PLAY_REPEAT(2)); audioQueue.playTone(2250, 80, 20, PLAY_REPEAT(2));
@@ -1175,7 +1174,6 @@ void audioEvent(unsigned int index, unsigned int freq)
break; break;
} }
} }
}
} }
void pushPrompt(uint16_t prompt, uint8_t id) void pushPrompt(uint16_t prompt, uint8_t id)
+2
View File
@@ -533,6 +533,8 @@ void * audioThread(void *)
} }
SDL_PauseAudio(0); SDL_PauseAudio(0);
referenceSystemAudioFiles();
while (simuAudio.threadRunning) { while (simuAudio.threadRunning) {
audioQueue.wakeup(); audioQueue.wakeup();
sleep(1); sleep(1);