diff --git a/Configuration.ui b/Configuration.ui index 8748b3b..bf89dd5 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -2181,6 +2181,9 @@ both here. + + false + AzEl Directory diff --git a/NotificationAudio.cpp b/NotificationAudio.cpp index c76951c..de2cfb6 100644 --- a/NotificationAudio.cpp +++ b/NotificationAudio.cpp @@ -18,11 +18,15 @@ NotificationAudio::NotificationAudio(QObject *parent) : NotificationAudio::~NotificationAudio(){ stop(); - delete m_decoder; - m_decoder = nullptr; + if(m_decoder){ + delete m_decoder; + m_decoder = nullptr; + } - delete m_audio; - m_audio = nullptr; + if(m_audio){ + delete m_audio; + m_audio = nullptr; + } } // initialize an audio device @@ -52,15 +56,11 @@ void NotificationAudio::init(const QAudioDeviceInfo &device, const QAudioFormat& } // play an audio file -void NotificationAudio::play(const QString &filePath) { +void NotificationAudio::play(const QString &filePath){ if(m_state == NotificationAudio::Playing){ return; } - playFile(filePath); -} - -void NotificationAudio::playFile(const QString &filePath){ if(!m_init || !m_decoder || !m_audio){ return; } diff --git a/NotificationAudio.h b/NotificationAudio.h index 2991c03..86207cc 100644 --- a/NotificationAudio.h +++ b/NotificationAudio.h @@ -49,7 +49,6 @@ private: bool m_init; bool m_isDecodingFinished; - void playFile(const QString &filePath); void resetBuffers(); private slots: