コード例 #1
0
ファイル: Xbmc.VideoLibrary.cs プロジェクト: kronic/Yatse2
        public Collection <ApiMovie> GetMovies()
        {
            var movies  = new Collection <ApiMovie>();
            var dblines = _parent.DBCommand("video", "SELECT c00,c01,c03,c04,c05,c07,C09,c11,c12,c14,c15,c16,c18,idFile,idMovie,strFileName,strPath,playCount FROM movieview");

            if (dblines == null)
            {
                return(movies);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 18)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                dbline[4] = dbline[4].Length > 3 ? dbline[4] : "0.0";
                var movie = new ApiMovie
                {
                    Title         = dbline[0],
                    Plot          = dbline[1],
                    Tagline       = dbline[2],
                    Votes         = dbline[3],
                    Rating        = dbline[4].Substring(0, 3).Trim('.'),
                    Year          = Xbmc.StringToNumber(dbline[5]),
                    IdScraper     = dbline[6],
                    Length        = dbline[7],
                    Mpaa          = dbline[8],
                    Genre         = dbline[9],
                    Director      = dbline[10],
                    OriginalTitle = dbline[11],
                    Studio        = dbline[12],
                    IdFile        = Xbmc.StringToNumber(dbline[13]),
                    IdMovie       = Xbmc.StringToNumber(dbline[14]),
                    FileName      = dbline[15],
                    Path          = dbline[16],
                    PlayCount     = Xbmc.StringToNumber(dbline[17])
                };

                if (movie.FileName.StartsWith("stack://", StringComparison.OrdinalIgnoreCase))
                {
                    var temp = movie.FileName.Split(new[] { " , " }, StringSplitOptions.None);
                    movie.IsStack = 1;
                    movie.Hash    = Xbmc.Hash(temp[0].Replace("stack://", ""));
                    movie.Thumb   = @"special://profile/Thumbnails/Video/" + movie.Hash[0] + "/" + movie.Hash + ".tbn";
                    movie.Fanart  = @"special://profile/Thumbnails/Video/Fanart/" + Xbmc.Hash(movie.FileName) + ".tbn";
                }
                else
                {
                    movie.IsStack = 0;
                    movie.Hash    = Xbmc.Hash(movie.Path + movie.FileName);
                    movie.Thumb   = @"special://profile/Thumbnails/Video/" + movie.Hash[0] + "/" + movie.Hash + ".tbn";
                    movie.Fanart  = @"special://profile/Thumbnails/Video/Fanart/" + movie.Hash + ".tbn";
                }

                movies.Add(movie);
            }
            return(movies);
        }
コード例 #2
0
ファイル: Xbmc.File.cs プロジェクト: vageesh79/FrontView
 public XbmcFile(Xbmc parent)
 {
     _parent          = parent;
     _workerDownloads = new BackgroundWorker {
         WorkerSupportsCancellation = true
     };
     _workerDownloads.DoWork += AsyncImagesDownloadsWorker;
 }
コード例 #3
0
ファイル: Xbmc.VideoLibrary.cs プロジェクト: kronic/Yatse2
        public Collection <ApiTvEpisode> GetTvEpisodes()
        {
            var          episodes = new Collection <ApiTvEpisode>();
            const string req      = "SELECT idEpisode,c00,c01,c03,c05,c10,c12,c13,idFile,strFileName,strPath,playCount,strTitle,strStudio,idShow,mpaa FROM episodeview ";

            var dblines = _parent.DBCommand("video", req);

            if (dblines == null)
            {
                return(episodes);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 15)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                dbline[3] = dbline[3].Length > 3 ? dbline[3] : "0.0";
                var episode = new ApiTvEpisode
                {
                    IdEpisode = Xbmc.StringToNumber(dbline[0]),
                    Title     = dbline[1],
                    Plot      = dbline[2],
                    Rating    = dbline[3].Substring(0, 3).Trim('.'),
                    Date      = dbline[4],
                    Director  = dbline[5],
                    Season    = Xbmc.StringToNumber(dbline[6]),
                    Episode   = Xbmc.StringToNumber(dbline[7]),
                    IdFile    = Xbmc.StringToNumber(dbline[8]),
                    FileName  = dbline[9],
                    Path      = dbline[10],
                    PlayCount = Xbmc.StringToNumber(dbline[11]),
                    ShowTitle = dbline[12],
                    Studio    = dbline[13],
                    IdShow    = Xbmc.StringToNumber(dbline[14]),
                    Mpaa      = dbline[15]
                };
                if (episode.FileName.StartsWith("stack://", StringComparison.OrdinalIgnoreCase))
                {
                    var temp = episode.FileName.Split(new[] { " , " }, StringSplitOptions.None);
                    episode.IsStack = 1;
                    episode.Hash    = Xbmc.Hash(temp[0].Replace("stack://", ""));
                    episode.Thumb   = @"special://profile/Thumbnails/Video/" + episode.Hash[0] + "/" + episode.Hash + ".tbn";
                    episode.Fanart  = @"special://profile/Thumbnails/Video/Fanart/" + Xbmc.Hash(episode.Path) + ".tbn";
                }
                else
                {
                    episode.IsStack = 0;
                    episode.Hash    = Xbmc.Hash(episode.Path + episode.FileName);
                    episode.Thumb   = @"special://profile/Thumbnails/Video/" + episode.Hash[0] + "/" + episode.Hash + ".tbn";
                    episode.Fanart  = @"special://profile/Thumbnails/Video/Fanart/" + Xbmc.Hash(episode.Path) + ".tbn";
                }
                episodes.Add(episode);
            }
            return(episodes);
        }
コード例 #4
0
        public Collection <ApiAudioArtist> GetArtists()
        {
            var artists = new Collection <ApiAudioArtist>();
            var dblines = _parent.DBCommand("music", "SELECT idArtist,strArtist FROM artist");

            if (dblines == null)
            {
                return(artists);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 2)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                var hash  = Xbmc.Hash(dbline[1]);
                var hash2 = Xbmc.Hash("artist" + dbline[1]);
                var genre = new ApiAudioArtist
                {
                    IdArtist = Xbmc.StringToNumber(dbline[0]),
                    Name     = dbline[1],
                    Thumb    = @"special://profile/Thumbnails/Music/Artists/" + hash2 + ".tbn",
                    Fanart   = @"special://profile/Thumbnails/Music/Fanart/" + hash + ".tbn",
                    Hash     = hash2
                };
                artists.Add(genre);
            }

            dblines = _parent.DBCommand("music", "SELECT idArtist,strBiography FROM artistinfo");
            if (dblines == null)
            {
                return(artists);
            }

            foreach (var dbline in dblines)
            {
                if (dbline.Length < 2)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                foreach (var artist in artists)
                {
                    if (artist.IdArtist.ToString(CultureInfo.InvariantCulture) == dbline[0])
                    {
                        artist.Biography = dbline[1];
                    }
                }
            }

            return(artists);
        }
コード例 #5
0
ファイル: Xbmc.VideoLibrary.cs プロジェクト: kronic/Yatse2
        public Collection <ApiTvSeason> GetTvSeasons()
        {
            var          seasons = new Collection <ApiTvSeason>();
            const string req     = "SELECT idShow, COUNT(idShow), c12, strPath,strTitle FROM episodeview GROUP BY idShow,c12";

            var showHashes = new Hashtable();

            var dblines = _parent.DBCommand("video", req);

            if (dblines == null)
            {
                return(seasons);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 4)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                var season = new ApiTvSeason
                {
                    EpisodeCount = Xbmc.StringToNumber(dbline[1]),
                    IdShow       = Xbmc.StringToNumber(dbline[0]),
                    SeasonNumber = Xbmc.StringToNumber(dbline[2]),
                    Show         = dbline[4]
                };

                var temp = dbline[3];
                season.Fanart = @"special://profile/Thumbnails/Video/Fanart/" + Xbmc.Hash(temp) + ".tbn";
                char[] charsToTrim = { '/' };
                temp = temp.TrimEnd(charsToTrim);
                var hash = Xbmc.Hash("season" + temp);
                season.Thumb = @"special://profile/Thumbnails/Video/" + hash[0] + "/" + hash + ".tbn";
                season.Hash  = temp;
                seasons.Add(season);
            }

            foreach (var season in seasons)
            {
                if (!showHashes.ContainsKey(season.IdShow))
                {
                    showHashes.Add(season.IdShow, season.Show);
                }
            }

            return(seasons);
        }
コード例 #6
0
        public Collection <ApiAudioSong> GetSongs()
        {
            var          songs = new Collection <ApiAudioSong>();
            const string req   = "SELECT idSong,strTitle,iTrack,iDuration,iYear,strFileName,idAlbum,strAlbum,strPath,idArtist,strArtist,idGenre,strGenre,strThumb FROM songview";


            var dblines = _parent.DBCommand("music", req);

            if (dblines == null)
            {
                return(songs);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 14)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                var song = new ApiAudioSong
                {
                    IdSong   = Xbmc.StringToNumber(dbline[0]),
                    Title    = dbline[1],
                    Track    = Xbmc.StringToNumber(dbline[2]),
                    Duration = Xbmc.StringToNumber(dbline[3]),
                    Year     = Xbmc.StringToNumber(dbline[4]),
                    FileName = dbline[5],
                    IdAlbum  = Xbmc.StringToNumber(dbline[6]),
                    Album    = dbline[7],
                    Path     = dbline[8],
                    IdArtist = Xbmc.StringToNumber(dbline[9]),
                    Artist   = dbline[10],
                    IdGenre  = Xbmc.StringToNumber(dbline[11]),
                    Genre    = dbline[12],
                    Thumb    = dbline[13],
                };
                var thumbparts = dbline[13].Split('/');
                var hash       = thumbparts[thumbparts.Length - 1].Replace(".tbn", "");
                song.Hash = hash;

                songs.Add(song);
            }
            return(songs);
        }
コード例 #7
0
ファイル: Xbmc.VideoLibrary.cs プロジェクト: kronic/Yatse2
        public Collection <ApiTvShow> GetTvShows()
        {
            var shows   = new Collection <ApiTvShow>();
            var dblines = _parent.DBCommand("video", "SELECT tvshow.idShow,tvshow.c00,tvshow.c01,tvshow.c04,tvshow.c05,tvshow.c08,tvshow.c12,tvshow.c13,tvshow.c14,path.strPath as strPath,counts.totalcount as totalCount FROM tvshow join tvshowlinkpath on tvshow.idShow=tvshowlinkpath.idShow join path on path.idpath=tvshowlinkpath.idPath left outer join ( select tvshow.idShow as idShow,count(1) as totalcount,count(files.playCount) as watchedcount from tvshow join tvshowlinkepisode on tvshow.idShow = tvshowlinkepisode.idShow join episode on episode.idEpisode = tvshowlinkepisode.idEpisode join files on files.idFile = episode.idFile group by tvshow.idShow) counts on tvshow.idShow = counts.idShow");

            if (dblines == null)
            {
                return(shows);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 11)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                dbline[3] = dbline[3].Length > 3 ? dbline[3] : "0.0";
                var show = new ApiTvShow
                {
                    IdShow     = Xbmc.StringToNumber(dbline[0]),
                    Title      = dbline[1],
                    Plot       = dbline[2],
                    Rating     = dbline[3].Substring(0, 3).Trim('.'),
                    Premiered  = dbline[4],
                    Genre      = dbline[5],
                    IdScraper  = dbline[6],
                    Mpaa       = dbline[7],
                    Studio     = dbline[8],
                    Path       = dbline[9],
                    TotalCount = Xbmc.StringToNumber(dbline[10])
                };
                show.Hash   = Xbmc.Hash(show.Path);
                show.Thumb  = @"special://profile/Thumbnails/Video/" + show.Hash[0] + "/" + show.Hash + ".tbn";
                show.Fanart = @"special://profile/Thumbnails/Video/Fanart/" + show.Hash + ".tbn";
                shows.Add(show);
            }
            return(shows);
        }
コード例 #8
0
        public Collection <ApiAudioGenre> GetGenres()
        {
            var genres  = new Collection <ApiAudioGenre>();
            var dblines = _parent.DBCommand("music", "SELECT idGenre,strGenre,COUNT(DISTINCT strAlbum) AS albumCount FROM albumview GROUP BY idGenre");

            if (dblines == null)
            {
                return(genres);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 3)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                var genre = new ApiAudioGenre {
                    IdGenre = Xbmc.StringToNumber(dbline[0]), Name = dbline[1], AlbumCount = Xbmc.StringToNumber(dbline[2])
                };
                genres.Add(genre);
            }
            return(genres);
        }
コード例 #9
0
        public Collection <ApiAudioAlbum> GetAlbums()
        {
            var          albums = new Collection <ApiAudioAlbum>();
            const string req    = "SELECT idAlbum,strAlbum,idGenre,idArtist,strArtist,strGenre,iYear,strThumb FROM albumview GROUP BY strAlbum";

            var dblines = _parent.DBCommand("music", req);

            if (dblines == null)
            {
                return(albums);
            }
            foreach (var dbline in dblines)
            {
                if (dbline.Length < 8)
                {
                    _parent.Log("Invalid request DATA : " + dbline);
                    continue;
                }
                var album = new ApiAudioAlbum
                {
                    IdAlbum  = Xbmc.StringToNumber(dbline[0]),
                    Title    = dbline[1],
                    IdGenre  = Xbmc.StringToNumber(dbline[2]),
                    IdArtist = Xbmc.StringToNumber(dbline[3]),
                    Artist   = dbline[4],
                    Genre    = dbline[5],
                    Year     = Xbmc.StringToNumber(dbline[6]),
                    Thumb    = dbline[7]
                };
                var thumbparts = dbline[7].Split('/');
                var hash       = thumbparts[thumbparts.Length - 1].Replace(".tbn", "");
                album.Hash = hash;

                albums.Add(album);
            }
            return(albums);
        }
コード例 #10
0
ファイル: Xbmc.Player.cs プロジェクト: vageesh79/FrontView
        public void RefreshNowPlaying()
        {
            lock (Locker)
            {
                if (_parent.MpcLoaded)
                {
                    var result  = _parent.MpcHcRemote.GetStatus();
                    var result2 = new ArrayList();
                    MpcHcRemote.ParseCSVFields(result2, result);
                    var data = (string[])result2.ToArray(typeof(string));
                    if (data.Length > 6)
                    {
                        _nowPlaying.MediaType = "Video";
                        _nowPlaying.Title     = "Media Player Classic";
                        _nowPlaying.Time      = new TimeSpan(0, 0, 0, Convert.ToInt32("0" + data[2]) / 1000);
                        _nowPlaying.Duration  = new TimeSpan(0, 0, 0, Convert.ToInt32("0" + data[4]) / 1000);
                        var percent = Math.Floor(100.0 * Convert.ToInt32("0" + data[2], CultureInfo.InvariantCulture) / Convert.ToInt32("0" + data[4], CultureInfo.InvariantCulture));
                        if (Double.IsNaN(percent))
                        {
                            percent = 0;
                        }
                        _nowPlaying.Volume   = Convert.ToInt32("0" + data[7], CultureInfo.InvariantCulture);
                        _nowPlaying.IsMuted  = data[6] == "1";
                        _nowPlaying.Progress = (int)percent;
                    }
                }
                else
                {
                    if (!_parent.IsConnected())
                    {
                        _nowPlaying.FileName  = "";
                        _nowPlaying.Title     = "";
                        _nowPlaying.IsPlaying = false;
                        _nowPlaying.IsPaused  = false;
                        return;
                    }

                    var current = -1;
                    var players = (JsonArray)_parent.JsonCommand("Player.GetActivePlayers", null);
                    if (players.Count > 0)
                    {
                        foreach (JsonObject player in players)
                        {
                            if (player["type"].ToString() == "picture")
                            {
                                continue;
                            }
                            current = Int32.Parse(player["playerid"].ToString());
                            _nowPlaying.MediaType = (string)player["type"];
                        }
                    }

                    if (current == -1)
                    {
                        _nowPlaying.FileName  = "";
                        _nowPlaying.Title     = "";
                        _nowPlaying.IsPlaying = false;
                        _nowPlaying.IsPaused  = false;
                        return;
                    }

                    var items = new JsonObject();
                    items["playerid"]   = current;
                    items["properties"] = new[] {
                        "file",
                        "comment",
                        "tvshowid",
                        "albumartist",
                        "duration",
                        //"id",
                        "album",
                        //"votes",
                        // "mpaa",
                        // "writer",
                        //"albumid",
                        //"type",
                        "genre",
                        "year",
                        //"plotoutline",
                        "track",
                        "artist",
                        //"season",
                        //"imdbnumber",
                        // "studio",
                        //"showlink",
                        "showtitle",
                        "episode",
                        "season",
                        "plot",
                        "director",
                        "studio",
                        "rating",
                        //"productioncode",
                        //"country",
                        //"premiered",
                        //"originaltitle",
                        //"artistid",
                        //"firstaired",
                        "tagline",
                        //"top250",
                        //"trailer"
                    };

                    var properties = new JsonObject();
                    properties["playerid"]   = current;
                    properties["properties"] = new[] {
                        "totaltime",
                        "percentage",
                        "time",
                        "speed"
                    };

                    var appproperties = new JsonObject();
                    appproperties["properties"] = new[]
                    {
                        "muted",
                        "volume"
                    };

                    var result1 = (JsonObject)_parent.JsonCommand("Player.GetProperties", properties);
                    var result2 = (JsonObject)_parent.JsonCommand("Player.GetItem", items);
                    var result3 = (JsonObject)_parent.JsonCommand("Application.GetProperties", appproperties);

                    if (result1 == null || result2 == null || result3 == null)
                    {
                        _nowPlaying.FileName  = "";
                        _nowPlaying.Title     = "";
                        _nowPlaying.IsPlaying = false;
                        _nowPlaying.IsPaused  = false;
                        return;
                    }

                    result2 = (JsonObject)(result2)["item"];

                    _nowPlaying.IsPaused  = Convert.ToInt32("0" + result1["speed"].ToString().Replace("-", "")) == 0;
                    _nowPlaying.IsPlaying = !_nowPlaying.IsPaused;
                    var time  = (JsonObject)result1["time"];
                    var total = (JsonObject)result1["totaltime"];
                    _nowPlaying.Time     = new TimeSpan(0, Convert.ToInt32("0" + time["hours"]), Convert.ToInt32("0" + time["minutes"]), Convert.ToInt32("0" + time["seconds"]));
                    _nowPlaying.Duration = new TimeSpan(0, Convert.ToInt32("0" + total["hours"]), Convert.ToInt32("0" + total["minutes"]), Convert.ToInt32("0" + total["seconds"]));

                    _nowPlaying.Progress = Convert.ToInt32("0" + result1["percentage"].ToString().Split('.')[0]);

                    _nowPlaying.Volume  = Convert.ToInt32("0" + result3["volume"]);
                    _nowPlaying.IsMuted = (bool)result3["muted"];

                    _parent.MpcLoaded = _nowPlaying.Duration == new TimeSpan(0, 0, 0, 1);

                    _nowPlaying.FileName = result2["file"].ToString();


                    if (_nowPlaying.MediaType == "audio")
                    {
                        //infos2 = (JsonObject)_parent.JsonCommand("AudioPlayer.GetTime", null);
                        _nowPlaying.MediaType = "Audio";
                        _nowPlaying.Genre     = result2["genre"].ToString();
                        _nowPlaying.Title     = result2["label"].ToString();
                        _nowPlaying.Year      = Convert.ToInt32("0" + result2["year"]);
                        _nowPlaying.Track     = Convert.ToInt32("0" + result2["track"]);
                        _nowPlaying.Artist    = result2["artist"].ToString();
                        _nowPlaying.Album     = result2["album"].ToString();
                        var hash = Xbmc.Hash(_nowPlaying.Album + _nowPlaying.Artist);
                        _nowPlaying.ThumbURL  = @"special://profile/Thumbnails/Music/" + hash[0] + "/" + hash + ".tbn";
                        _nowPlaying.FanartURL = @"special://profile/Thumbnails/Music/Fanart/" + hash + ".tbn";
                    }

                    if (_nowPlaying.MediaType == "video")
                    {
                        //infos2 = (JsonObject)_parent.JsonCommand("VideoPlayer.GetTime", null);
                        if (result2["type"].ToString() == "episode")
                        {
                            _nowPlaying.MediaType = "TvShow";
                        }
                        else
                        {
                            _nowPlaying.MediaType = "Movie";
                        }
                        _nowPlaying.Genre         = result2["genre"].ToString();
                        _nowPlaying.Title         = result2["label"].ToString();
                        _nowPlaying.Year          = Convert.ToInt32("0" + result2["year"]);
                        _nowPlaying.SeasonNumber  = Convert.ToInt32("0" + result2["season"].ToString().Replace("-", ""));
                        _nowPlaying.EpisodeNumber = Convert.ToInt32("0" + result2["episode"].ToString().Replace("-", ""));
                        _nowPlaying.ShowTitle     = result2["showtitle"].ToString();
                        _nowPlaying.Plot          = result2["plot"].ToString();
                        _nowPlaying.Director      = result2["director"].ToString();
                        _nowPlaying.Studio        = result2["studio"].ToString();
                        _nowPlaying.Tagline       = result2["tagline"].ToString();
                        _nowPlaying.Rating        = result2["rating"].ToString();
                        if (_nowPlaying.FileName.StartsWith("stack://", StringComparison.OrdinalIgnoreCase))
                        {
                            var temp = _nowPlaying.FileName.Split(new[] { " , " }, StringSplitOptions.None);
                            var hash = Xbmc.Hash(temp[0].Replace("stack://", ""));
                            _nowPlaying.ThumbURL  = @"special://profile/Thumbnails/Video/" + hash[0] + "/" + hash + ".tbn";
                            _nowPlaying.FanartURL = @"special://profile/Thumbnails/Video/Fanart/" + Xbmc.Hash(_nowPlaying.FileName) + ".tbn";
                        }
                        else
                        {
                            var hash = Xbmc.Hash(_nowPlaying.FileName);
                            _nowPlaying.ThumbURL  = @"special://profile/Thumbnails/Video/" + hash[0] + "/" + hash + ".tbn";
                            _nowPlaying.FanartURL = @"special://profile/Thumbnails/Video/Fanart/" + hash + ".tbn";
                        }
                    }

                    //var result = _parent.JsonArrayCommand(new[] { "Player.GetItem", "Player.GetProperties" }, new[] { items, properties });

                    /*if (result != null)
                     *  _parent.Log(result.ToString());*/
                    //return ;

                    /*
                     * var infos = (JsonObject)_parent.JsonCommand("System.GetInfoLabels", items);
                     *
                     * if (infos == null)
                     *  return;
                     * JsonObject infos2 = null;
                     * _nowPlaying.FileName = infos["Player.Filenameandpath"].ToString();
                     *
                     * if (!String.IsNullOrEmpty(infos["VideoPlayer.TVShowTitle"].ToString()))
                     * {
                     *  _nowPlaying.MediaType = "TvShow";
                     * }
                     * else if (!String.IsNullOrEmpty(infos["MusicPlayer.Title"].ToString()))
                     * {
                     *  _nowPlaying.MediaType = "Audio";
                     * }
                     * else if (!String.IsNullOrEmpty(infos["VideoPlayer.Title"].ToString()))
                     * {
                     *  _nowPlaying.MediaType = "Movie";
                     * }
                     * else
                     * {
                     *  _nowPlaying.MediaType = "Unknown";
                     *  _nowPlaying.Title = "";
                     *  _nowPlaying.IsPlaying = false;
                     *  _nowPlaying.IsPaused = false;
                     *  _nowPlaying.Duration = new TimeSpan();
                     *  _nowPlaying.Time = new TimeSpan();
                     * }
                     *
                     * if (_nowPlaying.MediaType == "Movie" || _nowPlaying.MediaType == "TvShow")
                     * {
                     *  infos2 = (JsonObject)_parent.JsonCommand("VideoPlayer.GetTime", null);
                     *  _nowPlaying.Genre = infos["VideoPlayer.Genre"].ToString();
                     *  _nowPlaying.Title = infos["VideoPlayer.Title"].ToString();
                     *  _nowPlaying.Year = Convert.ToInt32("0" + infos["VideoPlayer.Year"]);
                     *  _nowPlaying.SeasonNumber = Convert.ToInt32("0" + infos["VideoPlayer.Season"]);
                     *  _nowPlaying.EpisodeNumber = Convert.ToInt32("0" + infos["VideoPlayer.Episode"]);
                     *  _nowPlaying.ShowTitle = infos["VideoPlayer.TVShowTitle"].ToString();
                     *  _nowPlaying.Plot = infos["VideoPlayer.Plot"].ToString();
                     *  _nowPlaying.Director = infos["VideoPlayer.Director"].ToString();
                     *  _nowPlaying.Studio = infos["VideoPlayer.Studio"].ToString();
                     *  _nowPlaying.Tagline = infos["VideoPlayer.Tagline"].ToString();
                     *  _nowPlaying.Rating = infos["VideoPlayer.Rating"].ToString();
                     *  if (_nowPlaying.FileName.StartsWith("stack://", StringComparison.OrdinalIgnoreCase))
                     *  {
                     *      var temp = _nowPlaying.FileName.Split(new[] { " , " }, StringSplitOptions.None);
                     *      var hash = Xbmc.Hash(temp[0].Replace("stack://", ""));
                     *      _nowPlaying.ThumbURL = @"special://profile/Thumbnails/Video/" + hash[0] + "/" + hash + ".tbn";
                     *      _nowPlaying.FanartURL = @"special://profile/Thumbnails/Video/Fanart/" + Xbmc.Hash(_nowPlaying.FileName) + ".tbn";
                     *  }
                     *  else
                     *  {
                     *      var hash = Xbmc.Hash(_nowPlaying.FileName);
                     *      _nowPlaying.ThumbURL = @"special://profile/Thumbnails/Video/" + hash[0] + "/" + hash + ".tbn";
                     *      _nowPlaying.FanartURL = @"special://profile/Thumbnails/Video/Fanart/" + hash + ".tbn";
                     *  }
                     * }
                     * if (_nowPlaying.MediaType == "Audio")
                     * {
                     *  infos2 = (JsonObject)_parent.JsonCommand("AudioPlayer.GetTime", null);
                     *  _nowPlaying.Genre = infos["MusicPlayer.Genre"].ToString();
                     *  _nowPlaying.Title = infos["MusicPlayer.Title"].ToString();
                     *  _nowPlaying.Year = Convert.ToInt32("0" + infos["MusicPlayer.Year"]);
                     *  _nowPlaying.Track = Convert.ToInt32("0" + infos["MusicPlayer.TrackNumber"]);
                     *  _nowPlaying.Artist = infos["MusicPlayer.Artist"].ToString();
                     *  _nowPlaying.Album = infos["MusicPlayer.Album"].ToString();
                     *  var hash = Xbmc.Hash(_nowPlaying.Album + _nowPlaying.Artist);
                     *  _nowPlaying.ThumbURL = @"special://profile/Thumbnails/Music/" + hash[0] + "/" + hash + ".tbn";
                     *  _nowPlaying.FanartURL = @"special://profile/Thumbnails/Music/Fanart/" + hash + ".tbn";
                     * }
                     *
                     * if (infos2 != null)
                     * {
                     *  _nowPlaying.IsPaused = (bool)infos2["paused"];
                     *  _nowPlaying.IsPlaying = !(bool)infos2["paused"] && (bool)infos2["playing"];
                     *  var time = (JsonObject)infos2["time"];
                     *  var total = (JsonObject)infos2["total"];
                     *  _nowPlaying.Time = new TimeSpan(0, Convert.ToInt32("0" + time["hours"]), Convert.ToInt32("0" + time["minutes"]), Convert.ToInt32("0" + time["seconds"]));
                     *  _nowPlaying.Duration = new TimeSpan(0, Convert.ToInt32("0" + total["hours"]), Convert.ToInt32("0" + total["minutes"]), Convert.ToInt32("0" + total["seconds"]));
                     * }
                     *
                     * var percent = Math.Floor(100.0 * _nowPlaying.Time.TotalSeconds / _nowPlaying.Duration.TotalSeconds);
                     * if (Double.IsNaN(percent))
                     *  percent = 0;
                     * _nowPlaying.Progress = (int)percent;
                     *
                     * var vol = (1 - Convert.ToDouble("0" + infos["Player.Volume"].ToString().Replace(" dB", "").Replace("-","").Replace(".",","))/60)*100;
                     *
                     * _nowPlaying.Volume = (int)vol;
                     * _nowPlaying.IsMuted = (vol == 0);
                     *
                     * _parent.MpcLoaded = _nowPlaying.Duration == new TimeSpan(0, 0, 0, 1);
                     *
                     */
                }
            }
        }
コード例 #11
0
ファイル: Xbmc.System.cs プロジェクト: Ghawken/FrontView
 public XbmcSystem(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #12
0
ファイル: Xbmc.PicturePlayer.cs プロジェクト: kronic/Yatse2
 public XbmcPicturePlayer(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #13
0
ファイル: MpcHc.Remote.cs プロジェクト: kronic/Yatse2
 public MpcHcRemote(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #14
0
 public XbmcVideoLibrary(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #15
0
ファイル: MpcHc.Remote.cs プロジェクト: Ghawken/FrontView
 public MpcHcRemote(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #16
0
 public XbmcAudioLibrary(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #17
0
ファイル: Xbmc.VideoLibrary.cs プロジェクト: kronic/Yatse2
 public XbmcVideoLibrary(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #18
0
ファイル: Xbmc.Player.cs プロジェクト: vageesh79/FrontView
 public XbmcPlayer(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #19
0
 public XbmcAudioLibrary(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #20
0
ファイル: Xbmc.Remote.cs プロジェクト: kronic/Yatse2
 public XbmcRemote(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #21
0
ファイル: Xbmc.Remote.cs プロジェクト: GroupXTech/Yatse2
 public XbmcRemote(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #22
0
ファイル: Xbmc.VideoPlayer.cs プロジェクト: Ghawken/FrontView
 public XbmcVideoPlayer(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #23
0
ファイル: Xbmc.File.cs プロジェクト: GroupXTech/Yatse2
 public XbmcFile(Xbmc parent)
 {
     _parent = parent;
     _workerDownloads = new BackgroundWorker { WorkerSupportsCancellation = true };
     _workerDownloads.DoWork += AsyncImagesDownloadsWorker;
 }
コード例 #24
0
ファイル: Xbmc.System.cs プロジェクト: vageesh79/FrontView
 public XbmcSystem(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #25
0
 public XbmcAudioPlayer(Xbmc parent)
 {
     _parent     = parent;
     _bw.DoWork += AsyncPlayFilesWorker;
 }
コード例 #26
0
 public XbmcVideoPlayer(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #27
0
ファイル: Xbmc.AudioPlayer.cs プロジェクト: Ghawken/FrontView
 public XbmcAudioPlayer(Xbmc parent)
 {
     _parent = parent;
     _bw.DoWork += AsyncPlayFilesWorker;
 }
コード例 #28
0
 public XbmcPicturePlayer(Xbmc parent)
 {
     _parent = parent;
 }
コード例 #29
0
ファイル: Xbmc.Player.cs プロジェクト: GroupXTech/Yatse2
 public XbmcPlayer(Xbmc parent)
 {
     _parent = parent;
 }