/// <summary>
        /// Update the global settings based on GUI.
        /// </summary>
        private void updateSettings()
        {
            mediaFiles         = UtilsCommon.getNonHiddenFiles(textBoxMediaFile.Text.Trim());
            audioStream        = (InfoStream)comboBoxStreamAudioFromVideo.SelectedItem;
            outputDir          = textBoxOutputDir.Text.Trim();
            deckName           = textBoxName.Text.Trim().Replace(" ", "_");
            episodeStartNumber = Convert.ToInt32(numericUpDownEpisodeStartNumber.Text.Trim());
            isSingleFile       = radioButtonSingle.Checked;

            if (groupBoxCheckLyrics.Checked)
            {
                Settings.Instance.Subs[0].FilePattern         = textBoxSubs1File.Text.Trim();
                Settings.Instance.Subs[0].TimingsEnabled      = radioButtonTimingSubs1.Checked;
                Settings.Instance.Subs[0].TimeShift           = (int)numericUpDownTimeShiftSubs1.Value;
                Settings.Instance.Subs[0].Files               = UtilsSubs.getSubsFiles(Settings.Instance.Subs[0].FilePattern).ToArray();
                Settings.Instance.Subs[0].Encoding            = InfoEncoding.longToShort(this.comboBoxEncodingSubs1.Text);
                Settings.Instance.Subs[0].RemoveNoCounterpart = this.checkBoxRemoveLinesWithoutCounterpartSubs1.Checked;
                Settings.Instance.Subs[0].RemoveStyledLines   = this.checkBoxRemoveStyledLinesSubs1.Checked;

                Settings.Instance.Subs[1].FilePattern         = textBoxSubs2File.Text.Trim();
                Settings.Instance.Subs[1].TimingsEnabled      = radioButtonTimingSubs2.Checked;
                Settings.Instance.Subs[1].TimeShift           = (int)numericUpDownTimeShiftSubs2.Value;
                Settings.Instance.Subs[1].Encoding            = InfoEncoding.longToShort(this.comboBoxEncodingSubs2.Text);
                Settings.Instance.Subs[1].RemoveNoCounterpart = this.checkBoxRemoveLinesWithoutCounterpartSubs2.Checked;
                Settings.Instance.Subs[1].RemoveStyledLines   = this.checkBoxRemoveStyledLinesSubs2.Checked;

                if (Settings.Instance.Subs[1].FilePattern.Trim().Length > 0)
                {
                    Settings.Instance.Subs[1].Files = UtilsSubs.getSubsFiles(Settings.Instance.Subs[1].FilePattern).ToArray();
                }
                else
                {
                    Settings.Instance.Subs[1].Files = new string[0];
                }

                Settings.Instance.TimeShiftEnabled = groupBoxCheckTimeShift.Checked;
            }

            if (!isSingleFile)
            {
                clipLength = UtilsSubs.stringToTime(maskedTextBoxClipLength.Text.Trim());
            }

            useSpan = this.groupBoxCheckSpan.Checked;

            if (useSpan)
            {
                spanStart = UtilsSubs.stringToTime(maskedTextBoxSpanStart.Text.Trim());
                spanEnd   = UtilsSubs.stringToTime(maskedTextBoxSpanEnd.Text.Trim());
            }

            bitrate = Convert.ToInt32(comboBoxBitrate.Text.Trim());
        }