added turn off on the amplifier when kodi unpauses

This commit is contained in:
Bob 2021-10-03 21:48:11 +02:00
parent 9d287417ae
commit 0a5932d7cd

View file

@ -148,13 +148,19 @@ void CKodiClient::Parse(const std::string& jsonstr)
{ {
json jsondata = json::parse(jsonstr); json jsondata = json::parse(jsonstr);
//If Kodi signals a Player.OnPlay notification, the amplifier should be turned on.
if (jsondata.contains("method")) if (jsondata.contains("method"))
{ {
if (jsondata["method"] == "Player.OnPlay") std::string method = jsondata["method"];
if (method == "Player.OnPlay")
{ {
printf("Player started\n"); printf("Player started\n");
m_ampswitch->SignalPlayStart(); m_ampswitch->SignalPlayStart();
} }
else if (method == "Player.OnResume")
{
printf("Player unpaused\n");
m_ampswitch->SignalPlayStart();
}
} }
} }