diff --git a/src/libtomahawk/audio/AudioEngine.cpp b/src/libtomahawk/audio/AudioEngine.cpp index 7b46be4f1..f397ef99c 100644 --- a/src/libtomahawk/audio/AudioEngine.cpp +++ b/src/libtomahawk/audio/AudioEngine.cpp @@ -172,6 +172,7 @@ AudioEngine::AudioEngine() connect( d->audioOutput, SIGNAL( tick( qint64 ) ), SLOT( timerTriggered( qint64 ) ) ); connect( d->audioOutput, SIGNAL( positionChanged( float ) ), SLOT( onPositionChanged( float ) ) ); connect( d->audioOutput, SIGNAL( volumeChanged( qreal ) ), SLOT( onVolumeChanged( qreal ) ) ); + connect( d->audioOutput, SIGNAL( mutedChanged( bool ) ), SIGNAL( mutedChanged( bool ) ) ); setVolume( TomahawkSettings::instance()->volume() ); diff --git a/src/libtomahawk/audio/AudioOutput.cpp b/src/libtomahawk/audio/AudioOutput.cpp index b0371b2df..5f6c07537 100644 --- a/src/libtomahawk/audio/AudioOutput.cpp +++ b/src/libtomahawk/audio/AudioOutput.cpp @@ -124,6 +124,8 @@ AudioOutput::AudioOutput( QObject* parent ) libvlc_MediaPlayerSnapshotTaken, //libvlc_MediaPlayerLengthChanged, libvlc_MediaPlayerAudioVolume, + libvlc_MediaPlayerMuted, + libvlc_MediaPlayerUnmuted, libvlc_MediaPlayerVout }; const int eventCount = sizeof(events) / sizeof( *events ); @@ -583,6 +585,14 @@ AudioOutput::onVlcEvent( const libvlc_event_t* event ) case libvlc_MediaPlayerAudioVolume: emit volumeChanged( event->u.media_player_audio_volume.volume ); break; + case libvlc_MediaPlayerMuted: + m_muted = true; + emit mutedChanged( true ); + break; + case libvlc_MediaPlayerUnmuted: + m_muted = false; + emit mutedChanged( false ); + break; case libvlc_MediaPlayerNothingSpecial: case libvlc_MediaPlayerOpening: case libvlc_MediaPlayerBuffering: diff --git a/src/libtomahawk/audio/AudioOutput.h b/src/libtomahawk/audio/AudioOutput.h index 2a266ad66..0e979bdf9 100644 --- a/src/libtomahawk/audio/AudioOutput.h +++ b/src/libtomahawk/audio/AudioOutput.h @@ -80,6 +80,7 @@ signals: void tick( qint64 ); void positionChanged( float ); void volumeChanged( qreal volume ); + void mutedChanged( bool ); private: void onInitVlcEvent( const libvlc_event_t* event );