コード例 #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            try
            {
                var xbmc = new XBMCRPC.Client("192.168.5.145", 80, "xbmc", "");
                var ret0 = xbmc.JSONRPC.Introspect();
                //var ret2 = xbmc.VideoLibrary.GetTVShows(TVShow.AllFields());
                //var ret66 = xbmc.VideoLibrary.GetTVShowDetails(0);
                var    ret55 = xbmc.VideoLibrary.Scan();
                string temp  = "";
                //var ret1 =	xbmc.Application.GetProperties(Client.AllValues<Name>());
                //var ret2 =	xbmc.VideoLibrary.GetTVShows(TVShow.AllFields());
                //var ret3 =	xbmc.VideoLibrary.SetMovieDetails(5801, playcount: 10);
                //var ret4 =	xbmc.VideoLibrary.GetMovies(Movie.AllFields(), new Limits() { start = 1566, end = 1570 });
                //var ret4a =	xbmc.Files.PrepareDownload(ret4.movies[0].thumbnail);

                //var ret5 =	xbmc.Files.GetSources();
                //var ret6 = await xbmc.Files.GetDirectory(@"C:\Users\steve_000\Music\Amazon MP3\die ärzte\auch", Media.music, Files.AllFields());
                //var ret7 =	xbmc.Playlist.GetItems(0, properties: All.AllFields());
                //var ret7a =	xbmc.Playlist.GetItems(1, properties: All.AllFields());
                //var ret8 =	xbmc.Playlist.GetPlaylists();
                //var ret9 =	xbmc.Player.GetActivePlayers();
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message.ToString());
            }
        }
コード例 #2
0
        internal async void Init()
        {
            var host = Settings.Host;

            if (string.IsNullOrWhiteSpace(host))
            {
                host = "nohost";
            }
            var port = (int)Settings.Port;

            if (port == 0)
            {
                port = 80;
            }

            if (XBMC != null)
            {
                XBMC.Dispose();
            }
            XBMC = new XBMCRPC.Client(PlatformServices, host, port, Settings.User, Settings.Password);

            ImageManager = PlatformServices.GetImageManager(XBMC, !string.IsNullOrEmpty(Settings.Password));

            var t = XBMC.StartNotificationListener();

            t.ContinueWith(t2 => { NotificationsEnabled = !t2.IsFaulted; });

            Upnp = new UpnpManager(this);
        }