Commit 8c1d79e1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Skins: control volume through playlist

parent 76099331
...@@ -111,18 +111,24 @@ void CmdFaster::execute() ...@@ -111,18 +111,24 @@ void CmdFaster::execute()
void CmdMute::execute() void CmdMute::execute()
{ {
aout_TogleMute( getIntf(), NULL ); playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
aout_TogleMute( pPlaylist, NULL );
} }
void CmdVolumeUp::execute() void CmdVolumeUp::execute()
{ {
aout_VolumeUp( getIntf(), 1, NULL ); playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
aout_VolumeUp( pPlaylist, 1, NULL );
} }
void CmdVolumeDown::execute() void CmdVolumeDown::execute()
{ {
aout_VolumeDown( getIntf(), 1, NULL ); playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
aout_VolumeDown( pPlaylist, 1, NULL );
} }
...@@ -258,7 +258,7 @@ void VlcProc::refreshAudio() ...@@ -258,7 +258,7 @@ void VlcProc::refreshAudio()
// Refresh sound volume // Refresh sound volume
audio_volume_t volume; audio_volume_t volume;
aout_VolumeGet( getIntf(), &volume ); aout_VolumeGet( getIntf()->p_sys->p_playlist, &volume );
Volume *pVolume = (Volume*)m_cVarVolume.get(); Volume *pVolume = (Volume*)m_cVarVolume.get();
pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX ); pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
......
...@@ -34,7 +34,8 @@ Volume::Volume( intf_thread_t *pIntf ): VarPercent( pIntf ) ...@@ -34,7 +34,8 @@ Volume::Volume( intf_thread_t *pIntf ): VarPercent( pIntf )
{ {
// Initial value // Initial value
audio_volume_t val; audio_volume_t val;
aout_VolumeGet( getIntf(), &val );
aout_VolumeGet( getIntf()->p_sys->p_playlist, &val );
VarPercent::set( val * 2.0 / AOUT_VOLUME_MAX ); VarPercent::set( val * 2.0 / AOUT_VOLUME_MAX );
} }
...@@ -47,7 +48,8 @@ void Volume::set( float percentage ) ...@@ -47,7 +48,8 @@ void Volume::set( float percentage )
{ {
VarPercent::set( percentage ); VarPercent::set( percentage );
aout_VolumeSet( getIntf(), (int)(get() * AOUT_VOLUME_MAX / 2.0) ); aout_VolumeSet( getIntf()->p_sys->p_playlist(),
(int)(get() * AOUT_VOLUME_MAX / 2.0) );
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment