public bool GetActivePlayers(out bool video, out bool audio, out bool picture) { this.client.LogMessage("XbmcPlayer.GetActivePlayers()"); video = false; audio = false; picture = false; JObject query = this.client.Call("Player.GetActivePlayers") as JObject; if (query == null) { this.client.LogErrorMessage("Player.GetActivePlayers(): Invalid response"); return(false); } if (query["video"] != null) { video = (bool)query["video"]; } if (query["audio"] != null) { audio = (bool)query["audio"]; } if (query["picture"] != null) { picture = (bool)query["picture"]; } return(true); }
internal XbmcPlayer(JsonRpcClient client) : base(client) { this.audio = new XbmcAudioPlayer(client); this.video = new XbmcVideoPlayer(client); this.pictures = new XbmcPicturePlayer(client); }
internal XbmcPlayer(JsonRpcClient client) : base(client) { //this.id = -1; this.audio = new XbmcAudioPlayer(client); this.video = new XbmcVideoPlayer(client); this.pictures = new XbmcPicturePlayer(client); }
public bool GetActivePlayers(out bool video, out bool audio, out bool picture, out int id) { //JArray emptyArray = new JArray(); this.client.LogMessage("XbmcPlayer.GetActivePlayers()"); video = false; audio = false; picture = false; id = -1; JObject query = this.client.Call("Player.GetActivePlayers") as JObject; //if (queryOrig.Equals(emptyArray)) //{ // this.client.LogMessage("Player.GetActivePlayers(): No active players found"); // return false; //} if (query == null) { this.client.LogErrorMessage("Player.GetActivePlayers(): Invalid response"); return(false); } //if (query["video"] != null) //{ // video = (bool)query["video"]; //} //if (query["audio"] != null) //{ // audio = (bool)query["audio"]; //} //if (query["picture"] != null) //{ // picture = (bool)query["picture"]; //} id = (int)query["playerid"]; switch (((string)query["type"])) { case "video": video = true; break; case "audio": audio = true; break; case "picture": picture = true; break; } return(true); }
public bool GetActivePlayers(out bool video, out bool audio, out bool picture, out int id) { //JArray emptyArray = new JArray(); this.client.LogMessage("XbmcPlayer.GetActivePlayers()"); video = false; audio = false; picture = false; id = -1; JObject query = this.client.Call("Player.GetActivePlayers") as JObject; //if (queryOrig.Equals(emptyArray)) //{ // this.client.LogMessage("Player.GetActivePlayers(): No active players found"); // return false; //} if (query == null) { this.client.LogErrorMessage("Player.GetActivePlayers(): Invalid response"); return false; } //if (query["video"] != null) //{ // video = (bool)query["video"]; //} //if (query["audio"] != null) //{ // audio = (bool)query["audio"]; //} //if (query["picture"] != null) //{ // picture = (bool)query["picture"]; //} id = (int) query["playerid"]; switch (((string) query["type"])) { case "video": video = true; break; case "audio": audio = true; break; case "picture": picture = true; break; } return true; }