Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[airplay] - add missing volume command - i mean fix! missing volume c…

…ommand...
  • Loading branch information...
commit e28f7bc1bd40b182e74ca512a6a8d2f43503652b 1 parent 3b807da
Memphiz authored

Showing 1 changed file with 25 additions and 0 deletions. Show diff stats Hide diff stats

  1. +25 0 xbmc/network/AirPlayServer.cpp
25 xbmc/network/AirPlayServer.cpp
@@ -679,6 +679,31 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader,
679 679 }
680 680 }
681 681 }
  682 +
  683 +// The volume command is used to change playback volume.
  684 + // A value argument should be supplied which indicates how loud we should get.
  685 + // 0.000000 => silent
  686 + // 1.000000 => loud
  687 + else if (uri == "/volume")
  688 + {
  689 + const char* found = strstr(queryString.c_str(), "volume=");
  690 + double volume = found ? (double)(atof(found + strlen("volume="))) : 0;
  691 +
  692 + CLog::Log(LOGDEBUG, "AIRPLAY: got request %s with volume %i", uri.c_str(), volume);
  693 +
  694 + if (needAuth && !checkAuthorization(authorization, method, uri))
  695 + {
  696 + status = AIRPLAY_STATUS_NEED_AUTH;
  697 + }
  698 + else if (volume >= 0 && volume <= 1)
  699 + {
  700 + int oldVolume = g_application.GetVolume();
  701 + volume *= 100;
  702 + g_application.SetVolume(volume);
  703 + g_application.getApplicationMessenger().ShowVolumeBar(oldVolume < volume);
  704 + }
  705 + }
  706 +
682 707
683 708 // Contains a header like format in the request body which should contain a
684 709 // Content-Location and optionally a Start-Position

0 comments on commit e28f7bc

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