mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 23:26:40 +02:00
Sync muted state as well
This commit is contained in:
@@ -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() );
|
||||
|
||||
|
@@ -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:
|
||||
|
@@ -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 );
|
||||
|
Reference in New Issue
Block a user