OSDN Git Service

Happy new year 2016!
[lamexp/LameXP.git] / src / Decoder_Wave.cpp
index 1a61c71..0e1ff5a 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2016 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
@@ -68,6 +68,22 @@ bool WaveDecoder::decode(const QString &sourceFile, const QString &outputFile, v
        return okay;
 }
 
+bool WaveDecoder::progressHandler(const double &progress, void *const data)
+{
+       if(data)
+       {
+               //qWarning("Copy progress: %.2f", progress);
+               reinterpret_cast<ProgressData*>(data)->instance->updateProgress(progress);
+               return (!(*reinterpret_cast<ProgressData*>(data)->abrtFlag));
+       }
+       return true;
+}
+
+void WaveDecoder::updateProgress(const double &progress)
+{
+       emit statusUpdated(qBound(0, qRound(progress * 100.0), 100));
+}
+
 bool WaveDecoder::isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion)
 {
        if(containerType.compare("Wave", Qt::CaseInsensitive) == 0)
@@ -81,23 +97,18 @@ bool WaveDecoder::isFormatSupported(const QString &containerType, const QString
        return false;
 }
 
-QStringList WaveDecoder::supportedTypes(void)
+const AbstractDecoder::supportedType_t *WaveDecoder::supportedTypes(void)
 {
-       return QStringList() << "Waveform Audio File (*.wav)";
-}
+       static const char *exts[] =
+       {
+               "wav", NULL
+       };
 
-bool WaveDecoder::progressHandler(const double &progress, void *const data)
-{
-       if(data)
+       static const supportedType_t s_supportedTypes[] =
        {
-               //qWarning("Copy progress: %.2f", progress);
-               reinterpret_cast<ProgressData*>(data)->instance->updateProgress(progress);
-               return (!(*reinterpret_cast<ProgressData*>(data)->abrtFlag));
-       }
-       return true;
-}
+               { "Waveform Audio File", exts },
+               { NULL, NULL }
+       };
 
-void WaveDecoder::updateProgress(const double &progress)
-{
-       emit statusUpdated(qBound(0, qRound(progress * 100.0), 100));
+       return s_supportedTypes;
 }