Example #1
0
 public CUEConfigAdvanced(CUEConfigAdvanced src)
 {
     // Iterate through each property and call SetValue()
     foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
     {
         property.SetValue(this, property.GetValue(src));
     }
 }
Example #2
0
        public CUEConfig()
            : base()
        {
            fixOffsetMinimumConfidence    = 2;
            fixOffsetMinimumTracksPercent = 51;
            encodeWhenConfidence          = 2;
            encodeWhenPercent             = 100;
            encodeWhenZeroOffset          = false;
            fixOffset           = false;
            noUnverifiedOutput  = false;
            writeArTagsOnEncode = false;
            writeArLogOnConvert = true;
            writeArTagsOnVerify = false;
            writeArLogOnVerify  = false;

            autoCorrectFilenames  = true;
            preserveHTOA          = true;
            detectGaps            = true;
            keepOriginalFilenames = false;
            trackFilenameFormat   = "%tracknumber%. %title%";
            singleFilenameFormat  = "%filename%";
            removeSpecial         = false;
            specialExceptions     = "-()";
            replaceSpaces         = false;
            embedLog                  = true;
            extractLog                = true;
            fillUpCUE                 = true;
            overwriteCUEData          = false;
            filenamesANSISafe         = true;
            bruteForceDTL             = false;
            createEACLOG              = true;
            detectHDCD                = true;
            wait750FramesForHDCD      = true;
            decodeHDCD                = false;
            createM3U                 = false;
            createCUEFileWhenEmbedded = true;
            truncate4608ExtraSamples  = true;
            decodeHDCDtoLW16          = false;
            decodeHDCDto24bit         = true;

            oneInstance     = true;
            checkForUpdates = true;

            writeBasicTagsFromCUEData = true;
            copyBasicTags             = true;
            copyUnknownTags           = true;
            CopyAlbumArt    = true;
            embedAlbumArt   = true;
            extractAlbumArt = true;
            maxAlbumArtSize = 300;

            arLogToSourceFolder = false;
            arLogVerbose        = true;
            fixOffsetToNearest  = true;
            ArLogFilenameFormat = "%filename%.accurip";
            AlArtFilenameFormat = "folder.jpg";

            separateDecodingThread = true;

            gapsHandling = CUEStyle.GapsAppended;

            advanced = new CUEConfigAdvanced();
            advanced.Init();

            language = Thread.CurrentThread.CurrentUICulture.Name;

            scripts = new Dictionary <string, CUEToolsScript>();
            scripts.Add("default", new CUEToolsScript("default",
                                                      new CUEAction[] { CUEAction.Verify, CUEAction.Encode }));
            scripts.Add("only if found", new CUEToolsScript("only if found",
                                                            new CUEAction[] { CUEAction.Verify }));
            scripts.Add("fix offset", new CUEToolsScript("fix offset",
                                                         new CUEAction[] { CUEAction.Encode }));
            scripts.Add("encode if verified", new CUEToolsScript("encode if verified",
                                                                 new CUEAction[] { CUEAction.Encode }));
            scripts.Add("repair", new CUEToolsScript("repair",
                                                     new CUEAction[] { CUEAction.Encode }));
            defaultVerifyScript = "default";
            defaultEncodeScript = "default";
        }
Example #3
0
        public CUEConfig()
        {
            fixOffsetMinimumConfidence = 2;
            fixOffsetMinimumTracksPercent = 51;
            encodeWhenConfidence = 2;
            encodeWhenPercent = 100;
            encodeWhenZeroOffset = false;
            fixOffset = false;
            noUnverifiedOutput = false;
            writeArTagsOnEncode = false;
            writeArLogOnConvert = true;
            writeArTagsOnVerify = false;
            writeArLogOnVerify = false;

            autoCorrectFilenames = true;
            preserveHTOA = true;
            detectGaps = true;
            keepOriginalFilenames = false;
            trackFilenameFormat = "%tracknumber%. %title%";
            singleFilenameFormat = "%filename%";
            removeSpecial = false;
            specialExceptions = "-()";
            replaceSpaces = false;
            embedLog = true;
            extractLog = true;
            fillUpCUE = true;
            overwriteCUEData = false;
            filenamesANSISafe = true;
            bruteForceDTL = false;
            createEACLOG = true;
            detectHDCD = true;
            wait750FramesForHDCD = true;
            decodeHDCD = false;
            createM3U = false;
            createCUEFileWhenEmbedded = true;
            truncate4608ExtraSamples = true;
            lossyWAVQuality = 5;
            decodeHDCDtoLW16 = false;
            decodeHDCDto24bit = true;

            oneInstance = true;
            checkForUpdates = true;

            writeBasicTagsFromCUEData = true;
            copyBasicTags = true;
            copyUnknownTags = true;
            CopyAlbumArt = true;
            embedAlbumArt = true;
            extractAlbumArt = true;
            maxAlbumArtSize = 300;

            arLogToSourceFolder = false;
            arLogVerbose = true;
            fixOffsetToNearest = true;
            ArLogFilenameFormat = "%filename%.accurip";
            AlArtFilenameFormat = "folder.jpg";

            separateDecodingThread = true;

            gapsHandling = CUEStyle.GapsAppended;

            advanced = new CUEConfigAdvanced();

            language = Thread.CurrentThread.CurrentUICulture.Name;

            encoders = new CUEToolsUDCList();
            foreach (Type type in CUEProcessorPlugins.encs)
                foreach (AudioEncoderClass enc in Attribute.GetCustomAttributes(type, typeof(AudioEncoderClass)))
                    encoders.Add(new CUEToolsUDC(enc, type));
            decoders = new Dictionary<string, CUEToolsUDC>();
            foreach (Type type in CUEProcessorPlugins.decs)
            {
                AudioDecoderClass dec = Attribute.GetCustomAttribute(type, typeof(AudioDecoderClass)) as AudioDecoderClass;
                decoders.Add(dec.DecoderName, new CUEToolsUDC(dec, type));
            }
            if (Type.GetType("Mono.Runtime", false) == null)
            {
                encoders.Add(new CUEToolsUDC("flake", "flac", true, "0 1 2 3 4 5 6 7 8 9 10 11 12", "8", "flake.exe", "-%M - -o %O -p %P"));
                encoders.Add(new CUEToolsUDC("takc", "tak", true, "0 1 2 2e 2m 3 3e 3m 4 4e 4m", "2", "takc.exe", "-e -p%M -overwrite - %O"));
                encoders.Add(new CUEToolsUDC("ffmpeg alac", "m4a", true, "", "", "ffmpeg.exe", "-i - -f ipod -acodec alac -y %O"));
                encoders.Add(new CUEToolsUDC("VBR (lame.exe)", "mp3", false, "V9 V8 V7 V6 V5 V4 V3 V2 V1 V0", "V2", "lame.exe", "--vbr-new -%M - %O"));
				encoders.Add(new CUEToolsUDC("CBR (lame.exe)", "mp3", false, "96 128 192 256 320", "256", "lame.exe", "-m s -q 0 -b %M --noreplaygain - %O"));
                encoders.Add(new CUEToolsUDC("oggenc", "ogg", false, "-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8", "3", "oggenc.exe", "-q %M - -o %O"));
                encoders.Add(new CUEToolsUDC("nero aac", "m4a", false, "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9", "0.4", "neroAacEnc.exe", "-q %M -if - -of %O"));
                encoders.Add(new CUEToolsUDC("qaac tvbr", "m4a", false, "10 20 30 40 50 60 70 80 90 100 110 127", "80", "qaac.exe", "-s -V %M -q 2 - -o %O"));

                decoders.Add("takc", new CUEToolsUDC("takc", "tak", true, "", "", "takc.exe", "-d %I -"));
                decoders.Add("ffmpeg alac", new CUEToolsUDC("ffmpeg alac", "m4a", true, "", "", "ffmpeg.exe", "%I -f wav -"));
            }
            else
            {
                // !!!
            }

            formats = new Dictionary<string, CUEToolsFormat>();
            formats.Add("flac", new CUEToolsFormat("flac", CUEToolsTagger.TagLibSharp, true, false, true, true, true, encoders.GetDefault("flac", true), null, GetDefaultDecoder("flac")));
            formats.Add("wv", new CUEToolsFormat("wv", CUEToolsTagger.TagLibSharp, true, false, true, true, true, encoders.GetDefault("wv", true), null, GetDefaultDecoder("wv")));
            formats.Add("ape", new CUEToolsFormat("ape", CUEToolsTagger.TagLibSharp, true, false, false, true, true, encoders.GetDefault("ape", true), null, GetDefaultDecoder("ape")));
            formats.Add("tta", new CUEToolsFormat("tta", CUEToolsTagger.APEv2, true, false, false, false, true, encoders.GetDefault("tta", true), null, GetDefaultDecoder("tta")));
            formats.Add("wav", new CUEToolsFormat("wav", CUEToolsTagger.TagLibSharp, true, false, true, false, true, encoders.GetDefault("wav", true), null, GetDefaultDecoder("wav")));
            formats.Add("m4a", new CUEToolsFormat("m4a", CUEToolsTagger.TagLibSharp, true, true, false, false, true, encoders.GetDefault("m4a", true), encoders.GetDefault("m4a", false), GetDefaultDecoder("m4a")));
            formats.Add("tak", new CUEToolsFormat("tak", CUEToolsTagger.APEv2, true, false, true, true, true, encoders.GetDefault("tak", true), null, "takc"));
            formats.Add("mp3", new CUEToolsFormat("mp3", CUEToolsTagger.TagLibSharp, false, true, false, false, true, null, encoders.GetDefault("mp3", false), null));
            formats.Add("ogg", new CUEToolsFormat("ogg", CUEToolsTagger.TagLibSharp, false, true, false, false, true, null, encoders.GetDefault("ogg", false), null));

            scripts = new Dictionary<string, CUEToolsScript>();
            scripts.Add("default", new CUEToolsScript("default", true,
                new CUEAction[] { CUEAction.Verify, CUEAction.Encode },
                "return processor.Go();"));
            scripts.Add("only if found", new CUEToolsScript("only if found", true,
                new CUEAction[] { CUEAction.Verify },
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
	return processor.WriteReport(); 
return processor.Go();"));
            scripts.Add("fix offset", new CUEToolsScript("fix offset", true,
                new CUEAction[] { CUEAction.Encode },
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
    return processor.WriteReport(); 
processor.WriteOffset = 0;
processor.Action = CUEAction.Verify;
string status = processor.Go();
uint tracksMatch;
int bestOffset;
processor.FindBestOffset(processor.Config.fixOffsetMinimumConfidence, !processor.Config.fixOffsetToNearest, out tracksMatch, out bestOffset);
if (tracksMatch * 100 < processor.Config.fixOffsetMinimumTracksPercent * processor.TrackCount)
    return status;
processor.WriteOffset = bestOffset;
processor.Action = CUEAction.Encode;
//MessageBox.Show(null, processor.AccurateRipLog, " + "\"Done\"" + @"MessageBoxButtons.OK, MessageBoxIcon.Information);
return processor.Go();
"));
            scripts.Add("encode if verified", new CUEToolsScript("encode if verified", true,
                new CUEAction[] { CUEAction.Encode },
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
    return processor.WriteReport();
processor.Action = CUEAction.Verify;
string status = processor.Go();
uint tracksMatch;
int bestOffset;
processor.FindBestOffset(processor.Config.encodeWhenConfidence, false, out tracksMatch, out bestOffset);
if (tracksMatch * 100 < processor.Config.encodeWhenPercent * processor.TrackCount || (processor.Config.encodeWhenZeroOffset && bestOffset != 0))
    return status;
processor.Action = CUEAction.Encode;
return processor.Go();
"));
            scripts.Add("repair", new CUEToolsScript("repair", true,
                new CUEAction[] { CUEAction.Encode },
@"
processor.UseCUEToolsDB();
processor.Action = CUEAction.Verify;
if (processor.CTDB.DBStatus != null)
	return CTDB.DBStatus;
processor.Go();
processor.CTDB.DoVerify();
if (!processor.CTDB.Verify.HasErrors)
	return ""nothing to fix"";
if (!processor.CTDB.Verify.CanRecover)
	return ""cannot fix"";
processor._useCUEToolsDBFix = true;
processor.Action = CUEAction.Encode;
return processor.Go();
"));
            defaultVerifyScript = "default";
            defaultEncodeScript = "default";
        }
Example #4
0
        public CUEConfig(CUEConfig src)
        {
            fixOffsetMinimumConfidence    = src.fixOffsetMinimumConfidence;
            fixOffsetMinimumTracksPercent = src.fixOffsetMinimumTracksPercent;
            encodeWhenConfidence          = src.encodeWhenConfidence;
            encodeWhenPercent             = src.encodeWhenPercent;
            encodeWhenZeroOffset          = src.encodeWhenZeroOffset;
            fixOffset           = src.fixOffset;
            noUnverifiedOutput  = src.noUnverifiedOutput;
            writeArTagsOnEncode = src.writeArTagsOnEncode;
            writeArLogOnConvert = src.writeArLogOnConvert;
            writeArTagsOnVerify = src.writeArTagsOnVerify;
            writeArLogOnVerify  = src.writeArLogOnVerify;

            autoCorrectFilenames  = src.autoCorrectFilenames;
            preserveHTOA          = src.preserveHTOA;
            detectGaps            = src.detectGaps;
            keepOriginalFilenames = src.keepOriginalFilenames;
            trackFilenameFormat   = src.trackFilenameFormat;
            singleFilenameFormat  = src.singleFilenameFormat;
            removeSpecial         = src.removeSpecial;
            specialExceptions     = src.specialExceptions;
            replaceSpaces         = src.replaceSpaces;
            embedLog                  = src.embedLog;
            extractLog                = src.extractLog;
            fillUpCUE                 = src.fillUpCUE;
            overwriteCUEData          = src.overwriteCUEData;
            filenamesANSISafe         = src.filenamesANSISafe;
            bruteForceDTL             = src.bruteForceDTL;
            createEACLOG              = src.createEACLOG;
            detectHDCD                = src.detectHDCD;
            wait750FramesForHDCD      = src.wait750FramesForHDCD;
            decodeHDCD                = src.decodeHDCD;
            createM3U                 = src.createM3U;
            createCUEFileWhenEmbedded = src.createCUEFileWhenEmbedded;
            truncate4608ExtraSamples  = src.truncate4608ExtraSamples;
            decodeHDCDtoLW16          = src.decodeHDCDtoLW16;
            decodeHDCDto24bit         = src.decodeHDCDto24bit;

            oneInstance     = src.oneInstance;
            checkForUpdates = src.checkForUpdates;

            writeBasicTagsFromCUEData = src.writeBasicTagsFromCUEData;
            copyBasicTags             = src.copyBasicTags;
            copyUnknownTags           = src.copyUnknownTags;
            CopyAlbumArt    = src.CopyAlbumArt;
            embedAlbumArt   = src.embedAlbumArt;
            extractAlbumArt = src.extractAlbumArt;
            maxAlbumArtSize = src.maxAlbumArtSize;

            arLogToSourceFolder = src.arLogToSourceFolder;
            arLogVerbose        = src.arLogVerbose;
            fixOffsetToNearest  = src.fixOffsetToNearest;
            ArLogFilenameFormat = src.ArLogFilenameFormat;
            AlArtFilenameFormat = src.AlArtFilenameFormat;

            separateDecodingThread = src.separateDecodingThread;

            gapsHandling = src.gapsHandling;

            advanced = new CUEConfigAdvanced(src.advanced);

            language = src.language;

            scripts = new Dictionary <string, CUEToolsScript>();
            scripts.Add("default", new CUEToolsScript("default",
                                                      new CUEAction[] { CUEAction.Verify, CUEAction.Encode }));
            scripts.Add("only if found", new CUEToolsScript("only if found",
                                                            new CUEAction[] { CUEAction.Verify }));
            scripts.Add("fix offset", new CUEToolsScript("fix offset",
                                                         new CUEAction[] { CUEAction.Encode }));
            scripts.Add("encode if verified", new CUEToolsScript("encode if verified",
                                                                 new CUEAction[] { CUEAction.Encode }));
            scripts.Add("repair", new CUEToolsScript("repair",
                                                     new CUEAction[] { CUEAction.Encode }));

            defaultVerifyScript = src.defaultVerifyScript;
            defaultEncodeScript = src.defaultEncodeScript;
        }