summaryrefslogtreecommitdiffstats
path: root/src/metadata/optimfrog
diff options
context:
space:
mode:
Diffstat (limited to 'src/metadata/optimfrog')
-rwxr-xr-xsrc/metadata/optimfrog/Makefile.am6
-rwxr-xr-xsrc/metadata/optimfrog/taglib_optimfrogfiletyperesolver.cpp21
-rwxr-xr-xsrc/metadata/optimfrog/taglib_optimfrogfiletyperesolver.h19
3 files changed, 46 insertions, 0 deletions
diff --git a/src/metadata/optimfrog/Makefile.am b/src/metadata/optimfrog/Makefile.am
new file mode 100755
index 0000000..f2b7e6b
--- /dev/null
+++ b/src/metadata/optimfrog/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES = $(all_includes) $(taglib_includes)
+METASOURCES = AUTO
+libtagoptimfrog_la_LDFLAGS = $(all_libraries)
+noinst_LTLIBRARIES = libtagoptimfrog.la
+noinst_HEADERS = taglib_optimfrogfiletyperesolver.h
+libtagoptimfrog_la_SOURCES = taglib_optimfrogfiletyperesolver.cpp
diff --git a/src/metadata/optimfrog/taglib_optimfrogfiletyperesolver.cpp b/src/metadata/optimfrog/taglib_optimfrogfiletyperesolver.cpp
new file mode 100755
index 0000000..13cde6a
--- /dev/null
+++ b/src/metadata/optimfrog/taglib_optimfrogfiletyperesolver.cpp
@@ -0,0 +1,21 @@
+// (c) 2006 Martin Aumueller <[email protected]>
+// modified 2006 Daniel Faust <[email protected]>
+// See COPYING file for licensing information
+
+#include "taglib_optimfrogfiletyperesolver.h"
+#include <taglib/mpcfile.h>
+
+#include <string.h>
+
+TagLib::File *OptimFrogFileTypeResolver::createFile(const char *fileName,
+ bool readProperties,
+ TagLib::AudioProperties::ReadStyle propertiesStyle) const
+{
+ const char *ext = strrchr(fileName, '.');
+ if(ext && !strcasecmp(ext, ".ofr"))
+ {
+ return new TagLib::MPC::File(fileName, readProperties, propertiesStyle);
+ }
+
+ return 0;
+}
diff --git a/src/metadata/optimfrog/taglib_optimfrogfiletyperesolver.h b/src/metadata/optimfrog/taglib_optimfrogfiletyperesolver.h
new file mode 100755
index 0000000..b277ed5
--- /dev/null
+++ b/src/metadata/optimfrog/taglib_optimfrogfiletyperesolver.h
@@ -0,0 +1,19 @@
+// (c) 2006 Martin Aumueller <[email protected]>
+// modified 2006 Daniel Faust <[email protected]>
+// See COPYING file for licensing information
+
+#ifndef TAGLIB_OPTIMFROGFILETYPERESOLVER_H
+#define TAGLIB_OPTIMFROGFILETYPERESOLVER_H
+
+#include <taglib/tfile.h>
+#include <taglib/fileref.h>
+
+
+class OptimFrogFileTypeResolver : public TagLib::FileRef::FileTypeResolver
+{
+ TagLib::File *createFile(const char *fileName,
+ bool readAudioProperties,
+ TagLib::AudioProperties::ReadStyle audioPropertiesStyle) const;
+};
+
+#endif