mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 16:14:40 +02:00
Sync audio volume if it's changed externally in vlc
This commit is contained in:
@@ -171,6 +171,7 @@ AudioEngine::AudioEngine()
|
|||||||
connect( d->audioOutput, SIGNAL( stateChanged( AudioOutput::AudioState, AudioOutput::AudioState ) ), d_func(), SLOT( onStateChanged( AudioOutput::AudioState, AudioOutput::AudioState ) ) );
|
connect( d->audioOutput, SIGNAL( stateChanged( AudioOutput::AudioState, AudioOutput::AudioState ) ), d_func(), SLOT( onStateChanged( AudioOutput::AudioState, AudioOutput::AudioState ) ) );
|
||||||
connect( d->audioOutput, SIGNAL( tick( qint64 ) ), SLOT( timerTriggered( qint64 ) ) );
|
connect( d->audioOutput, SIGNAL( tick( qint64 ) ), SLOT( timerTriggered( qint64 ) ) );
|
||||||
connect( d->audioOutput, SIGNAL( positionChanged( float ) ), SLOT( onPositionChanged( float ) ) );
|
connect( d->audioOutput, SIGNAL( positionChanged( float ) ), SLOT( onPositionChanged( float ) ) );
|
||||||
|
connect( d->audioOutput, SIGNAL( volumeChanged( qreal ) ), SLOT( onVolumeChanged( qreal ) ) );
|
||||||
|
|
||||||
setVolume( TomahawkSettings::instance()->volume() );
|
setVolume( TomahawkSettings::instance()->volume() );
|
||||||
|
|
||||||
|
@@ -123,6 +123,7 @@ AudioOutput::AudioOutput( QObject* parent )
|
|||||||
libvlc_MediaPlayerTitleChanged,
|
libvlc_MediaPlayerTitleChanged,
|
||||||
libvlc_MediaPlayerSnapshotTaken,
|
libvlc_MediaPlayerSnapshotTaken,
|
||||||
//libvlc_MediaPlayerLengthChanged,
|
//libvlc_MediaPlayerLengthChanged,
|
||||||
|
libvlc_MediaPlayerAudioVolume,
|
||||||
libvlc_MediaPlayerVout
|
libvlc_MediaPlayerVout
|
||||||
};
|
};
|
||||||
const int eventCount = sizeof(events) / sizeof( *events );
|
const int eventCount = sizeof(events) / sizeof( *events );
|
||||||
@@ -579,6 +580,9 @@ AudioOutput::onVlcEvent( const libvlc_event_t* event )
|
|||||||
// Don't call stop() here - it will deadlock libvlc
|
// Don't call stop() here - it will deadlock libvlc
|
||||||
setState( Error );
|
setState( Error );
|
||||||
break;
|
break;
|
||||||
|
case libvlc_MediaPlayerAudioVolume:
|
||||||
|
emit volumeChanged( event->u.media_player_audio_volume.volume );
|
||||||
|
break;
|
||||||
case libvlc_MediaPlayerNothingSpecial:
|
case libvlc_MediaPlayerNothingSpecial:
|
||||||
case libvlc_MediaPlayerOpening:
|
case libvlc_MediaPlayerOpening:
|
||||||
case libvlc_MediaPlayerBuffering:
|
case libvlc_MediaPlayerBuffering:
|
||||||
|
@@ -79,6 +79,7 @@ signals:
|
|||||||
void stateChanged( AudioOutput::AudioState, AudioOutput::AudioState );
|
void stateChanged( AudioOutput::AudioState, AudioOutput::AudioState );
|
||||||
void tick( qint64 );
|
void tick( qint64 );
|
||||||
void positionChanged( float );
|
void positionChanged( float );
|
||||||
|
void volumeChanged( qreal volume );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onInitVlcEvent( const libvlc_event_t* event );
|
void onInitVlcEvent( const libvlc_event_t* event );
|
||||||
|
Reference in New Issue
Block a user