private void saveSettings() { //"settings.xml" will be overwritten SaveLoadXml doc = new SaveLoadXml("save", sProgrammPath); doc.OpenXmlWriting(); //Save eac3to settings doc.saveValue("eac3to", "convert_channels", checkBoxEac3toSettingsConvertChannels.Checked); doc.saveValue("eac3to", "convert_to_stereo", radioButtonEac3toSettingsConvertToStereo.Checked); doc.saveValue("eac3to", "dialog_normalization", checkBoxEac3toSettingsDialogNormalization.Checked); //Save SoX settings doc.saveValue("sox", "main_buffer_size", comboBoxSoXSettingsMainBufferSize.Text); doc.saveValue("sox", "convert_input_audio_resolution", checkBoxSoXSettingsInputConvertAudioResolution.Checked); doc.saveValue("sox", "convert_input_audio_resolution_value", comboBoxSoXSettingsInputConvertAudioResolution.Text); doc.saveValue("sox", "convert_input_encoding_type", checkBoxSoXSettingsInputConvertEncodingType.Checked); doc.saveValue("sox", "convert_input_encoding_type_value", comboBoxSoXSettingsInputConvertEncodingType.Text); doc.saveValue("sox", "convert_input_sampling_rate", checkBoxSoXSettingsInputConvertSamplingRate.Checked); doc.saveValue("sox", "convert_input_sampling_rate_value", comboBoxSoXSettingsInputConvertSamplingRate.Text); doc.saveValue("sox", "effects_change_tempo", checkBoxSoXEffectsChangeTempo.Checked); doc.saveValue("sox", "effects_change_tempo_with_fps", radioButtonSoXEffectsChangeTempoWithFPS.Checked); doc.saveValue("sox", "effects_change_tempo_with_fps_source", textBoxSoxEffectsChangeFrameRateSource.Text); doc.saveValue("sox", "effects_change_tempo_with_fps_target", textBoxSoxEffectsChangeFrameRateTarget.Text); doc.saveValue("sox", "effects_change_tempo_with_duration", radioButtonSoXEffectsChangeTempoDuration.Checked); doc.saveValue("sox", "effects_change_tempo_with_duration_source", textBoxSoxEffectsChangeDurationSource.Text); doc.saveValue("sox", "effects_change_tempo_with_duration_target", textBoxSoxEffectsChangeDurationTarget.Text); doc.saveValue("sox", "effects_change_tempo_with_direct_value", radioButtonSoXEffectsChangeTempoValue.Checked); doc.saveValue("sox", "effects_change_tempo_with_direct_value_source", textBoxSoxEffectsChangeTempoValue.Text); doc.saveValue("sox", "effects_change_pitch", checkBoxSoXEffectsPitch.Checked); doc.saveValue("sox", "effects_change_pitch_value", textBoxSoXSettingsPitch.Text); doc.saveValue("sox", "effects_change_gain", checkBoxSoXSettingsGain.Checked); doc.saveValue("sox", "effects_change_gain_value", textBoxSoXSettingsGain.Text); doc.saveValue("sox", "effects_activate_stereo_downmix", checkBoxSoXSettingsDownmixActivate.Checked); doc.saveValue("sox", "effects_activate_stereo_downmix_value", comboBoxSoXSettingsDownmixProLogic.Text); doc.saveValue("sox", "effects_normalize_51_downmix_matrix", checkBoxSoXSettings51DownmixNormalize.Checked); doc.saveValue("sox", "effects_mix_lfe", checkBoxSoXSettings51MixLFE.Checked); doc.saveValue("sox", "convert_output_audio_resolution", checkBoxSoXSettingsOutputConvertAudioResolution.Checked); doc.saveValue("sox", "convert_output_audio_resolution_value", comboBoxSoXSettingsOutputConvertAudioResolution.Text); doc.saveValue("sox", "convert_output_encoding_type", checkBoxSoXSettingsOutputConvertEncodingType.Checked); doc.saveValue("sox", "convert_output_encoding_type_value", comboBoxSoXSettingsOutputConvertEncodingType.Text); doc.saveValue("sox", "convert_output_sampling_rate", checkBoxSoXSettingsOutputConvertSamplingRate.Checked); doc.saveValue("sox", "convert_output_sampling_rate_value", comboBoxSoXSettingsOutputConvertSamplingRate.Text); //Save AAC settings doc.saveValue("aac", "output_target_quality", radioButtonAACQuality.Checked); doc.saveValue("aac", "output_target_bitrate", radioButtonAACBitrate.Checked); doc.saveValue("aac", "output_target_quality_value", trackBarAACQuality.Value); doc.saveValue("aac", "output_target_bitrate_value", trackBarAACBitrate.Value); doc.saveValue("aac", "restrict_encoder", checkBoxAACRestrictEncoder.Checked); doc.saveValue("aac", "profile", comboBoxAACProfiles.Text); doc.saveValue("aac", "generate_rtp_hinttrack", checkBoxAACRTPHinttrack.Checked); //Save AC3 settings doc.saveValue("ac3", "output_target_bitrate", trackBarAC3Bitrate.Value); doc.saveValue("ac3", "exponent_strategy_search_size", trackBarAC3ExponentStrategySearchSize.Value); doc.saveValue("ac3", "center_mix_level", comboBoxAC3BitsreamInfoCentermix.Text); doc.saveValue("ac3", "surround_mix_level", comboBoxAC3BitsreamInfoSurroundmix.Text); doc.saveValue("ac3", "dolby_surround_mode", comboBoxAC3BitstreamInfoDolbySurround.Text); doc.saveValue("ac3", "dynamic_range_compression_level", comboBoxAC3DynamicRange.Text); doc.saveValue("ac3", "dialog_normalization_compression_level", comboBoxAC3DialogNormalization.Text); //Save DTS settings doc.saveValue("dts", "754.5 kbits", radioButtonDTSBitrate7545.Checked); doc.saveValue("dts", "1509.75 kbits", radioButtonDTSBitrate150975.Checked); //Save FLAC settings doc.saveValue("flac", "compression_level", trackBarFLACCompression.Value); //Save MP3 settings doc.saveValue("mp3", "output_target_quality", radioButtonMP3Quality.Checked); doc.saveValue("mp3", "output_target_bitrate", radioButtonMP3Bitrate.Checked); doc.saveValue("mp3", "output_target_quality_value", trackBarMP3Quality.Value); doc.saveValue("mp3", "output_target_bitrate_value", trackBarMP3Bitrate.Value); doc.saveValue("mp3", "restrict_encoder", checkBoxMP3RestrictEncoder.Checked); doc.saveValue("mp3", "channel_mode", comboBoxMP3OptionsChannelModes.Text); doc.saveValue("mp3", "activate_error_protection", checkBoxMP3OptionsErrorProtection.Checked); //Save WAV settings doc.saveValue("wav", "target_format_wav", radioButtonWAVOutputFormatWAV.Checked); doc.saveValue("wav", "target_format_aiff", radioButtonWAVOutputFormatAIFF.Checked); doc.CloseXmlWriting(); doc = null; }
//**************************************************************************************************** // Load & Save //**************************************************************************************************** private void loadSettings() { try { SaveLoadXml doc = new SaveLoadXml("load", sProgrammPath); //Load eac3to settings checkBoxEac3toSettingsConvertChannels.Checked = Convert.ToBoolean(doc.loadValue("eac3to", "convert_channels")); radioButtonEac3toSettingsConvertToStereo.Checked = Convert.ToBoolean(doc.loadValue("eac3to", "convert_to_stereo")); checkBoxEac3toSettingsDialogNormalization.Checked = Convert.ToBoolean(doc.loadValue("eac3to", "dialog_normalization")); //Load SoX settings comboBoxSoXSettingsMainBufferSize.Text = doc.loadValue("sox", "main_buffer_size"); checkBoxSoXSettingsInputConvertAudioResolution.Checked = Convert.ToBoolean(doc.loadValue("sox", "convert_input_audio_resolution")); comboBoxSoXSettingsInputConvertAudioResolution.Text = doc.loadValue("sox", "convert_input_audio_resolution_value"); checkBoxSoXSettingsInputConvertEncodingType.Checked = Convert.ToBoolean(doc.loadValue("sox", "convert_input_encoding_type")); comboBoxSoXSettingsInputConvertEncodingType.Text = doc.loadValue("sox", "convert_input_encoding_type_value"); checkBoxSoXSettingsInputConvertSamplingRate.Checked = Convert.ToBoolean(doc.loadValue("sox", "convert_input_sampling_rate")); comboBoxSoXSettingsInputConvertSamplingRate.Text = doc.loadValue("sox", "convert_input_sampling_rate_value"); checkBoxSoXEffectsChangeTempo.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_change_tempo")); radioButtonSoXEffectsChangeTempoWithFPS.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_change_tempo_with_fps")); textBoxSoxEffectsChangeFrameRateSource.Text = doc.loadValue("sox", "effects_change_tempo_with_fps_source"); textBoxSoxEffectsChangeFrameRateTarget.Text = doc.loadValue("sox", "effects_change_tempo_with_fps_target"); radioButtonSoXEffectsChangeTempoDuration.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_change_tempo_with_duration")); textBoxSoxEffectsChangeDurationSource.Text = doc.loadValue("sox", "effects_change_tempo_with_duration_source"); textBoxSoxEffectsChangeDurationTarget.Text = doc.loadValue("sox", "effects_change_tempo_with_duration_target"); radioButtonSoXEffectsChangeTempoValue.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_change_tempo_with_direct_value")); textBoxSoxEffectsChangeTempoValue.Text = doc.loadValue("sox", "effects_change_tempo_with_direct_value_source"); checkBoxSoXEffectsPitch.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_change_pitch")); textBoxSoXSettingsPitch.Text = doc.loadValue("sox", "effects_change_pitch_value"); checkBoxSoXSettingsGain.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_change_gain")); textBoxSoXSettingsGain.Text = doc.loadValue("sox", "effects_change_gain_value"); checkBoxSoXSettingsDownmixActivate.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_activate_stereo_downmix")); comboBoxSoXSettingsDownmixProLogic.Text = doc.loadValue("sox", "effects_activate_stereo_downmix_value"); checkBoxSoXSettings51DownmixNormalize.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_normalize_51_downmix_matrix")); checkBoxSoXSettings51MixLFE.Checked = Convert.ToBoolean(doc.loadValue("sox", "effects_mix_lfe")); checkBoxSoXSettingsOutputConvertAudioResolution.Checked = Convert.ToBoolean(doc.loadValue("sox", "convert_output_audio_resolution")); comboBoxSoXSettingsOutputConvertAudioResolution.Text = doc.loadValue("sox", "convert_output_audio_resolution_value"); checkBoxSoXSettingsOutputConvertEncodingType.Checked = Convert.ToBoolean(doc.loadValue("sox", "convert_output_encoding_type")); comboBoxSoXSettingsOutputConvertEncodingType.Text = doc.loadValue("sox", "convert_output_encoding_type_value"); checkBoxSoXSettingsOutputConvertSamplingRate.Checked = Convert.ToBoolean(doc.loadValue("sox", "convert_output_sampling_rate")); comboBoxSoXSettingsOutputConvertSamplingRate.Text = doc.loadValue("sox", "convert_output_sampling_rate_value"); //Load AAC settings radioButtonAACQuality.Checked = Convert.ToBoolean(doc.loadValue("aac", "output_target_quality")); radioButtonAACBitrate.Checked = Convert.ToBoolean(doc.loadValue("aac", "output_target_bitrate")); trackBarAACQuality.Value = Convert.ToInt32(doc.loadValue("aac", "output_target_quality_value")); trackBarAACBitrate.Value = Convert.ToInt32(doc.loadValue("aac", "output_target_bitrate_value")); checkBoxAACRestrictEncoder.Checked = Convert.ToBoolean(doc.loadValue("aac", "restrict_encoder")); comboBoxAACProfiles.Text = doc.loadValue("aac", "profile"); checkBoxAACRTPHinttrack.Checked = Convert.ToBoolean(doc.loadValue("aac", "generate_rtp_hinttrack")); //Load AC3 settings trackBarAC3Bitrate.Value = Convert.ToInt32(doc.loadValue("ac3", "output_target_bitrate")); trackBarAC3ExponentStrategySearchSize.Value = Convert.ToInt32(doc.loadValue("ac3", "exponent_strategy_search_size")); comboBoxAC3BitsreamInfoCentermix.Text = doc.loadValue("ac3", "center_mix_level"); comboBoxAC3BitsreamInfoSurroundmix.Text = doc.loadValue("ac3", "surround_mix_level"); comboBoxAC3BitstreamInfoDolbySurround.Text = doc.loadValue("ac3", "dolby_surround_mode"); comboBoxAC3DynamicRange.Text = doc.loadValue("ac3", "dynamic_range_compression_level"); comboBoxAC3DialogNormalization.Text = doc.loadValue("ac3", "dialog_normalization_compression_level"); //Load DTS settings radioButtonDTSBitrate7545.Checked = Convert.ToBoolean(doc.loadValue("dts", "754.5 kbits")); radioButtonDTSBitrate150975.Checked = Convert.ToBoolean(doc.loadValue("dts", "1509.75 kbits")); //Load FLAC settings trackBarFLACCompression.Value = Convert.ToInt32(doc.loadValue("flac", "compression_level")); //Load MP3 settings radioButtonMP3Quality.Checked = Convert.ToBoolean(doc.loadValue("mp3", "output_target_quality")); radioButtonMP3Bitrate.Checked = Convert.ToBoolean(doc.loadValue("mp3", "output_target_bitrate")); trackBarMP3Quality.Value = Convert.ToInt32(doc.loadValue("mp3", "output_target_quality_value")); trackBarMP3Bitrate.Value = Convert.ToInt32(doc.loadValue("mp3", "output_target_bitrate_value")); checkBoxMP3RestrictEncoder.Checked = Convert.ToBoolean(doc.loadValue("mp3", "restrict_encoder")); comboBoxMP3OptionsChannelModes.Text = doc.loadValue("mp3", "channel_mode"); checkBoxMP3OptionsErrorProtection.Checked = Convert.ToBoolean(doc.loadValue("mp3", "activate_error_protection")); //Load WAV settings radioButtonWAVOutputFormatWAV.Checked = Convert.ToBoolean(doc.loadValue("wav", "target_format_wav")); radioButtonWAVOutputFormatAIFF.Checked = Convert.ToBoolean(doc.loadValue("wav", "target_format_aiff")); doc = null; } catch (Exception e) { Console.WriteLine("Fehler beim Laden der Einstellungen! " + e); } }