Configurable padding size for FLACCL

This commit is contained in:
Grigory Chudov
2013-02-24 19:55:45 -05:00
parent 1ba392dc7d
commit 0f9f8d08a3
4 changed files with 36 additions and 3 deletions

View File

@@ -103,6 +103,23 @@ namespace CUETools.Codecs.FLACCL
cpu_threads = value; cpu_threads = value;
} }
} }
int padding = 8192;
[DefaultValue(8192)]
[SRDescription(typeof(Properties.Resources), "DescriptionPadding")]
public int Padding
{
get
{
return padding;
}
set
{
if (value < 0 || value > 1024*1024)
throw new Exception("Padding must be between 0..1MB");
padding = value;
}
}
} }
public class FLACCLWriterSettingsPlatformConverter : TypeConverter public class FLACCLWriterSettingsPlatformConverter : TypeConverter
@@ -230,7 +247,7 @@ namespace CUETools.Codecs.FLACCL
_IO = IO; _IO = IO;
eparams.flake_set_defaults(_compressionLevel); eparams.flake_set_defaults(_compressionLevel);
eparams.padding_size = 8192; eparams.padding_size = _settings.Padding;
crc8 = new Crc8(); crc8 = new Crc8();
crc16 = new Crc16(); crc16 = new Crc16();
@@ -289,7 +306,8 @@ namespace CUETools.Codecs.FLACCL
if (value as FLACCLWriterSettings == null) if (value as FLACCLWriterSettings == null)
throw new Exception("Unsupported options " + value); throw new Exception("Unsupported options " + value);
_settings = value as FLACCLWriterSettings; _settings = value as FLACCLWriterSettings;
} eparams.padding_size = _settings.Padding;
}
} }
//[DllImport("kernel32.dll")] //[DllImport("kernel32.dll")]

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.239 // Runtime Version:4.0.30319.18033
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@@ -123,6 +123,15 @@ namespace CUETools.Codecs.FLACCL.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Number of bytes to reserve for metadata.
/// </summary>
internal static string DescriptionPadding {
get {
return ResourceManager.GetString("DescriptionPadding", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to OpenCL platform to use. /// Looks up a localized string similar to OpenCL platform to use.
/// </summary> /// </summary>

View File

@@ -138,6 +138,9 @@
<data name="DescriptionMappedMemory" xml:space="preserve"> <data name="DescriptionMappedMemory" xml:space="preserve">
<value>Device uses host memory (Don't use)</value> <value>Device uses host memory (Don't use)</value>
</data> </data>
<data name="DescriptionPadding" xml:space="preserve">
<value>Number of bytes to reserve for metadata</value>
</data>
<data name="DescriptionPlatform" xml:space="preserve"> <data name="DescriptionPlatform" xml:space="preserve">
<value>OpenCL platform to use</value> <value>OpenCL platform to use</value>
</data> </data>

View File

@@ -123,6 +123,9 @@
<data name="DescriptionGPUOnly" xml:space="preserve"> <data name="DescriptionGPUOnly" xml:space="preserve">
<value>Использовать GPU на всех стадиях</value> <value>Использовать GPU на всех стадиях</value>
</data> </data>
<data name="DescriptionPadding" xml:space="preserve">
<value>Количество байт резервируемое для тэгов</value>
</data>
<data name="DoMD5Description" xml:space="preserve"> <data name="DoMD5Description" xml:space="preserve">
<value>Вычислять MD5-хеш аудиопотока</value> <value>Вычислять MD5-хеш аудиопотока</value>
</data> </data>