Inheritance: BDInfo.BDROM
コード例 #1
0
        /// <summary>
        /// Scans a bluray folder and returns a BDInfo object
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        private BDInfo scanWorker(string path)
        {
            logger.Info("Scanning bluray structure: {0}", path);
            BDInfo bluray = new BDInfo(path.ToUpper());

            bluray.Scan();
            return(bluray);
        }
コード例 #2
0
        /// <summary>
        /// Returns wether a choice was made and changes the file path
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns>True if playback should continue, False if user cancelled.</returns>
        private bool GetLengthFromPlaylist(string filePath)
        {
            try
            {
                //bool ChecklistToPlay = false;
                Func <string, BDInfo> scanner = scanWorker;
                IAsyncResult          result  = scanner.BeginInvoke(filePath, null, scanner);
                BDInfo bluray = scanner.EndInvoke(result);

                // Put the bluray info into a member variable (for later use)
                currentMediaInfo = bluray;

                List <TSPlaylistFile> allPlayLists = bluray.PlaylistFiles.Values.Where(p => p.IsValid).OrderByDescending(p => p.TotalLength).Distinct().ToList();

                // find movie lenght from selection
                logger.Info("Found {0} playlists, showing selection dialog.", allPlayLists.Count);

                // first make an educated guess about what the real features are (more than one chapter, no loops and longer than one hour)
                // todo: make a better filter on the playlists containing the real features
                List <TSPlaylistFile> playLists = allPlayLists.Where(p => (p.Chapters.Count > 1 || p.TotalLength >= MinimalFullFeatureLength) && !p.HasLoops).ToList();

                // if the filter yields zero results just list all playlists
                if (playLists.Count == 0)
                {
                    playLists = allPlayLists;
                }

                // Take first movie Length
                TSPlaylistFile playList = playLists[0];
                _duration = (int)playList.TotalLength * 1000;

                // put the choosen playlist into our member variable for later use
                currentPlaylistFile = playLists[0];

                return(true);
            }
            catch (Exception e)
            {
                logger.Error("Exception while reading bluray structure {0} {1}", e.Message, e.StackTrace);
                return(false);
            }
        }
コード例 #3
0
 /// <summary>
 /// Scans a bluray folder and returns a BDInfo object
 /// </summary>
 /// <param name="path"></param>
 /// <returns></returns>
 private BDInfo scanWorker(string path)
 {
     logger.Info("Scanning bluray structure: {0}", path);
     BDInfo bluray = new BDInfo(path.ToUpper());
     bluray.Scan();
     return bluray;
 }
コード例 #4
0
        /// <summary>
        /// Returns wether a choice was made and changes the file path
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns>True if playback should continue, False if user cancelled.</returns>
        private bool GetLengthFromPlaylist(string filePath)
        {
            try {
            //bool ChecklistToPlay = false;
            Func<string, BDInfo> scanner = scanWorker;
            IAsyncResult result = scanner.BeginInvoke(filePath, null, scanner);
            BDInfo bluray = scanner.EndInvoke(result);

            // Put the bluray info into a member variable (for later use)
            currentMediaInfo = bluray;

            List<TSPlaylistFile> allPlayLists = bluray.PlaylistFiles.Values.Where(p => p.IsValid).OrderByDescending(p => p.TotalLength).Distinct().ToList();

            // find movie lenght from selection
            logger.Info("Found {0} playlists, showing selection dialog.", allPlayLists.Count);

            // first make an educated guess about what the real features are (more than one chapter, no loops and longer than one hour)
            // todo: make a better filter on the playlists containing the real features
            List<TSPlaylistFile> playLists = allPlayLists.Where(p => (p.Chapters.Count > 1 || p.TotalLength >= MinimalFullFeatureLength) && !p.HasLoops).ToList();

            // if the filter yields zero results just list all playlists
            if (playLists.Count == 0) {
                playLists = allPlayLists;
            }

            // Take first movie Length
            TSPlaylistFile playList = playLists[0];
            _duration = (int)playList.TotalLength * 1000;

            // put the choosen playlist into our member variable for later use
            currentPlaylistFile = playLists[0];

            return true;
            }
            catch (Exception e) {
            logger.Error("Exception while reading bluray structure {0} {1}", e.Message, e.StackTrace);
            return false;
            }
        }