OSDN Git Service

Implemented file extension replacement model + moved extension() function from Abstra...
[lamexp/LameXP.git] / src / Encoder_FLAC.cpp
index 6a594dd..29255ec 100644 (file)
@@ -1,11 +1,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2015 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
 // the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
+// (at your option) any later version, but always including the *additional*
+// restrictions defined in the "License.txt" file.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -46,7 +47,7 @@ public:
                        return false;
                        break;
                default:
-                       THROW("Bad RC mode specified!");
+                       MUTILS_THROW("Bad RC mode specified!");
                }
        }
 
@@ -62,7 +63,7 @@ public:
                        return 0;
                        break;
                default:
-                       THROW("Bad RC mode specified!");
+                       MUTILS_THROW("Bad RC mode specified!");
                }
        }
 
@@ -78,7 +79,7 @@ public:
                        return -1;
                        break;
                default:
-                       THROW("Bad RC mode specified!");
+                       MUTILS_THROW("Bad RC mode specified!");
                }
        }
 
@@ -93,7 +94,7 @@ public:
                case SettingsModel::CBRMode:
                        return -1;
                default:
-                       THROW("Bad RC mode specified!");
+                       MUTILS_THROW("Bad RC mode specified!");
                }
        }
 
@@ -102,6 +103,12 @@ public:
                static const char* s_description = "Free Lossless Audio Codec (FLAC)";
                return s_description;
        }
+
+       virtual const char *extension(void) const
+       {
+               static const char* s_extension = "flac";
+               return s_extension;
+       }
 }
 static const g_flacEncoderInfo;
 
@@ -111,11 +118,11 @@ static const g_flacEncoderInfo;
 
 FLACEncoder::FLACEncoder(void)
 :
-       m_binary(lamexp_lookup_tool("flac.exe"))
+       m_binary(lamexp_tools_lookup("flac.exe"))
 {
        if(m_binary.isEmpty())
        {
-               THROW("Error initializing FLAC encoder. Tool 'flac.exe' is not registred!");
+               MUTILS_THROW("Error initializing FLAC encoder. Tool 'flac.exe' is not registred!");
        }
 }
 
@@ -215,11 +222,6 @@ bool FLACEncoder::encode(const QString &sourceFile, const AudioFileModel_MetaInf
        return true;
 }
 
-QString FLACEncoder::extension(void)
-{
-       return "flac";
-}
-
 bool FLACEncoder::isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion)
 {
        if(containerType.compare("Wave", Qt::CaseInsensitive) == 0)