mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
CUETools: fix profiles
This commit is contained in:
@@ -15,6 +15,19 @@ namespace CUETools.Codecs
|
|||||||
public CUEToolsUDCList encoders;
|
public CUEToolsUDCList encoders;
|
||||||
public CUEToolsUDCList decoders;
|
public CUEToolsUDCList decoders;
|
||||||
|
|
||||||
|
public CUEToolsCodecsConfig(CUEToolsCodecsConfig src)
|
||||||
|
{
|
||||||
|
encoders = new CUEToolsUDCList(true);
|
||||||
|
foreach (var enc in src.encoders)
|
||||||
|
encoders.Add(enc.Clone());
|
||||||
|
decoders = new CUEToolsUDCList(false);
|
||||||
|
foreach (var dec in src.decoders)
|
||||||
|
decoders.Add(dec.Clone());
|
||||||
|
formats = new Dictionary<string, CUEToolsFormat>();
|
||||||
|
foreach (var fmt in src.formats)
|
||||||
|
formats.Add(fmt.Key, fmt.Value.Clone(this));
|
||||||
|
}
|
||||||
|
|
||||||
public CUEToolsCodecsConfig(List<Type> encs, List<Type> decs)
|
public CUEToolsCodecsConfig(List<Type> encs, List<Type> decs)
|
||||||
{
|
{
|
||||||
encoders = new CUEToolsUDCList(true);
|
encoders = new CUEToolsUDCList(true);
|
||||||
|
|||||||
@@ -30,10 +30,21 @@
|
|||||||
return "." + extension;
|
return "." + extension;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CUEToolsFormat Clone(CUEToolsCodecsConfig cfg)
|
||||||
|
{
|
||||||
|
var res = this.MemberwiseClone() as CUEToolsFormat;
|
||||||
|
if (decoder != null) cfg.decoders.TryGetValue(decoder.extension, decoder.lossless, decoder.name, out res.decoder);
|
||||||
|
if (encoderLossy != null) cfg.encoders.TryGetValue(encoderLossy.extension, encoderLossy.lossless, encoderLossy.name, out res.encoderLossy);
|
||||||
|
if (encoderLossless != null) cfg.encoders.TryGetValue(encoderLossless.extension, encoderLossless.lossless, encoderLossless.name, out res.encoderLossless);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string extension;
|
public string extension;
|
||||||
public CUEToolsUDC encoderLossless;
|
public CUEToolsUDC encoderLossless;
|
||||||
public CUEToolsUDC encoderLossy;
|
public CUEToolsUDC encoderLossy;
|
||||||
|
|||||||
@@ -81,6 +81,13 @@ namespace CUETools.Codecs
|
|||||||
type = dectype;
|
type = dectype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CUEToolsUDC Clone()
|
||||||
|
{
|
||||||
|
var res = this.MemberwiseClone() as CUEToolsUDC;
|
||||||
|
if (settings != null) res.settings = settings.Clone();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@@ -162,6 +162,87 @@ namespace CUETools.Processor
|
|||||||
defaultEncodeScript = "default";
|
defaultEncodeScript = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CUEConfig(CUEConfig src)
|
||||||
|
: base(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;
|
||||||
|
}
|
||||||
|
|
||||||
public void Save(SettingsWriter sw)
|
public void Save(SettingsWriter sw)
|
||||||
{
|
{
|
||||||
sw.Save("Version", 204);
|
sw.Save("Version", 204);
|
||||||
|
|||||||
@@ -30,6 +30,15 @@ namespace CUETools.Processor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CUEConfigAdvanced(CUEConfigAdvanced src)
|
||||||
|
{
|
||||||
|
// Iterate through each property and call SetValue()
|
||||||
|
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
|
||||||
|
{
|
||||||
|
property.SetValue(this, property.GetValue(src));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static XmlSerializer serializer = new XmlSerializer(typeof(CUEConfigAdvanced));
|
internal static XmlSerializer serializer = new XmlSerializer(typeof(CUEConfigAdvanced));
|
||||||
[DefaultValue("i"), Category("Freedb"), DisplayName("Email user")]
|
[DefaultValue("i"), Category("Freedb"), DisplayName("Email user")]
|
||||||
public string FreedbUser { get; set; }
|
public string FreedbUser { get; set; }
|
||||||
|
|||||||
@@ -24,6 +24,14 @@ namespace CUETools.Processor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CUEToolsProfile Clone(string name)
|
||||||
|
{
|
||||||
|
var res = this.MemberwiseClone() as CUEToolsProfile;
|
||||||
|
res._config = new CUEConfig(_config);
|
||||||
|
res._name = string.Copy(name);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public void Load(SettingsReader sr)
|
public void Load(SettingsReader sr)
|
||||||
{
|
{
|
||||||
_config.Load(sr);
|
_config.Load(sr);
|
||||||
|
|||||||
@@ -1360,10 +1360,6 @@ namespace JDP
|
|||||||
_profile = new CUEToolsProfile(profileName);
|
_profile = new CUEToolsProfile(profileName);
|
||||||
SettingsReader sr = new SettingsReader("CUE Tools", string.Format("profile-{0}.txt", _profile._name), Application.ExecutablePath);
|
SettingsReader sr = new SettingsReader("CUE Tools", string.Format("profile-{0}.txt", _profile._name), Application.ExecutablePath);
|
||||||
_profile.Load(sr);
|
_profile.Load(sr);
|
||||||
_profile._config.encoders = _defaultProfile._config.encoders;
|
|
||||||
_profile._config.decoders = _defaultProfile._config.decoders;
|
|
||||||
_profile._config.formats = _defaultProfile._config.formats;
|
|
||||||
_profile._config.scripts = _defaultProfile._config.scripts;
|
|
||||||
ActivateProfile();
|
ActivateProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1373,10 +1369,6 @@ namespace JDP
|
|||||||
|
|
||||||
if (_profile != _defaultProfile)
|
if (_profile != _defaultProfile)
|
||||||
{
|
{
|
||||||
_defaultProfile._config.encoders = _profile._config.encoders;
|
|
||||||
_defaultProfile._config.decoders = _profile._config.decoders;
|
|
||||||
_defaultProfile._config.formats = _profile._config.formats;
|
|
||||||
_defaultProfile._config.scripts = _profile._config.scripts;
|
|
||||||
_profile = _defaultProfile;
|
_profile = _defaultProfile;
|
||||||
ActivateProfile();
|
ActivateProfile();
|
||||||
}
|
}
|
||||||
@@ -2551,8 +2543,9 @@ namespace JDP
|
|||||||
e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
|
|
||||||
string profileName = item.Text;
|
string profileName = item.Text;
|
||||||
DeactivateProfile();
|
SaveProfile();
|
||||||
_profile = new CUEToolsProfile(profileName);
|
//DeactivateProfile();
|
||||||
|
_profile = _profile.Clone(profileName);
|
||||||
ActivateProfile();
|
ActivateProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user