Exemplo n.º 1
0
        protected override void DoStartRendererWithHint(RenderingStartHint startHint)
        {
            DvdRenderingStartHint hint = startHint as DvdRenderingStartHint;

            if (dvdGraphBuilder == null)
            {
                _vdi = new VideoDvdInformation(renderMediaName);

                InitMedia();
                InitAudioAndVideo();

                // Run the graph to play the media file
                int hr = mediaControl.Run();
                DsError.ThrowExceptionForHR(hr);

                // Give enough time for the filter graph to be completely built
                Thread.Sleep(500);
            }

            if (hint == DvdRenderingStartHint.MainMenu)
            {
                int hr = dvdControl2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd);
                DsError.ThrowExceptionForHR(hr);
            }
            else if (hint == DvdRenderingStartHint.Beginning)
            {
                int hr = 0;

                if (ProTONEConfig.DisableDVDMenu)
                    hr = dvdControl2.PlayTitle(1, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd);
                else
                    //dvdControl.PlayForwards(1f, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd);
                    hr = dvdControl2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd);

                DsError.ThrowExceptionForHR(hr);
            }
            else if (hint.Location.ChapterNum == 0)
            {
                int hr = dvdControl2.PlayTitle(hint.Location.TitleNum, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd);
                DsError.ThrowExceptionForHR(hr);
            }
            else
            {
                int hr = dvdControl2.PlayChapterInTitle(hint.Location.TitleNum, hint.Location.ChapterNum,
                    DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd);
                DsError.ThrowExceptionForHR(hr);
            }

            if (ProTONEConfig.PrefferedSubtitleLang > 0)
            {
                int sid = _vdi.GetSubtitle(ProTONEConfig.PrefferedSubtitleLang);
                if (sid > 0)
                {
                    SetSubtitleStream(sid);
                }
            }
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            VideoDvdInformation drv = obj as VideoDvdInformation;

            if (drv == null)
            {
                return(false);
            }

            return(_dvdPath == drv._dvdPath && Label == drv._label);
        }
Exemplo n.º 3
0
        private DvdMedia(string path)
        {
            if (Directory.Exists(path))
            {
                string    root = Path.GetPathRoot(path);
                DriveInfo drv  = new DriveInfo(root);

                if (path.ToUpperInvariant().EndsWith("VIDEO_TS") ||    // this is the case of a DVD folder somewhere in the system
                    PathUtils.PathHasChildFolder(path, "VIDEO_TS") ||
                    (drv.DriveType == DriveType.CDRom && drv.IsReady)) // this covers the disks in the DVD-ROM units

                {
                    _dvdPath = path;

                    // Should this sequence throw an exception -- invalid DVD media
                    _info = new VideoDvdInformation(_dvdPath);
                }
            }

            if (string.IsNullOrEmpty(_dvdPath))
            {
                throw new ArgumentException("An invalid DVD volume was specified.");
            }
        }
Exemplo n.º 4
0
        private DvdMedia(string path)
        {
            if (Directory.Exists(path))
            {
                string root = Path.GetPathRoot(path);
                DriveInfo drv = new DriveInfo(root);

                if (path.ToUpperInvariant().EndsWith("VIDEO_TS") ||      // this is the case of a DVD folder somewhere in the system
                    PathUtils.PathHasChildFolder(path, "VIDEO_TS") ||
                    (drv.DriveType == DriveType.CDRom && drv.IsReady)) // this covers the disks in the DVD-ROM units
                    
                {
                    _dvdPath = path;

                    // Should this sequence throw an exception -- invalid DVD media
                    _info = new VideoDvdInformation(_dvdPath);
                }
            }

            if (string.IsNullOrEmpty(_dvdPath))
                throw new ArgumentException("An invalid DVD volume was specified.");
        }