private void renameToolStripMenuItem_Click(object sender, EventArgs e) { InputBox.InputBoxResult renameText = InputBox.Show(Localise.GetPhrase("Enter the new task name"), Localise.GetPhrase("Rename Task"), "", null, new KeyPressEventHandler(taskNameTxt_KeyPress)); if (!renameText.OK || String.IsNullOrWhiteSpace(renameText.Text)) { return; } // Get the existing conversion job string selectedTaskName = taskListLv.SelectedItems[0].SubItems[0].Text; ConversionJobOptions cjo = _mceOptions.GetConversionTaskByName(selectedTaskName); // Delete the conversion job _mceOptions.DeleteConversionTask(selectedTaskName, false); // Update the taskname and create a new task with it cjo.taskName = renameText.Text.Trim(); _mceOptions.AddOrUpdateConversionTask(cjo, false); // Reload the tasks ReadConversionTaskSettings(); }
/// <summary> /// Writes the settings to the cjo object /// </summary> /// <param name="save">True if you want to save the settings to the Global MCE object</param> private void WriteSettings(ConversionJobOptions cjo, bool save) { cjo.taskName = taskNameTxt.Text.Trim(); cjo.profile = profileCbo.SelectedItem.ToString(); cjo.destinationPath = destinationPathTxt.Text; cjo.addToiTunes = addiTunesChk.Checked; cjo.addToWMP = addToWMPChk.Checked; int.TryParse(maxWidthTxt.Text.ToString(), out cjo.maxWidth); cjo.encoderSelectBestAudioTrack = singleAudioTrackChk.Checked; cjo.volumeMultiplier = RangeValToVolume(volumeBar.Value); cjo.qualityMultiplier = RangeValToQuality(qualityBar.Value); cjo.commercialRemoval = (CommercialRemovalOptions)detectAdsCbo.SelectedIndex; cjo.commercialSkipCut = commercialSkipCutChk.Checked; cjo.renameBySeries = renameBySeriesChk.Checked; cjo.altRenameBySeries = altRenameBySeriesChk.Checked; cjo.renameOnly = renameOnlyChk.Checked; cjo.fileSelection = fileMatchTxt.Text; cjo.metaShowSelection = metaShowMatchTxt.Text; cjo.metaNetworkSelection = metaNetworkMatchTxt.Text; cjo.audioLanguage = ISO639_3.GetLanguageCode(langBox.Text); cjo.stereoAudio = !multiChannelAudioChk.Checked; cjo.autoDeInterlace = autoDeinterlaceChk.Checked; cjo.enabled = true; // By default tasks are enabled switch (metaShowTypeCbo.SelectedIndex) { case 1: cjo.metaShowTypeSelection = ShowType.Movie; break; case 2: cjo.metaShowTypeSelection = ShowType.Series; break; case 3: cjo.metaShowTypeSelection = ShowType.Sports; break; case 0: default: cjo.metaShowTypeSelection = ShowType.Default; break; } if (detectAdsCbo.SelectedIndex == (int)CommercialRemovalOptions.None) // Write this only if commercial detection is enabled, default is false { cjo.commercialSkipCut = false; } if (customReNamingChk.Checked && customFileRenamePattern.Text != "") { cjo.customRenameBySeries = customFileRenamePattern.Text; } else { cjo.customRenameBySeries = ""; } if (extractCC.Checked == false) { cjo.extractCC = ""; } // SANITY CHECKS: if ((detectAdsCbo.SelectedIndex != (int)CommercialRemovalOptions.None) && renameOnlyChk.Checked) // If we are naming only, then we need to ensure CommercialSkipCut is enabled if commercial detection is enabled { cjo.commercialSkipCut = true; } if (save) // Are we asked to save them { _mceOptions.AddOrUpdateConversionTask(cjo, false); } }