diff --git a/src/libtomahawk/TomahawkSettings.cpp b/src/libtomahawk/TomahawkSettings.cpp index 98f0a032b..a2ed67a23 100644 --- a/src/libtomahawk/TomahawkSettings.cpp +++ b/src/libtomahawk/TomahawkSettings.cpp @@ -929,6 +929,20 @@ TomahawkSettings::setVolume( unsigned int volume ) } +bool +TomahawkSettings::muted() const +{ + return value( "audio/muted" ).toBool(); +} + + +void +TomahawkSettings::setMuted( bool muted ) +{ + setValue( "audio/muted", muted ); +} + + QString TomahawkSettings::proxyHost() const { diff --git a/src/libtomahawk/TomahawkSettings.h b/src/libtomahawk/TomahawkSettings.h index 739249a39..517a838b8 100644 --- a/src/libtomahawk/TomahawkSettings.h +++ b/src/libtomahawk/TomahawkSettings.h @@ -107,6 +107,9 @@ public: unsigned int volume() const; void setVolume( unsigned int volume ); + bool muted() const; + void setMuted( bool muted ); + /// Playlist stuff QByteArray playlistColumnSizes( const QString& playlistid ) const; void setPlaylistColumnSizes( const QString& playlistid, const QByteArray& state ); diff --git a/src/libtomahawk/audio/AudioEngine.cpp b/src/libtomahawk/audio/AudioEngine.cpp index f397ef99c..54c15b3de 100644 --- a/src/libtomahawk/audio/AudioEngine.cpp +++ b/src/libtomahawk/audio/AudioEngine.cpp @@ -174,6 +174,10 @@ AudioEngine::AudioEngine() connect( d->audioOutput, SIGNAL( volumeChanged( qreal ) ), SLOT( onVolumeChanged( qreal ) ) ); connect( d->audioOutput, SIGNAL( mutedChanged( bool ) ), SIGNAL( mutedChanged( bool ) ) ); + if ( TomahawkSettings::instance()->muted() ) + { + mute(); + } setVolume( TomahawkSettings::instance()->volume() ); qRegisterMetaType< AudioErrorCode >("AudioErrorCode"); @@ -186,6 +190,7 @@ AudioEngine::~AudioEngine() tDebug() << Q_FUNC_INFO; TomahawkSettings::instance()->setVolume( volume() ); + TomahawkSettings::instance()->setMuted( isMuted() ); delete d_ptr; }