From dd846904cbc1ef3ee628d77f0c9df88ef8967816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Fri, 24 Jun 2011 08:49:50 +0200 Subject: Remove the options to disable MP4/ASF support --- CMakeLists.txt | 2 -- bindings/c/tag_c.cpp | 4 ---- taglib/CMakeLists.txt | 37 ++++++++++++------------------------- taglib/asf/asfattribute.cpp | 3 --- taglib/asf/asffile.cpp | 3 --- taglib/asf/asfpicture.cpp | 3 --- taglib/asf/asfproperties.cpp | 3 --- taglib/asf/asftag.cpp | 3 --- taglib/fileref.cpp | 8 -------- taglib/mp4/mp4atom.cpp | 3 --- taglib/mp4/mp4coverart.cpp | 3 --- taglib/mp4/mp4file.cpp | 3 --- taglib/mp4/mp4item.cpp | 3 --- taglib/mp4/mp4properties.cpp | 3 --- taglib/mp4/mp4tag.cpp | 3 --- taglib/taglib_config.h.cmake | 4 ++-- tests/CMakeLists.txt | 15 ++++----------- tests/test_fileref.cpp | 8 -------- 18 files changed, 18 insertions(+), 93 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ea4d19a..5e05bad9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,6 @@ option(BUILD_TESTS "Build the test suite" OFF) option(BUILD_EXAMPLES "Build the examples" OFF) option(NO_ITUNES_HACKS "Disable workarounds for iTunes bugs" OFF) -option(WITH_ASF "Enable ASF tag reading/writing code" ON) -option(WITH_MP4 "Enable MP4 tag reading/writing code" ON) add_definitions(-DHAVE_CONFIG_H) set(TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests/") diff --git a/bindings/c/tag_c.cpp b/bindings/c/tag_c.cpp index 18a7861c..f30e8731 100644 --- a/bindings/c/tag_c.cpp +++ b/bindings/c/tag_c.cpp @@ -86,14 +86,10 @@ TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type) return reinterpret_cast(new Ogg::Speex::File(filename)); case TagLib_File_TrueAudio: return reinterpret_cast(new TrueAudio::File(filename)); -#ifdef TAGLIB_WITH_MP4 case TagLib_File_MP4: return reinterpret_cast(new MP4::File(filename)); -#endif -#ifdef TAGLIB_WITH_ASF case TagLib_File_ASF: return reinterpret_cast(new ASF::File(filename)); -#endif default: return 0; } diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt index 0bb01d08..e3ebb5ab 100644 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -97,26 +97,18 @@ set(tag_HDRS riff/aiff/aiffproperties.h riff/wav/wavfile.h riff/wav/wavproperties.h + asf/asffile.h + asf/asfproperties.h + asf/asftag.h + asf/asfattribute.h + asf/asfpicture.h + mp4/mp4file.h + mp4/mp4atom.h + mp4/mp4tag.h + mp4/mp4item.h + mp4/mp4properties.h + mp4/mp4coverart.h ) -if(WITH_ASF) - set(tag_HDRS ${tag_HDRS} - asf/asffile.h - asf/asfproperties.h - asf/asftag.h - asf/asfattribute.h - asf/asfpicture.h - ) -endif() -if(WITH_MP4) - set(tag_HDRS ${tag_HDRS} - mp4/mp4file.h - mp4/mp4atom.h - mp4/mp4tag.h - mp4/mp4item.h - mp4/mp4properties.h - mp4/mp4coverart.h - ) -endif() set(mpeg_SRCS mpeg/mpegfile.cpp @@ -254,17 +246,12 @@ set(tag_LIB_SRCS ${mpeg_SRCS} ${id3v1_SRCS} ${id3v2_SRCS} ${frames_SRCS} ${ogg_SRCS} ${vorbis_SRCS} ${oggflacs_SRCS} ${mpc_SRCS} ${ape_SRCS} ${toolkit_SRCS} ${flacs_SRCS} ${wavpack_SRCS} ${speex_SRCS} ${trueaudio_SRCS} ${riff_SRCS} ${aiff_SRCS} ${wav_SRCS} + ${asf_SRCS} ${mp4_SRCS} tag.cpp tagunion.cpp fileref.cpp audioproperties.cpp ) -if(WITH_ASF) - set(tag_LIB_SRCS ${tag_LIB_SRCS} ${asf_SRCS}) -endif() -if(WITH_MP4) - set(tag_LIB_SRCS ${tag_LIB_SRCS} ${mp4_SRCS}) -endif() add_library(tag ${tag_LIB_SRCS} ${tag_HDRS}) diff --git a/taglib/asf/asfattribute.cpp b/taglib/asf/asfattribute.cpp index ecdf1f61..2cfada7b 100644 --- a/taglib/asf/asfattribute.cpp +++ b/taglib/asf/asfattribute.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_ASF - #include #include #include "asfattribute.h" @@ -353,4 +351,3 @@ void ASF::Attribute::setStream(int value) d->stream = value; } -#endif diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp index cb71b580..336ef35b 100644 --- a/taglib/asf/asffile.cpp +++ b/taglib/asf/asffile.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_ASF - #include #include #include @@ -607,4 +605,3 @@ ByteVector ASF::File::renderString(const String &str, bool includeLength) return data; } -#endif diff --git a/taglib/asf/asfpicture.cpp b/taglib/asf/asfpicture.cpp index 551229b5..50a42ab3 100644 --- a/taglib/asf/asfpicture.cpp +++ b/taglib/asf/asfpicture.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_ASF - #include #include #include "asfattribute.h" @@ -182,4 +180,3 @@ ASF::Picture ASF::Picture::fromInvalid() return ret; } -#endif diff --git a/taglib/asf/asfproperties.cpp b/taglib/asf/asfproperties.cpp index 6597de13..0857f0c3 100644 --- a/taglib/asf/asfproperties.cpp +++ b/taglib/asf/asfproperties.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_ASF - #include #include #include "asfproperties.h" @@ -115,4 +113,3 @@ void ASF::Properties::setEncrypted(bool encrypted) d->encrypted = encrypted; } -#endif diff --git a/taglib/asf/asftag.cpp b/taglib/asf/asftag.cpp index c77646e1..b7b541fc 100644 --- a/taglib/asf/asftag.cpp +++ b/taglib/asf/asftag.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_ASF - #include "asftag.h" using namespace TagLib; @@ -198,4 +196,3 @@ bool ASF::Tag::isEmpty() const d->attributeListMap.isEmpty(); } -#endif diff --git a/taglib/fileref.cpp b/taglib/fileref.cpp index d18a3aeb..4cbb6413 100644 --- a/taglib/fileref.cpp +++ b/taglib/fileref.cpp @@ -147,17 +147,13 @@ StringList FileRef::defaultFileExtensions() l.append("wv"); l.append("spx"); l.append("tta"); -#ifdef TAGLIB_WITH_MP4 l.append("m4a"); l.append("m4b"); l.append("m4p"); l.append("3g2"); l.append("mp4"); -#endif -#ifdef TAGLIB_WITH_ASF l.append("wma"); l.append("asf"); -#endif l.append("aif"); l.append("aiff"); l.append("wav"); @@ -246,14 +242,10 @@ File *FileRef::create(FileName fileName, bool readAudioProperties, return new Ogg::Speex::File(fileName, readAudioProperties, audioPropertiesStyle); if(ext == "TTA") return new TrueAudio::File(fileName, readAudioProperties, audioPropertiesStyle); -#ifdef TAGLIB_WITH_MP4 if(ext == "M4A" || ext == "M4B" || ext == "M4P" || ext == "MP4" || ext == "3G2") return new MP4::File(fileName, readAudioProperties, audioPropertiesStyle); -#endif -#ifdef TAGLIB_WITH_ASF if(ext == "WMA" || ext == "ASF") return new ASF::File(fileName, readAudioProperties, audioPropertiesStyle); -#endif if(ext == "AIF" || ext == "AIFF") return new RIFF::AIFF::File(fileName, readAudioProperties, audioPropertiesStyle); if(ext == "WAV") diff --git a/taglib/mp4/mp4atom.cpp b/taglib/mp4/mp4atom.cpp index de42d3c4..1681ec80 100644 --- a/taglib/mp4/mp4atom.cpp +++ b/taglib/mp4/mp4atom.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_MP4 - #include #include #include "mp4atom.h" @@ -198,4 +196,3 @@ MP4::Atoms::path(const char *name1, const char *name2, const char *name3, const return path; } -#endif diff --git a/taglib/mp4/mp4coverart.cpp b/taglib/mp4/mp4coverart.cpp index 86555fc1..928e3c4a 100644 --- a/taglib/mp4/mp4coverart.cpp +++ b/taglib/mp4/mp4coverart.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_MP4 - #include #include #include "mp4coverart.h" @@ -86,4 +84,3 @@ MP4::CoverArt::data() const return d->data; } -#endif diff --git a/taglib/mp4/mp4file.cpp b/taglib/mp4/mp4file.cpp index d6ef4ebd..02185575 100644 --- a/taglib/mp4/mp4file.cpp +++ b/taglib/mp4/mp4file.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_MP4 - #include #include #include "mp4atom.h" @@ -149,4 +147,3 @@ MP4::File::save() return d->tag->save(); } -#endif diff --git a/taglib/mp4/mp4item.cpp b/taglib/mp4/mp4item.cpp index 7dcf5946..d51a487c 100644 --- a/taglib/mp4/mp4item.cpp +++ b/taglib/mp4/mp4item.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_MP4 - #include #include #include "mp4item.h" @@ -146,4 +144,3 @@ MP4::Item::isValid() const return d->valid; } -#endif diff --git a/taglib/mp4/mp4properties.cpp b/taglib/mp4/mp4properties.cpp index 81beb19f..5dc87673 100644 --- a/taglib/mp4/mp4properties.cpp +++ b/taglib/mp4/mp4properties.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_MP4 - #include #include #include "mp4file.h" @@ -186,4 +184,3 @@ MP4::Properties::isEncrypted() const return d->encrypted; } -#endif diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 30cb1028..4e2d0211 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -27,8 +27,6 @@ #include #endif -#ifdef WITH_MP4 - #include #include #include "mp4atom.h" @@ -638,4 +636,3 @@ MP4::Tag::itemListMap() return d->items; } -#endif diff --git a/taglib/taglib_config.h.cmake b/taglib/taglib_config.h.cmake index aa9df25f..0f499e2c 100644 --- a/taglib/taglib_config.h.cmake +++ b/taglib/taglib_config.h.cmake @@ -1,4 +1,4 @@ /* taglib_config.h. Generated by cmake from taglib_config.h.cmake */ -#cmakedefine TAGLIB_WITH_ASF 1 -#cmakedefine TAGLIB_WITH_MP4 1 +#define TAGLIB_WITH_ASF 1 +#define TAGLIB_WITH_MP4 1 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d169a626..723803e9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,18 +47,11 @@ SET(test_runner_SRCS test_apetag.cpp test_wav.cpp test_wavpack.cpp + test_mp4.cpp + test_mp4item.cpp + test_mp4coverart.cpp + test_asf.cpp ) -IF(WITH_MP4) - SET(test_runner_SRCS ${test_runner_SRCS} - test_mp4.cpp - test_mp4item.cpp - test_mp4coverart.cpp - ) -ENDIF(WITH_MP4) - -IF(WITH_ASF) - SET(test_runner_SRCS ${test_runner_SRCS} test_asf.cpp) -ENDIF(WITH_ASF) ADD_EXECUTABLE(test_runner ${test_runner_SRCS}) TARGET_LINK_LIBRARIES(test_runner tag ${CPPUNIT_LIBRARIES}) diff --git a/tests/test_fileref.cpp b/tests/test_fileref.cpp index fb8b2458..3268fdb4 100644 --- a/tests/test_fileref.cpp +++ b/tests/test_fileref.cpp @@ -16,9 +16,7 @@ using namespace TagLib; class TestFileRef : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(TestFileRef); -#ifdef TAGLIB_WITH_ASF CPPUNIT_TEST(testASF); -#endif CPPUNIT_TEST(testMusepack); CPPUNIT_TEST(testVorbis); CPPUNIT_TEST(testSpeex); @@ -26,11 +24,9 @@ class TestFileRef : public CppUnit::TestFixture CPPUNIT_TEST(testMP3); CPPUNIT_TEST(testOGA_FLAC); CPPUNIT_TEST(testOGA_Vorbis); -#ifdef TAGLIB_WITH_MP4 CPPUNIT_TEST(testMP4_1); CPPUNIT_TEST(testMP4_2); CPPUNIT_TEST(testMP4_3); -#endif CPPUNIT_TEST(testTrueAudio); CPPUNIT_TEST(testAPE); CPPUNIT_TEST_SUITE_END(); @@ -86,12 +82,10 @@ public: fileRefSave("click", ".mpc"); } -#ifdef TAGLIB_WITH_ASF void testASF() { fileRefSave("silence-1", ".wma"); } -#endif void testVorbis() { @@ -118,7 +112,6 @@ public: fileRefSave("empty", ".tta"); } -#ifdef TAGLIB_WITH_MP4 void testMP4_1() { fileRefSave("has-tags", ".m4a"); @@ -133,7 +126,6 @@ public: { fileRefSave("no-tags", ".3g2"); } -#endif void testOGA_FLAC() { -- cgit v1.2.3