Пример #1
0
        private void QueueButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(FolderOutputTextBox.Text))
            {
                MessageBox.Show("Configure output target folder prior to enqueueing job.", "Enqueue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }

            if (StreamDataGridView.Rows.Count == 0)
            {
                MessageBox.Show("Retrieve streams prior to enqueueing job.", "Enqueue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }

            if (!IsStreamCheckedForExtract())
            {
                MessageBox.Show("Select stream(s) to extract prior to enqueueing job.", "Enqueue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }

            if (!Drives.ableToWriteOnThisDrive(System.IO.Path.GetPathRoot(FolderOutputTextBox.Text)))
            {
                MessageBox.Show("MeGUI cannot write on " + System.IO.Path.GetPathRoot(FolderOutputTextBox.Text) +
                                "\nPlease, select another Output path.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if ((settings.EAC3toPath == "") || (settings.EAC3toPath == "eac3to.exe"))
            {
                MessageBox.Show("Select a correct EAC3to Path first in the MeGUI Settings to avoid issues...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            eac3toArgs args = new eac3toArgs();
            HDStreamsExJob job;

            args.eac3toPath = eac3toPath;
            args.inputPath = FolderInputTextBox.Text;
            if (FolderSelection.Checked)
            {
                if (seamless)
                    args.featureNumber = "1"; // force the feature number
                else
                    args.featureNumber = ((Feature)FeatureDataGridView.SelectedRows[0].DataBoundItem).Number.ToString();
            }
            args.workingFolder = string.IsNullOrEmpty(FolderOutputTextBox.Text) ? FolderOutputTextBox.Text : System.IO.Path.GetDirectoryName(args.eac3toPath);
            args.resultState = ResultState.ExtractCompleted;

            try
            {
                args.args = GenerateArguments();
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Stream Extract", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }

            /*
            InitBackgroundWorker();
            backgroundWorker.ReportProgress(0, "Extracting streams");
            WriteToLog("Extracting streams");
            QueueButton.Enabled = false;
            Cursor = Cursors.WaitCursor;

            backgroundWorker.RunWorkerAsync(args);*/

            // Load to MeGUI job queue
            if (FolderSelection.Checked)
                job = new HDStreamsExJob(dummyInput, this.FolderOutputTextBox.Text+"xxx", args.featureNumber, args.args, inputType);
            else job = new HDStreamsExJob(this.FolderInputTextBox.Text, this.FolderOutputTextBox.Text+"xxx", null, args.args, inputType);

            lastJob = job;
            info.Jobs.addJobsToQueue(job);
            if (this.closeOnQueue.Checked)
                this.Close();
        }
Пример #2
0
        private void QueueButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(FolderOutputTextBox.Text))
            {
                MessageBox.Show("Configure output target folder prior to queueing job.", "Queue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }
            if (StreamDataGridView.Rows.Count == 0)
            {
                MessageBox.Show("Retrieve streams prior to queueing job.", "Queue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }
            if (!IsStreamCheckedForExtract())
            {
                MessageBox.Show("Select stream(s) to extract prior to queueing job.", "Queue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }
            if (FolderSelection.Checked && FeatureDataGridView.SelectedRows.Count == 0)
            {
                MessageBox.Show("Select feature prior to queueing job.", "Queue Job", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }
            if (!Drives.ableToWriteOnThisDrive(System.IO.Path.GetPathRoot(FolderOutputTextBox.Text)))
            {
                MessageBox.Show("MeGUI cannot write on " + System.IO.Path.GetPathRoot(FolderOutputTextBox.Text) +
                                "\nPlease, select another Output path.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }


            eac3toArgs     args = new eac3toArgs();
            HDStreamsExJob job;

            args.eac3toPath = settings.EAC3toPath;
            args.inputPath  = FolderInputTextBox.Text;
            if (FolderSelection.Checked)
            {
                args.featureNumber = ((Feature)FeatureDataGridView.SelectedRows[0].DataBoundItem).Number.ToString();
            }
            args.workingFolder = string.IsNullOrEmpty(FolderOutputTextBox.Text) ? FolderOutputTextBox.Text : System.IO.Path.GetDirectoryName(args.eac3toPath);
            args.resultState   = ResultState.ExtractCompleted;

            try
            {
                args.args = GenerateArguments();
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Stream Extract", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }

            // Load to MeGUI job queue
            if (FolderSelection.Checked)
            {
                job = new HDStreamsExJob(dummyInput, this.FolderOutputTextBox.Text + "xxx", args.featureNumber, args.args, inputType);
            }
            else
            {
                job = new HDStreamsExJob(this.FolderInputTextBox.Text, this.FolderOutputTextBox.Text + "xxx", null, args.args, inputType);
            }

            lastJob = job;
            mainForm.Jobs.addJobsToQueue(job);
            if (this.closeOnQueue.Checked)
            {
                this.Close();
            }
        }