+static const int g_lameAgorithmQualityLUT[5] = {7, 5, 2, 0, INT_MAX};
+static const int g_mp3BitrateLUT[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1};
+static const int g_lameVBRQualityLUT[11] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0, INT_MAX};
+
+///////////////////////////////////////////////////////////////////////////////
+// Encoder Info
+///////////////////////////////////////////////////////////////////////////////
+
+class MP3EncoderInfo : public AbstractEncoderInfo
+{
+ virtual bool isModeSupported(int mode) const
+ {
+ switch(mode)
+ {
+ case SettingsModel::VBRMode:
+ case SettingsModel::ABRMode:
+ case SettingsModel::CBRMode:
+ return true;
+ break;
+ default:
+ MUTILS_THROW("Bad RC mode specified!");
+ }
+ }
+
+ virtual int valueCount(int mode) const
+ {
+ switch(mode)
+ {
+ case SettingsModel::VBRMode:
+ return 10;
+ break;
+ case SettingsModel::ABRMode:
+ case SettingsModel::CBRMode:
+ return 14;
+ break;
+ default:
+ MUTILS_THROW("Bad RC mode specified!");
+ }
+ }
+
+ virtual int valueAt(int mode, int index) const
+ {
+ switch(mode)
+ {
+ case SettingsModel::VBRMode:
+ return g_lameVBRQualityLUT[qBound(0, index, 9)];
+ break;
+ case SettingsModel::ABRMode:
+ case SettingsModel::CBRMode:
+ return g_mp3BitrateLUT[qBound(0, index, 13)];
+ break;
+ default:
+ MUTILS_THROW("Bad RC mode specified!");
+ }
+ }
+
+ virtual int valueType(int mode) const
+ {
+ switch(mode)
+ {
+ case SettingsModel::VBRMode:
+ return TYPE_QUALITY_LEVEL_INT;
+ break;
+ case SettingsModel::ABRMode:
+ return TYPE_APPROX_BITRATE;
+ break;
+ case SettingsModel::CBRMode:
+ return TYPE_BITRATE;
+ break;
+ default:
+ MUTILS_THROW("Bad RC mode specified!");
+ }
+ }
+
+ virtual const char *description(void) const
+ {
+ static const char* s_description = "LAME MP3 Encoder";
+ return s_description;
+ }
+
+ virtual const char *extension(void) const
+ {
+ static const char* s_extension = "mp3";
+ return s_extension;
+ }
+}
+static const g_mp3EncoderInfo;
+
+///////////////////////////////////////////////////////////////////////////////
+// Encoder implementation
+///////////////////////////////////////////////////////////////////////////////