Beispiel #1
0
 private void langBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     langCode.Text = ISO639_3.GetLanguageCode(langBox.Text);
 }
Beispiel #2
0
        /// <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);
            }
        }