mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 00:54:20 +02:00
Persist muted state accross restarts
This commit is contained in:
@@ -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
|
QString
|
||||||
TomahawkSettings::proxyHost() const
|
TomahawkSettings::proxyHost() const
|
||||||
{
|
{
|
||||||
|
@@ -107,6 +107,9 @@ public:
|
|||||||
unsigned int volume() const;
|
unsigned int volume() const;
|
||||||
void setVolume( unsigned int volume );
|
void setVolume( unsigned int volume );
|
||||||
|
|
||||||
|
bool muted() const;
|
||||||
|
void setMuted( bool muted );
|
||||||
|
|
||||||
/// Playlist stuff
|
/// Playlist stuff
|
||||||
QByteArray playlistColumnSizes( const QString& playlistid ) const;
|
QByteArray playlistColumnSizes( const QString& playlistid ) const;
|
||||||
void setPlaylistColumnSizes( const QString& playlistid, const QByteArray& state );
|
void setPlaylistColumnSizes( const QString& playlistid, const QByteArray& state );
|
||||||
|
@@ -174,6 +174,10 @@ AudioEngine::AudioEngine()
|
|||||||
connect( d->audioOutput, SIGNAL( volumeChanged( qreal ) ), SLOT( onVolumeChanged( qreal ) ) );
|
connect( d->audioOutput, SIGNAL( volumeChanged( qreal ) ), SLOT( onVolumeChanged( qreal ) ) );
|
||||||
connect( d->audioOutput, SIGNAL( mutedChanged( bool ) ), SIGNAL( mutedChanged( bool ) ) );
|
connect( d->audioOutput, SIGNAL( mutedChanged( bool ) ), SIGNAL( mutedChanged( bool ) ) );
|
||||||
|
|
||||||
|
if ( TomahawkSettings::instance()->muted() )
|
||||||
|
{
|
||||||
|
mute();
|
||||||
|
}
|
||||||
setVolume( TomahawkSettings::instance()->volume() );
|
setVolume( TomahawkSettings::instance()->volume() );
|
||||||
|
|
||||||
qRegisterMetaType< AudioErrorCode >("AudioErrorCode");
|
qRegisterMetaType< AudioErrorCode >("AudioErrorCode");
|
||||||
@@ -186,6 +190,7 @@ AudioEngine::~AudioEngine()
|
|||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
TomahawkSettings::instance()->setVolume( volume() );
|
TomahawkSettings::instance()->setVolume( volume() );
|
||||||
|
TomahawkSettings::instance()->setMuted( isMuted() );
|
||||||
|
|
||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user