Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 internal XbmcPlayer(JsonRpcClient client)
     : base(client)
 {
     this.audio    = new XbmcAudioPlayer(client);
     this.video    = new XbmcVideoPlayer(client);
     this.pictures = new XbmcPicturePlayer(client);
 }
Exemplo n.º 3
0
 internal XbmcPlayer(JsonRpcClient client)
     : base(client)
 {
     //this.id = -1;
     this.audio = new XbmcAudioPlayer(client);
     this.video = new XbmcVideoPlayer(client);
     this.pictures = new XbmcPicturePlayer(client);
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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;
        }