Inheritance: System.Windows.Forms.Form
Exemple #1
0
        private void OpenDisc(string path)
        {
            Cursor          = Cursors.WaitCursor;
            tsslStatus.Text = "Scanning for chapters...";
            try
            {
                ChapterExtractor ex =
                    Directory.Exists(Path.Combine(path, "VIDEO_TS")) ?
                    new DvdExtractor() as ChapterExtractor :
                    Directory.Exists(Path.Combine(path, "ADV_OBJ")) ?
                    new HddvdExtractor() as ChapterExtractor :
                    Directory.Exists(Path.Combine(Path.Combine(path, "BDMV"), "PLAYLIST")) ?
                    new BlurayExtractor() as ChapterExtractor :
                    null;

                if (ex == null)
                {
                    throw new Exception("The location was not detected as DVD, HD-DVD or Blu-Ray.");
                }


                using (StreamSelectDialog frm = new StreamSelectDialog(ex))
                {
                    ex.GetStreams(path);
                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        Settings.Default.LastOpenDir = new DirectoryPathAbsolute(path).Path;
                        Settings.Default.Save();
                        pgc = frm.ProgramChain;
                        if (pgc.FramesPerSecond == 0)
                        {
                            pgc.FramesPerSecond = Settings.Default.DefaultFps;
                        }
                        if (pgc.LangCode == null)
                        {
                            pgc.LangCode = Settings.Default.DefaultLangCode;
                        }
                        FreshChapterView();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Trace.WriteLine(ex);
                tsslStatus.Text = "Could not load chapters from disc.";
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Exemple #2
0
        private void OpenDisc(string path)
        {
            Cursor = Cursors.WaitCursor;
            tsslStatus.Text = "Scanning for chapters...";
            try
            {
            ChapterExtractor ex =
              Directory.Exists(Path.Combine(path, "VIDEO_TS")) ?
              new DvdExtractor() as ChapterExtractor :
              Directory.Exists(Path.Combine(path, "ADV_OBJ")) ?
              new HddvdExtractor() as ChapterExtractor :
              Directory.Exists(Path.Combine(Path.Combine(path, "BDMV"), "PLAYLIST")) ?
              new BlurayExtractor() as ChapterExtractor :
              null;

            if (ex == null)
                throw new Exception("The location was not detected as DVD, HD-DVD or Blu-Ray.");

            using (StreamSelectDialog frm = new StreamSelectDialog(ex))
            {
                ex.GetStreams(path);
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    Settings.Default.LastOpenDir = new DirectoryPathAbsolute(path).Path;
                    Settings.Default.Save();
                    pgc = frm.ProgramChain;
                    if (pgc.FramesPerSecond == 0) pgc.FramesPerSecond = Settings.Default.DefaultFps;
                    if (pgc.LangCode == null) pgc.LangCode = Settings.Default.DefaultLangCode;
                    AutoLoadNames();
                    FreshChapterView();
                }
            }
            }
            catch (Exception ex)
            {
            MessageBox.Show(ex.Message);
            Trace.WriteLine(ex);
            tsslStatus.Text = "Could not load chapters from disc.";
            }
            finally
            {
            Cursor = Cursors.Default;
            }
        }
        private void miOpenDisc_Click(object sender, EventArgs e)
        {
            using (FolderBrowserDialog d = new FolderBrowserDialog())
              {
            d.ShowNewFolderButton = false;
            d.Description = "Select DVD, HD-DVD, BluRay disc, or folder.";
            if (d.ShowDialog() == DialogResult.OK)
            {
              Cursor = Cursors.WaitCursor;
              tsslStatus.Text = "Scanning for chapters...";
              try
              {
            ChapterExtractor ex =
              Directory.Exists(Path.Combine(d.SelectedPath, "VIDEO_TS")) ?
              new DvdExtractor() as ChapterExtractor :
              Directory.Exists(Path.Combine(d.SelectedPath, "ADV_OBJ")) ?
              new HddvdExtractor() as ChapterExtractor :
              Directory.Exists(Path.Combine(Path.Combine(d.SelectedPath, "BDMV"), "PLAYLIST")) ?
              new BlurayExtractor() as ChapterExtractor :
              null;

            if (ex == null)
              throw new Exception("The location was not detected as DVD, HD-DVD or Blu-Ray.");

            using (StreamSelectDialog frm = new StreamSelectDialog(ex))
            {
              ex.GetStreams(d.SelectedPath);
              if (frm.ShowDialog(this) == DialogResult.OK)
              {
                pgc = frm.ProgramChain;
                if (pgc.FramesPerSecond == 0) pgc.FramesPerSecond = Settings.Default.DefaultFps;
                if (pgc.LangCode == null) pgc.LangCode = Settings.Default.DefaultLangCode;
                AutoLoadNames();
                FreshChapterView();
              }
            }
              }
              catch (Exception ex)
              {
            MessageBox.Show(ex.Message);
            Trace.WriteLine(ex);
            tsslStatus.Text = "Could not load chapters from disc.";
              }
              finally
              {
            Cursor = Cursors.Default;
              }
            }
              }
        }