Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[airplay] - only allow volume changes if the new corresponding settin…

…g is enabled
  • Loading branch information...
commit 7f6c0d8a83475cf77bc97e16a43bde81015c90ae 1 parent 9a47152
Memphiz Memphiz authored
5 xbmc/network/AirPlayServer.cpp
View
@@ -38,6 +38,7 @@
#include "ApplicationMessenger.h"
#include "utils/md5.h"
#include "utils/Variant.h"
+#include "settings/Settings.h"
#include "guilib/GUIWindowManager.h"
#include "URL.h"
#include "cores/IPlayer.h"
@@ -670,7 +671,7 @@ void CAirPlayServer::backupVolume()
void CAirPlayServer::restoreVolume()
{
- if (ServerInstance->m_origVolume != -1)
+ if (ServerInstance->m_origVolume != -1 && CSettings::Get().GetBool("services.airplayvolumecontrol"))
{
g_application.SetVolume((float)ServerInstance->m_origVolume);
ServerInstance->m_origVolume = -1;
@@ -762,7 +763,7 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader,
{
float oldVolume = g_application.GetVolume();
volume *= 100;
- if(oldVolume != volume)
+ if(oldVolume != volume && CSettings::Get().GetBool("services.airplayvolumecontrol"))
{
backupVolume();
g_application.SetVolume(volume);
7 xbmc/network/AirTunesServer.cpp
View
@@ -48,6 +48,7 @@
#include "guilib/GUIWindowManager.h"
#include "utils/Variant.h"
#include "settings/AdvancedSettings.h"
+#include "settings/Settings.h"
#include "utils/EndianSwap.h"
#include "URL.h"
#include "interfaces/AnnouncementManager.h"
@@ -210,7 +211,8 @@ void CAirTunesServer::AudioOutputFunctions::audio_set_volume(void *cls, void *s
#ifdef HAS_AIRPLAY
CAirPlayServer::backupVolume();
#endif
- g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
+ if (CSettings::Get().GetBool("services.airplayvolumecontrol"))
+ g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
}
void CAirTunesServer::AudioOutputFunctions::audio_process(void *cls, void *session, const void *buffer, int buflen)
@@ -313,7 +315,8 @@ void CAirTunesServer::AudioOutputFunctions::ao_set_volume(float volume)
#ifdef HAS_AIRPLAY
CAirPlayServer::backupVolume();
#endif
- g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
+ if (CSettings::Get().GetString("services.airplayvolumecontrol"))
ulion Collaborator
ulion added a note

GetBool()

Memphiz Owner
Memphiz added a note

ops c&p - will do later this day - thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
}
ulion

GetBool()

Memphiz

ops c&p - will do later this day - thx

Please sign in to comment.
Something went wrong with that request. Please try again.