Exemplo n.º 1
0
        public void ProcessQueue()
        {
            try
            {
                silent = true;
                abort = false;

                foreach (Project project in projectQueue)
                {
                    logWindow.ClearAll();

                    logWindow.MessageMain(Global.ResFormat("InfoQueueStart", (projectQueue.IndexOf(project) + 1), projectQueue.Count));

                    if (!abort)
                    {
                        logWindow.MessageMain(Global.ResFormat("InfoQueueProjectStart", project.settings.movieTitle));
                        settings = new UserSettings(project.settings);
                        titleList.Clear();
                        foreach (TitleInfo ti in project.titleList)
                        {
                            titleList.Add(new TitleInfo(ti));
                        }
                        UpdateTitleList();
                        comboBoxTitle.SelectedIndex = project.titleIndex;
                        demuxedStreamList = new TitleInfo(project.demuxedStreamList);

                        m2tsList.Clear();
                        foreach (string s in project.m2tsList)
                        {
                            m2tsList.Add(s);
                        }

                        UpdateFromSettings(true);
                        demuxedStreamsWindow.UpdateDemuxedStreams();

                        StartAll();
                    }
                    else
                    {
                        logWindow.MessageMain(Global.Res("InfoQueueCancel"));
                    }
                    logWindow.MessageMain(Global.Res("InfoQueueDone"));

                    if (projectQueue.IndexOf(project) != projectQueue.Count - 1)
                    {
                        ShutdownWindow sw = new ShutdownWindow("CaptionShutdownWindowQueue", "LabelShutdownCounterQueue", 20);
                        sw.ShowDialog();
                        if (sw.DialogResult == false) break;
                    }
                }

                if (queueWindow.checkBoxQueueShutdown.IsChecked == true)
                {
                    ShutdownWindow sw = new ShutdownWindow();
                    sw.ShowDialog();
                    if (sw.DialogResult == true)
                    {
                        System.Diagnostics.Process.Start("ShutDown", "-s -f");
                    }
                }
            }
            catch (Exception ex)
            {
                logWindow.MessageMain(Global.Res("ErrorException") + " " + ex.Message);
            }
            finally
            {
                silent = false;
            }
        }
Exemplo n.º 2
0
        private void buttonStart_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                StartAll();

                if (queueWindow.checkBoxQueueShutdown.IsChecked == true)
                {
                    ShutdownWindow sw = new ShutdownWindow();
                    sw.ShowDialog();
                    if (sw.DialogResult == true)
                    {
                        System.Diagnostics.Process.Start("ShutDown", "-s -f");
                    }
                }
            }
            catch (Exception ex)
            {
                logWindow.MessageMain(Global.Res("ErrorException") + " " + ex.Message);
            }
        }