Пример #1
0
        public void Save(SettingsWriter sw)
        {
            _config.Save(sw);

            sw.Save("FreedbLookup", _useFreeDb);
            sw.Save("MusicBrainzLookup", _useMusicBrainz);
            sw.Save("AccurateRipLookup", _useAccurateRip);
            sw.Save("LocalDBLookup", _useLocalDB);
            sw.Save("SkipRecent", _skipRecent);
            sw.Save("CUEToolsDBLookup", _useCUEToolsDB);
            sw.Save("OutputAudioType", (int)_outputAudioType);
            sw.Save("OutputAudioFmt", _outputAudioFormat);
            sw.Save("AccurateRipMode", (int)_action);
            sw.Save("CUEStyle", (int)_CUEStyle);
            sw.Save("WriteOffset", (int)_writeOffset);
            sw.Save("OutputPathTemplate", _outputTemplate);
            sw.Save("Script", _script);
        }
Пример #2
0
        public void Save(SettingsWriter sw)
        {
            sw.Save("Version", 203);
            sw.Save("ArFixWhenConfidence", fixOffsetMinimumConfidence);
            sw.Save("ArFixWhenPercent", fixOffsetMinimumTracksPercent);
            sw.Save("ArEncodeWhenConfidence", encodeWhenConfidence);
            sw.Save("ArEncodeWhenPercent", encodeWhenPercent);
            sw.Save("ArEncodeWhenZeroOffset", encodeWhenZeroOffset);
            sw.Save("ArNoUnverifiedOutput", noUnverifiedOutput);
            sw.Save("ArFixOffset", fixOffset);
            sw.Save("ArWriteCRC", writeArTagsOnEncode);
            sw.Save("ArWriteLog", writeArLogOnConvert);
            sw.Save("ArWriteTagsOnVerify", writeArTagsOnVerify);
            sw.Save("ArWriteLogOnVerify", writeArLogOnVerify);

            sw.Save("PreserveHTOA", preserveHTOA);
            sw.Save("DetectGaps", detectGaps);            
            sw.Save("AutoCorrectFilenames", autoCorrectFilenames);
            sw.Save("KeepOriginalFilenames", keepOriginalFilenames);
            sw.Save("SingleFilenameFormat", singleFilenameFormat);
            sw.Save("TrackFilenameFormat", trackFilenameFormat);
            sw.Save("RemoveSpecialCharacters", removeSpecial);
            sw.Save("SpecialCharactersExceptions", specialExceptions);
            sw.Save("ReplaceSpaces", replaceSpaces);
            sw.Save("EmbedLog", embedLog);
            sw.Save("ExtractLog", extractLog);
            sw.Save("FillUpCUE", fillUpCUE);
            sw.Save("OverwriteCUEData", overwriteCUEData);
            sw.Save("FilenamesANSISafe", filenamesANSISafe);
            if (bruteForceDTL) sw.Save("BruteForceDTL", bruteForceDTL);
            sw.Save("CreateEACLOG", createEACLOG);
            sw.Save("DetectHDCD", detectHDCD);
            sw.Save("Wait750FramesForHDCD", wait750FramesForHDCD);
            sw.Save("DecodeHDCD", decodeHDCD);
            sw.Save("CreateM3U", createM3U);
            sw.Save("CreateCUEFileWhenEmbedded", createCUEFileWhenEmbedded);
            sw.Save("Truncate4608ExtraSamples", truncate4608ExtraSamples);
            sw.Save("LossyWAVQuality", lossyWAVQuality);
            sw.Save("DecodeHDCDToLossyWAV16", decodeHDCDtoLW16);
            sw.Save("DecodeHDCDTo24bit", decodeHDCDto24bit);
            sw.Save("OneInstance", oneInstance);
            sw.Save("CheckForUpdates", checkForUpdates);
            sw.Save("Language", language);

            sw.Save("SeparateDecodingThread", separateDecodingThread);

            sw.Save("WriteBasicTagsFromCUEData", writeBasicTagsFromCUEData);
            sw.Save("CopyBasicTags", copyBasicTags);
            sw.Save("CopyUnknownTags", copyUnknownTags);
            sw.Save("CopyAlbumArt", CopyAlbumArt);
            sw.Save("EmbedAlbumArt", embedAlbumArt);
            sw.Save("ExtractAlbumArt", extractAlbumArt);
            sw.Save("MaxAlbumArtSize", maxAlbumArtSize);

            sw.Save("ArLogToSourceFolder", arLogToSourceFolder);
            sw.Save("ArLogVerbose", arLogVerbose);
            sw.Save("FixOffsetToNearest", fixOffsetToNearest);

            sw.Save("ArLogFilenameFormat", ArLogFilenameFormat);
            sw.Save("AlArtFilenameFormat", AlArtFilenameFormat);

            using (TextWriter tw = new StringWriter())
            using (XmlWriter xw = XmlTextWriter.Create(tw, xmlEmptySettings))
            {
                CUEConfigAdvanced.serializer.Serialize(xw, advanced, xmlEmptyNamespaces);
                sw.SaveText("Advanced", tw.ToString());
            }

            int nEncoders = 0;
            foreach (CUEToolsUDC encoder in encoders)
            {
                sw.Save(string.Format("ExternalEncoder{0}Name", nEncoders), encoder.name);
                sw.Save(string.Format("ExternalEncoder{0}Modes", nEncoders), encoder.supported_modes);
                sw.Save(string.Format("ExternalEncoder{0}Mode", nEncoders), encoder.default_mode);
                if (encoder.path != null)
                {
                    sw.Save(string.Format("ExternalEncoder{0}Extension", nEncoders), encoder.extension);
                    sw.Save(string.Format("ExternalEncoder{0}Path", nEncoders), encoder.path);
                    sw.Save(string.Format("ExternalEncoder{0}Lossless", nEncoders), encoder.lossless);
                    sw.Save(string.Format("ExternalEncoder{0}Parameters", nEncoders), encoder.parameters);
                }
                else
                {
                    if (encoder.settingsSerializer != null)
                    {
                        using (TextWriter tw = new StringWriter())
                        using (XmlWriter xw = XmlTextWriter.Create(tw, xmlEmptySettings))
                        {
                            encoder.settingsSerializer.Serialize(xw, encoder.settings, xmlEmptyNamespaces);
                            sw.SaveText(string.Format("ExternalEncoder{0}Parameters", nEncoders), tw.ToString());
                        }
                    }
                }
                nEncoders++;
            }
            sw.Save("ExternalEncoders", nEncoders);

            int nDecoders = 0;
            foreach (KeyValuePair<string, CUEToolsUDC> decoder in decoders)
                if (decoder.Value.path != null)
                {
                    sw.Save(string.Format("ExternalDecoder{0}Name", nDecoders), decoder.Key);
                    sw.Save(string.Format("ExternalDecoder{0}Extension", nDecoders), decoder.Value.extension);
                    sw.Save(string.Format("ExternalDecoder{0}Path", nDecoders), decoder.Value.path);
                    sw.Save(string.Format("ExternalDecoder{0}Parameters", nDecoders), decoder.Value.parameters);
                    nDecoders++;
                }
            sw.Save("ExternalDecoders", nDecoders);

            int nFormats = 0;
            foreach (KeyValuePair<string, CUEToolsFormat> format in formats)
            {
                sw.Save(string.Format("CustomFormat{0}Name", nFormats), format.Key);
                sw.Save(string.Format("CustomFormat{0}EncoderLossless", nFormats), format.Value.encoderLossless == null ? "" : format.Value.encoderLossless.Name);
                sw.Save(string.Format("CustomFormat{0}EncoderLossy", nFormats), format.Value.encoderLossy == null ? "" : format.Value.encoderLossy.Name);
                sw.Save(string.Format("CustomFormat{0}Decoder", nFormats), format.Value.decoder);
                sw.Save(string.Format("CustomFormat{0}Tagger", nFormats), (int)format.Value.tagger);
                sw.Save(string.Format("CustomFormat{0}AllowLossless", nFormats), format.Value.allowLossless);
                sw.Save(string.Format("CustomFormat{0}AllowLossy", nFormats), format.Value.allowLossy);
                sw.Save(string.Format("CustomFormat{0}AllowLossyWAV", nFormats), format.Value.allowLossyWAV);
                sw.Save(string.Format("CustomFormat{0}AllowEmbed", nFormats), format.Value.allowEmbed);
                nFormats++;
            }
            sw.Save("CustomFormats", nFormats);

            int nScripts = 0;
            foreach (KeyValuePair<string, CUEToolsScript> script in scripts)
            {
                sw.Save(string.Format("CustomScript{0}Name", nScripts), script.Key);
                sw.SaveText(string.Format("CustomScript{0}Code", nScripts), script.Value.code);
                int nCondition = 0;
                foreach (CUEAction action in script.Value.conditions)
                    sw.Save(string.Format("CustomScript{0}Condition{1}", nScripts, nCondition++), (int)action);
                sw.Save(string.Format("CustomScript{0}Conditions", nScripts), nCondition);
                nScripts++;
            }
            sw.Save("CustomScripts", nScripts);
            sw.Save("DefaultVerifyScript", defaultVerifyScript);
            sw.Save("DefaultVerifyAndConvertScript", defaultEncodeScript);

            sw.Save("GapsHandling", (int)gapsHandling);
        }
Пример #3
0
		private void frmCUERipper_FormClosed(object sender, FormClosedEventArgs e)
		{
			SettingsWriter sw = new SettingsWriter("CUERipper", "settings.txt", Application.ExecutablePath);
			_config.Save(sw);
			sw.Save("DefaultLosslessFormat", _defaultLosslessFormat);
			sw.Save("DefaultLossyFormat", _defaultLossyFormat);
			sw.Save("DefaultHybridFormat", _defaultHybridFormat);
			//sw.Save("CreateEACLOG", _config.createEACLOG);
			//sw.Save("PreserveHTOA", _config.preserveHTOA);
			//sw.Save("CreateM3U", _config.createM3U);
			sw.Save("OutputAudioType", (int)SelectedOutputAudioType);
			sw.Save("ComboImage", bnComboBoxImage.SelectedIndex);
			sw.Save("PathFormat", bnComboBoxOutputFormat.Text);
			sw.Save("SecureMode", trackBarSecureMode.Value);
			sw.Save("OutputPathUseTemplates", bnComboBoxOutputFormat.Items.Count - OutputPathUseTemplates.Length);
            sw.Save("TestAndCopy", this.testAndCopy);
			var SizeIncrement = Size - MinimumSize;
			sw.Save("WidthIncrement", SizeIncrement.Width);
			sw.Save("HeightIncrement", SizeIncrement.Height);
			for (int iFormat = bnComboBoxOutputFormat.Items.Count - 1; iFormat >= OutputPathUseTemplates.Length; iFormat--)
				sw.Save(string.Format("OutputPathUseTemplate{0}", iFormat - OutputPathUseTemplates.Length), bnComboBoxOutputFormat.Items[iFormat].ToString());

			if (defaultDrive != null)
				sw.Save("DefaultDrive", defaultDrive);
			sw.Close();
		}