1
/***************************************************************************
2
* This library is free software; you can redistribute it and/or modify *
3
* it under the terms of the GNU Lesser General Public License version *
4
* 2.1 as published by the Free Software Foundation. *
6
* This library is distributed in the hope that it will be useful, but *
7
* WITHOUT ANY WARRANTY; without even the implied warranty of *
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
9
* Lesser General Public License for more details. *
11
* You should have received a copy of the GNU Lesser General Public *
12
* License along with this library; if not, write to the Free Software *
13
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
15
***************************************************************************/
17
#if defined __GNUC__ && (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
18
/** Defined if GCC is used and supports diagnostic pragmas */
19
#define GCC_HAS_DIAGNOSTIC_PRAGMA
22
#ifdef GCC_HAS_DIAGNOSTIC_PRAGMA
23
#pragma GCC diagnostic push
24
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
27
#include "mp2filetyperesolver.h"
31
#if (((TAGLIB_MAJOR_VERSION) << 16) + ((TAGLIB_MINOR_VERSION) << 8) + (TAGLIB_PATCH_VERSION)) > 0x010400 && defined _WIN32
33
TagLib::File *MP2FileTypeResolver::createFile(TagLib::FileName fileName,
35
TagLib::AudioProperties::ReadStyle propertiesStyle) const
37
const wchar_t* wstr = static_cast<const wchar_t*>(fileName);
38
const char* str = static_cast<const char*>(fileName);
41
if ((wstr && (wext = wcsrchr(fileName, L'.')) != 0 && !wcsicmp(wext, L".mp2")) ||
42
(str && (ext = strrchr(fileName, '.')) != 0 && !stricmp(ext, ".mp2")))
44
return new TagLib::MPEG::File(fileName, readProperties, propertiesStyle);
52
TagLib::File *MP2FileTypeResolver::createFile(const char *fileName,
54
TagLib::AudioProperties::ReadStyle propertiesStyle) const
56
const char *ext = strrchr(fileName, '.');
57
if(ext && !strcasecmp(ext, ".mp2"))
59
return new TagLib::MPEG::File(fileName, readProperties, propertiesStyle);
67
#ifdef GCC_HAS_DIAGNOSTIC_PRAGMA
68
#pragma GCC diagnostic pop