mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Code cleanup; Reader classes renamed to Decoders, Writers to Encoders, every Decoder must have a corresponding Settings class now just like Encoders. UserDefinedEncoders renamed to CommandLineEncoders, etc.
This commit is contained in:
@@ -2,26 +2,35 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CUETools.Codecs.LAME
|
||||
{
|
||||
public class LameWriterCBRSettings : LameWriterSettings
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class CBREncoderSettings : LameEncoderSettings
|
||||
{
|
||||
public override string Extension => "mp3";
|
||||
|
||||
public override string Name => "libmp3lame-CBR";
|
||||
|
||||
public override int Priority => 1;
|
||||
|
||||
public static readonly int[] bps_table = new int[] { 96, 128, 192, 256, 320 };
|
||||
|
||||
[JsonProperty]
|
||||
[DefaultValue(LameQuality.High)]
|
||||
public LameQuality Quality { get; set; }
|
||||
|
||||
public LameWriterCBRSettings()
|
||||
public CBREncoderSettings()
|
||||
: base("96 128 192 256 320", "256")
|
||||
{
|
||||
}
|
||||
|
||||
public override void Apply(IntPtr lame)
|
||||
{
|
||||
LameWriter.lame_set_VBR(lame, (int)LameVbrMode.Off);
|
||||
LameWriter.lame_set_brate(lame, LameWriterCBRSettings.bps_table[this.EncoderModeIndex]);
|
||||
LameWriter.lame_set_quality(lame, (int)this.Quality);
|
||||
AudioEncoder.lame_set_VBR(lame, (int)LameVbrMode.Off);
|
||||
AudioEncoder.lame_set_brate(lame, CBREncoderSettings.bps_table[this.EncoderModeIndex]);
|
||||
AudioEncoder.lame_set_quality(lame, (int)this.Quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user