Commit 8a8ccd9c authored by Don Gagne's avatar Don Gagne

Put back missing mute setting save

parent b1055625
...@@ -40,13 +40,18 @@ This file is part of the QGROUNDCONTROL project ...@@ -40,13 +40,18 @@ This file is part of the QGROUNDCONTROL project
IMPLEMENT_QGC_SINGLETON(GAudioOutput, GAudioOutput) IMPLEMENT_QGC_SINGLETON(GAudioOutput, GAudioOutput)
const char* GAudioOutput::_mutedKey = "AudioMuted";
GAudioOutput::GAudioOutput(QObject *parent) : GAudioOutput::GAudioOutput(QObject *parent) :
QGCSingleton(parent), QGCSingleton(parent),
muted(false), muted(false),
thread(new QThread()), thread(new QThread()),
worker(new QGCAudioWorker()) worker(new QGCAudioWorker())
{ {
muted = qgcApp()->runningUnitTests(); QSettings settings;
muted = settings.value(_mutedKey, false).toBool();
muted |= qgcApp()->runningUnitTests();
worker->moveToThread(thread); worker->moveToThread(thread);
connect(this, SIGNAL(textToSpeak(QString,int)), worker, SLOT(say(QString,int))); connect(this, SIGNAL(textToSpeak(QString,int)), worker, SLOT(say(QString,int)));
...@@ -66,7 +71,12 @@ GAudioOutput::~GAudioOutput() ...@@ -66,7 +71,12 @@ GAudioOutput::~GAudioOutput()
void GAudioOutput::mute(bool mute) void GAudioOutput::mute(bool mute)
{ {
QSettings settings;
muted = mute; muted = mute;
settings.setValue(_mutedKey, mute);
emit mutedChanged(mute);
} }
bool GAudioOutput::isMuted() bool GAudioOutput::isMuted()
......
...@@ -110,6 +110,8 @@ protected: ...@@ -110,6 +110,8 @@ protected:
private: private:
GAudioOutput(QObject *parent = NULL); GAudioOutput(QObject *parent = NULL);
~GAudioOutput(); ~GAudioOutput();
static const char* _mutedKey;
}; };
#endif // AUDIOOUTPUT_H #endif // AUDIOOUTPUT_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment