AudioQueue::stopAll() instead of AudioQueue::reset()
This commit is contained in:
@@ -912,13 +912,13 @@ void AudioQueue::stopPlay(uint8_t id)
|
|||||||
void AudioQueue::stopSD()
|
void AudioQueue::stopSD()
|
||||||
{
|
{
|
||||||
sdAvailableSystemAudioFiles = 0;
|
sdAvailableSystemAudioFiles = 0;
|
||||||
reset();
|
stopAll();
|
||||||
playTone(0, 0, 100, PLAY_NOW); // insert a 100ms pause
|
playTone(0, 0, 100, PLAY_NOW); // insert a 100ms pause
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void AudioQueue::reset()
|
void AudioQueue::stopAll()
|
||||||
{
|
{
|
||||||
CoEnterMutexSection(audioMutex);
|
CoEnterMutexSection(audioMutex);
|
||||||
widx = ridx; // clean the queue
|
widx = ridx; // clean the queue
|
||||||
|
|||||||
@@ -161,6 +161,8 @@ class AudioQueue {
|
|||||||
|
|
||||||
void stopPlay(uint8_t id);
|
void stopPlay(uint8_t id);
|
||||||
|
|
||||||
|
void stopAll();
|
||||||
|
|
||||||
void pause(uint16_t tLen);
|
void pause(uint16_t tLen);
|
||||||
|
|
||||||
void stopSD();
|
void stopSD();
|
||||||
@@ -177,8 +179,6 @@ class AudioQueue {
|
|||||||
return ridx == widx;
|
return ridx == widx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset();
|
|
||||||
|
|
||||||
inline AudioBuffer * getNextFilledBuffer()
|
inline AudioBuffer * getNextFilledBuffer()
|
||||||
{
|
{
|
||||||
if (buffers[bufferRIdx].state == AUDIO_BUFFER_PLAYING) {
|
if (buffers[bufferRIdx].state == AUDIO_BUFFER_PLAYING) {
|
||||||
@@ -322,7 +322,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0);
|
|||||||
#define PLAY_VALUE(v, id) playValue((v), (id))
|
#define PLAY_VALUE(v, id) playValue((v), (id))
|
||||||
#define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
|
#define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
|
||||||
#define STOP_PLAY(id) audioQueue.stopPlay((id))
|
#define STOP_PLAY(id) audioQueue.stopPlay((id))
|
||||||
#define AUDIO_RESET() audioQueue.reset()
|
#define AUDIO_RESET() audioQueue.stopAll()
|
||||||
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
extern tmr10ms_t timeAutomaticPromptsSilence;
|
extern tmr10ms_t timeAutomaticPromptsSilence;
|
||||||
|
|||||||
Reference in New Issue
Block a user