diff options
Diffstat (limited to 'src/metadata/aac')
-rw-r--r-- | src/metadata/aac/Makefile.am | 12 | ||||
-rw-r--r-- | src/metadata/aac/aacfiletyperesolver.cpp | 38 | ||||
-rw-r--r-- | src/metadata/aac/aacfiletyperesolver.h | 36 |
3 files changed, 86 insertions, 0 deletions
diff --git a/src/metadata/aac/Makefile.am b/src/metadata/aac/Makefile.am new file mode 100644 index 0000000..b6b0f43 --- /dev/null +++ b/src/metadata/aac/Makefile.am @@ -0,0 +1,12 @@ +SUBDIRS = +METASOURCES = AUTO +INCLUDES = $(all_includes) $(taglib_includes) + +libtagaac_la_LDFLAGS = $(all_libraries) +noinst_LTLIBRARIES = libtagaac.la + +libtagaac_la_SOURCES = \ + aacfiletyperesolver.cpp + +noinst_HEADERS = \ + aacfiletyperesolver.h diff --git a/src/metadata/aac/aacfiletyperesolver.cpp b/src/metadata/aac/aacfiletyperesolver.cpp new file mode 100644 index 0000000..fcc2a86 --- /dev/null +++ b/src/metadata/aac/aacfiletyperesolver.cpp @@ -0,0 +1,38 @@ +/*************************************************************************** + copyright : (C) 2006 by Martin Aumueller + email : aumuell@reserv.at + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#include "aacfiletyperesolver.h" +#include <taglib/mpegfile.h> + +#include <string.h> + +TagLib::File *AACFileTypeResolver::createFile(const char *fileName, + bool readProperties, + TagLib::AudioProperties::ReadStyle propertiesStyle) const +{ + const char *ext = strrchr(fileName, '.'); + if(ext && !strcasecmp(ext, ".aac")) + { + return new TagLib::MPEG::File(fileName, readProperties, propertiesStyle); + } + + return 0; +} diff --git a/src/metadata/aac/aacfiletyperesolver.h b/src/metadata/aac/aacfiletyperesolver.h new file mode 100644 index 0000000..6c33b71 --- /dev/null +++ b/src/metadata/aac/aacfiletyperesolver.h @@ -0,0 +1,36 @@ +/*************************************************************************** + copyright : (C) 2006 by Martin Aumueller + email : aumuell@reserv.at + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_AACFILETYPERESOLVER_H +#define TAGLIB_AACFILETYPERESOLVER_H + +#include <taglib/tfile.h> +#include <taglib/fileref.h> + + +class AACFileTypeResolver : public TagLib::FileRef::FileTypeResolver +{ + TagLib::File *createFile(const char *fileName, + bool readAudioProperties, + TagLib::AudioProperties::ReadStyle audioPropertiesStyle) const; +}; + +#endif |