/// <summary> /// verifies the input, output and logfile configuration /// based on the codec and encoding mode certain fields must be filled out /// </summary> /// <returns>null if no error; otherwise string error message</returns> public string verifyVideoSettings() { // test for valid input filename string fileErr = MainForm.verifyInputFile(this.VideoInput); if (fileErr != null) { return("Problem with video input filename:\n" + fileErr); } // test for valid output filename (not needed if just doing 1st pass) if (!isFirstPass()) { fileErr = MainForm.verifyOutputFile(this.VideoOutput); if (fileErr != null) { return("Problem with video output filename:\n" + fileErr); } VideoType vot = CurrentVideoOutputType; // test output file extension if (!Path.GetExtension(this.VideoOutput).Replace(".", "").Equals(vot.Extension, StringComparison.InvariantCultureIgnoreCase)) { return("Video output filename does not have the correct extension.\nBased on current settings, it should be " + vot.Extension); } } return(null); }
protected virtual void checkIO() { if (string.IsNullOrEmpty(vInput.Filename)) { muxButton.DialogResult = DialogResult.None; return; } else if (string.IsNullOrEmpty(output.Filename)) { muxButton.DialogResult = DialogResult.None; return; } else if (MainForm.verifyOutputFile(output.Filename) != null) { muxButton.DialogResult = DialogResult.None; return; } else if (fps.Value == null && isFPSRequired()) { muxButton.DialogResult = DialogResult.None; return; } else { muxButton.DialogResult = DialogResult.OK; } }
protected virtual void muxButton_Click(object sender, System.EventArgs e) { if (muxButton.DialogResult != DialogResult.OK) { if (string.IsNullOrEmpty(vInput.Filename)) { MessageBox.Show("You must configure a video input file", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else if (string.IsNullOrEmpty(output.Filename)) { MessageBox.Show("You must configure an output file", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else if (MainForm.verifyOutputFile(output.Filename) != null) { MessageBox.Show("Invalid output file", "Invalid output", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (!fps.Value.HasValue) { MessageBox.Show("You must select a framerate", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } } }
protected virtual void muxButton_Click(object sender, System.EventArgs e) { if (minimizedMode) { return; } if (muxButton.DialogResult != DialogResult.OK) { if (string.IsNullOrEmpty(vInput.Filename)) { MessageBox.Show("You must configure a video input file", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else if (string.IsNullOrEmpty(output.Filename)) { MessageBox.Show("You must configure an output file", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else if (MainForm.verifyOutputFile(output.Filename) != null) { MessageBox.Show("Invalid output file", "Invalid output", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (!fps.Value.HasValue) { MessageBox.Show("You must select a framerate", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } } else { if (this.muxButton.Text.Equals("Update")) { this.Close(); } else { JobChain oJobs = this.Jobs; if (oJobs.Jobs.Length == 0) { MessageBox.Show("No mux job created as input and output are the same", "Nothing to mux", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } mainForm.Jobs.AddJobsWithDependencies(oJobs, true); if (chkCloseOnQueue.Checked) { this.Close(); } else { output.Filename = String.Empty; } } } }
protected virtual void muxButton_Click(object sender, System.EventArgs e) { if (muxButton.DialogResult != DialogResult.OK) { if (string.IsNullOrEmpty(vInput.Filename)) { MessageBox.Show("You must configure a video input file", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else if (string.IsNullOrEmpty(output.Filename)) { MessageBox.Show("You must configure an output file", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else if (MainForm.verifyOutputFile(output.Filename) != null) { MessageBox.Show("Invalid output file", "Invalid output", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (!fps.Value.HasValue) { MessageBox.Show("You must select a framerate", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } } else { if (this.muxButton.Text.Equals("Update")) { this.Close(); } else { MuxJob job = this.Job; mainForm.Jobs.AddJobsToQueue(job); if (chkCloseOnQueue.Checked) { this.Close(); } else { output.Filename = String.Empty; } } } }
public void InitializeDropdowns() { videoCodec.Items.Clear(); videoCodec.Items.AddRange(mainForm.PackageSystem.VideoSettingsProviders.ValuesArray); try { videoCodec.SelectedItem = mainForm.PackageSystem.VideoSettingsProviders["x264"]; } catch (Exception) { try { videoCodec.SelectedIndex = 0; } catch (Exception) { MessageBox.Show("No valid video codecs are set up", "No valid video codecs", MessageBoxButtons.OK, MessageBoxIcon.Error); } } fileTypeHandler = new FileTypeHandler <VideoType>(fileType, videoCodec, new FileTypeHandler <VideoType> .SupportedOutputGetter(delegate { return(videoEncoderProvider.GetSupportedOutput(codecHandler.CurrentSettingsProvider.EncoderType)); })); fileTypeHandler.FileTypeChanged += new FileTypeHandler <VideoType> .FileTypeEvent(delegate (object sender, VideoType currentType) { VideoCodecSettings settings = CurrentSettings; this.updateIOConfig(); if (MainForm.verifyOutputFile(this.VideoOutput) == null) { this.VideoOutput = Path.ChangeExtension(this.VideoOutput, currentType.Extension); } }); codecHandler = new MultipleConfigurersHandler <VideoCodecSettings, VideoInfo, VideoCodec, VideoEncoderType>(videoCodec); profileHandler = new ProfilesControlHandler <VideoCodecSettings, VideoInfo>("Video", mainForm, profileControl1, codecHandler.EditSettings, new InfoGetter <VideoInfo>(getInfo), codecHandler.Getter, codecHandler.Setter); codecHandler.Register(profileHandler); fileTypeHandler.RefreshFiletypes(); }
public string verifyAudioSettings() { // test for valid input filename int nbEmptyStreams = 0; foreach (AudioStream stream in audioStreams) { if (string.IsNullOrEmpty(stream.path) && string.IsNullOrEmpty(stream.output)) { nbEmptyStreams++; continue; } string fileErr = MainForm.verifyInputFile(this.AudioInput); if (fileErr != null) { return("Problem with audio input filename:\n" + fileErr); } fileErr = MainForm.verifyOutputFile(this.AudioOutput); if (fileErr != null) { return("Problem with audio output filename:\n" + fileErr); } AudioType aot = this.audioContainer.SelectedItem as AudioType; // test output file extension if (!Path.GetExtension(this.AudioOutput).Replace(".", "").Equals(aot.Extension, StringComparison.InvariantCultureIgnoreCase)) { return("Audio output filename does not have the correct extension.\nBased on current settings, it should be " + aot.Extension); } } if (nbEmptyStreams == audioStreams.Length) { return("No audio input defined."); } return(null); }