Skip to content
This repository
Browse code

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

…g is enabled
  • Loading branch information...
commit 7f6c0d8a83475cf77bc97e16a43bde81015c90ae 1 parent 9a47152
Memphiz authored August 01, 2013
5  xbmc/network/AirPlayServer.cpp
@@ -38,6 +38,7 @@
38 38
 #include "ApplicationMessenger.h"
39 39
 #include "utils/md5.h"
40 40
 #include "utils/Variant.h"
  41
+#include "settings/Settings.h"
41 42
 #include "guilib/GUIWindowManager.h"
42 43
 #include "URL.h"
43 44
 #include "cores/IPlayer.h"
@@ -670,7 +671,7 @@ void CAirPlayServer::backupVolume()
670 671
 
671 672
 void CAirPlayServer::restoreVolume()
672 673
 {
673  
-  if (ServerInstance->m_origVolume != -1)
  674
+  if (ServerInstance->m_origVolume != -1 && CSettings::Get().GetBool("services.airplayvolumecontrol"))
674 675
   {
675 676
     g_application.SetVolume((float)ServerInstance->m_origVolume);
676 677
     ServerInstance->m_origVolume = -1;
@@ -762,7 +763,7 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader,
762 763
       {
763 764
         float oldVolume = g_application.GetVolume();
764 765
         volume *= 100;
765  
-        if(oldVolume != volume)
  766
+        if(oldVolume != volume && CSettings::Get().GetBool("services.airplayvolumecontrol"))
766 767
         {
767 768
           backupVolume();
768 769
           g_application.SetVolume(volume);          
7  xbmc/network/AirTunesServer.cpp
@@ -48,6 +48,7 @@
48 48
 #include "guilib/GUIWindowManager.h"
49 49
 #include "utils/Variant.h"
50 50
 #include "settings/AdvancedSettings.h"
  51
+#include "settings/Settings.h"
51 52
 #include "utils/EndianSwap.h"
52 53
 #include "URL.h"
53 54
 #include "interfaces/AnnouncementManager.h"
@@ -210,7 +211,8 @@ void  CAirTunesServer::AudioOutputFunctions::audio_set_volume(void *cls, void *s
210 211
 #ifdef HAS_AIRPLAY
211 212
   CAirPlayServer::backupVolume();
212 213
 #endif
213  
-  g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
  214
+  if (CSettings::Get().GetBool("services.airplayvolumecontrol"))
  215
+    g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
214 216
 }
215 217
 
216 218
 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)
313 315
 #ifdef HAS_AIRPLAY
314 316
   CAirPlayServer::backupVolume();
315 317
 #endif
316  
-  g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
  318
+  if (CSettings::Get().GetString("services.airplayvolumecontrol"))
  319
+    g_application.SetVolume(volPercent, false);//non-percent volume 0.0-1.0
317 320
 }
318 321
 
319 322
 

0 notes on commit 7f6c0d8

Memphiz

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

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