OSDN Git Service

Updated Monkey's Audio binary to v4.11 (2013-01-20), including STDERR flush fix.
[lamexp/LameXP.git] / src / Encoder_Abstract.cpp
index 791dcd6..cf6cb27 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -38,14 +38,34 @@ AbstractEncoder::~AbstractEncoder(void)
  * Setters
  */
 
-void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = max(0, bitrate); }
-void AbstractEncoder::setRCMode(int mode) { m_configRCMode = max(0, mode); }
+void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = qMax(0, bitrate); }
+void AbstractEncoder::setRCMode(int mode) { m_configRCMode = qMax(0, mode); }
 void AbstractEncoder::setCustomParams(const QString &customParams) { m_configCustomParams = customParams; }
 
 /*
  * Default implementation
  */
-bool AbstractEncoder::requiresDownmix(void)
+
+// Does encoder require the input to be downmixed to stereo?
+const unsigned int *AbstractEncoder::supportedChannelCount(void)
+{
+       return NULL;
+}
+
+// Does encoder require the input to be downsampled? (NULL-terminated array of supported sampling rates)
+const unsigned int *AbstractEncoder::supportedSamplerates(void)
+{
+       return NULL;
+}
+
+// What bitdepths does the encoder support as input? (NULL-terminated array of supported bits per sample)
+const unsigned int *AbstractEncoder::supportedBitdepths(void)
+{
+       return NULL;
+}
+
+//Does the encoder need the exact duration of the source?
+const bool AbstractEncoder::needsTimingInfo(void)
 {
        return false;
 }
@@ -53,8 +73,19 @@ bool AbstractEncoder::requiresDownmix(void)
 /*
  * Helper functions
  */
+
+//Does this text contain Non-ASCII characters?
 bool AbstractEncoder::isUnicode(const QString &original)
 {
        QString asLatin1 = QString::fromLatin1(original.toLatin1().constData());
        return (wcscmp(QWCHAR(original), QWCHAR(asLatin1)) != 0);
 }
+
+//Remove "problematic" characters from tag
+QString AbstractEncoder::cleanTag(const QString &text)
+{
+       QString result(text);
+       result.replace(QChar('"'), "'");
+       result.replace(QChar('\\'), "/");
+       return result;
+}