public List <Movie> GetMovies(string[] fields, SortParams sort) { var args = new JObject(); if (fields != null) { args.Add(new JProperty("fields", fields)); } if (sort != null) { args.Add(sort.ToJObject().Children()); } List <Movie> list = new List <Movie>(); JObject query = (JObject)Client.Invoke("VideoLibrary.GetMovies", args); if (query["movies"] != null) { foreach (JObject item in (JArray)query["movies"]) { list.Add(Movie.MovieFromJsonObject(item)); } } return(list); }
public void Create(string playlist) { var args = new JObject(); args.Add(new JProperty("playlist", playlist)); Client.Invoke("Playlist.Create", args); }
public bool IsAudioPlayerActive() { JObject query = (JObject)Client.Invoke("Player.GetActivePlayers"); if (query["audio"] != null) { if (query["audio"].Value <JValue>().Value.ToString() == "True") { return(true); } else { return(false); } } return(false); }
public List <Share> GetSources(string media) { var args = new JObject(); args.Add(new JProperty("media", media)); JObject query = (JObject)Client.Invoke("Files.GetSources", args); List <Share> list = new List <Share>(); if (query["shares"] != null) { foreach (JObject item in (JArray)query["shares"]) { list.Add(Share.ShareFromJsonObject(item)); } } return(list); }
public List <JsonMethod> Introspect() { var args = new JObject(); args.Add(new JProperty("getdescriptions", true)); args.Add(new JProperty("getpermissions", true)); args.Add(new JProperty("filterbytransport", true)); JObject query = (JObject)Client.Invoke("JSONRPC.Introspect", args); List <JsonMethod> list = new List <JsonMethod>(); if (query["commands"] != null) { foreach (JObject item in (JArray)query["commands"]) { list.Add(JsonMethod.JsonMethodFromJsonObject(item)); } } return(list); }
public void Play(int playlistIndex) { Client.Invoke("AudioPlaylist.Play", playlistIndex); }
public int GetVolume() { return((int)Client.Invoke("XBMC.GetVolume")); }
public void Play() { Client.Invoke("VideoPlaylist.Play"); }
public List <Artist> GetArtists(SortParams sort) { var args = new JObject(); if (sort != null) { args.Add(sort.ToJObject().Children()); } JObject query = (JObject)Client.Invoke("AudioLibrary.GetArtists", args); List <Artist> list = new List <Artist>(); if (query != null) { foreach (JObject item in (JArray)query["artists"]) { list.Add(Artist.ArtistFromJsonObject(item)); } } return(list); }
public bool PlayPause() { JObject query = (JObject)Client.Invoke("AudioPlayer.PlayPause"); if (query["paused"] != null) { return((bool)query["paused"].Value <JValue>().Value); } else { return(false); } }
public float GetFPS() { string[] label = new string[] { "System.FPS" }; JObject query = (JObject)Client.Invoke("System.GetInfoLabels", label); if (query != null) { return((float)Convert.ToDouble(query["System.FPS"].Value <JValue>().Value)); } else { return(-1); } }