mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Allow encoders of different formats to share the same name; Rename "libALAC", "libFlake" and "builtin wav" encoders to "cuetools"
This commit is contained in:
@@ -13,20 +13,14 @@ namespace CUETools.Processor
|
||||
|
||||
private void OnAddingNew(object sender, AddingNewEventArgs e)
|
||||
{
|
||||
string name = "new";
|
||||
CUEToolsUDC temp;
|
||||
while (TryGetValue(name, out temp))
|
||||
{
|
||||
name += "(1)";
|
||||
}
|
||||
e.NewObject = new CUEToolsUDC(name, "wav", true, "", "", "", "");
|
||||
e.NewObject = new CUEToolsUDC("new", "wav", true, "", "", "", "");
|
||||
}
|
||||
|
||||
public bool TryGetValue(string name, out CUEToolsUDC result)
|
||||
public bool TryGetValue(string extension, bool lossless, string name, out CUEToolsUDC result)
|
||||
{
|
||||
foreach (CUEToolsUDC udc in this)
|
||||
{
|
||||
if (udc.name == name)
|
||||
if (udc.extension == extension && udc.lossless == lossless && udc.name == name)
|
||||
{
|
||||
result = udc;
|
||||
return true;
|
||||
@@ -48,18 +42,5 @@ namespace CUETools.Processor
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public CUEToolsUDC this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
CUEToolsUDC udc;
|
||||
if (!TryGetValue(name, out udc))
|
||||
{
|
||||
throw new Exception("CUEToolsUDCList: member not found");
|
||||
}
|
||||
return udc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user