Merge branch 'master' into merge-master-to-taglib2

# Conflicts:
#	AUTHORS
#	ConfigureChecks.cmake
#	taglib/asf/asfutils.h
#	taglib/mp4/mp4atom.cpp
#	taglib/mp4/mp4tag.h
#	taglib/mpeg/id3v2/frames/ownershipframe.cpp
#	taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp
#	taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp
#	taglib/mpeg/id3v2/id3v2frame.cpp
#	taglib/riff/rifffile.cpp
#	taglib/riff/rifffile.h
#	taglib/toolkit/taglib.h
#	taglib/toolkit/tbytevector.cpp
#	taglib/toolkit/tfilestream.cpp
#	taglib/toolkit/tstring.cpp
#	taglib/toolkit/tutils.h
#	taglib/xm/xmfile.cpp
#	tests/test_bytevector.cpp
#	tests/test_fileref.cpp
#	tests/test_id3v2.cpp
#	tests/test_riff.cpp
#	tests/test_string.cpp
This commit is contained in:
Tsuda Kageyu
2016-10-30 21:20:23 +09:00
111 changed files with 2307 additions and 912 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <stdlib.h>
#include <string.h>
#include <fstream>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2010 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <apetag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2010 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2008 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,28 +1,30 @@
/* Copyright (C) 2003 Scott Wheeler <wheeler@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
#include <cstring>
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#define _USE_MATH_DEFINES
#include <cmath>
#include <tbytevector.h>
#include <tbytevectorlist.h>
#include <cppunit/extensions/HelperMacros.h>
@@ -36,47 +38,35 @@ class TestByteVector : public CppUnit::TestFixture
CPPUNIT_TEST(testByteVector);
CPPUNIT_TEST(testFind1);
CPPUNIT_TEST(testFind2);
CPPUNIT_TEST(testFind3);
CPPUNIT_TEST(testRfind1);
CPPUNIT_TEST(testRfind2);
CPPUNIT_TEST(testRfind3);
CPPUNIT_TEST(testToHex);
CPPUNIT_TEST(testNumericCoversion);
CPPUNIT_TEST(testIntegerConversion);
CPPUNIT_TEST(testFloatingPointConversion);
CPPUNIT_TEST(testReplace);
CPPUNIT_TEST(testIterator);
CPPUNIT_TEST(testResize);
CPPUNIT_TEST(testAppend);
CPPUNIT_TEST(testAppend1);
CPPUNIT_TEST(testAppend2);
CPPUNIT_TEST(testBase64);
CPPUNIT_TEST_SUITE_END();
public:
void testByteVector()
{
ByteVector v("foobar");
CPPUNIT_ASSERT(v.find("ob") == 2);
CPPUNIT_ASSERT(v.find('b') == 3);
ByteVector a1("foo");
a1.append("bar");
CPPUNIT_ASSERT(a1 == "foobar");
ByteVector a2("foo");
a2.append("b");
CPPUNIT_ASSERT(a2 == "foob");
ByteVector a3;
a3.append("b");
CPPUNIT_ASSERT(a3 == "b");
ByteVector s1("foo");
CPPUNIT_ASSERT(ByteVectorList::split(s1, " ").size() == 1);
ByteVector s2("f");
CPPUNIT_ASSERT(ByteVectorList::split(s2, " ").size() == 1);
CPPUNIT_ASSERT(ByteVector().size() == 0);
CPPUNIT_ASSERT(ByteVector("asdf").clear().size() == 0);
CPPUNIT_ASSERT(ByteVector("asdf").clear() == ByteVector());
CPPUNIT_ASSERT(ByteVector().isEmpty());
CPPUNIT_ASSERT_EQUAL(0U, ByteVector().size());
CPPUNIT_ASSERT(ByteVector("asdf").clear().isEmpty());
CPPUNIT_ASSERT_EQUAL(0U, ByteVector("asdf").clear().size());
CPPUNIT_ASSERT_EQUAL(ByteVector(), ByteVector("asdf").clear());
ByteVector i("blah blah");
ByteVector j("blah");
@@ -116,6 +106,20 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector::npos(), ByteVector("\x01\x02", 2).find("\x01\x03"));
}
void testFind3()
{
CPPUNIT_ASSERT_EQUAL((size_t)4, ByteVector("....SggO."). find('S'));
CPPUNIT_ASSERT_EQUAL((size_t)4, ByteVector("....SggO."). find('S', 0));
CPPUNIT_ASSERT_EQUAL((size_t)4, ByteVector("....SggO."). find('S', 1));
CPPUNIT_ASSERT_EQUAL((size_t)4, ByteVector("....SggO."). find('S', 2));
CPPUNIT_ASSERT_EQUAL((size_t)4, ByteVector("....SggO."). find('S', 3));
CPPUNIT_ASSERT_EQUAL((size_t)4, ByteVector("....SggO."). find('S', 4));
CPPUNIT_ASSERT_EQUAL(ByteVector::npos(), ByteVector("....SggO."). find('S', 5));
CPPUNIT_ASSERT_EQUAL(ByteVector::npos(), ByteVector("....SggO."). find('S', 6));
CPPUNIT_ASSERT_EQUAL(ByteVector::npos(), ByteVector("....SggO."). find('S', 7));
CPPUNIT_ASSERT_EQUAL(ByteVector::npos(), ByteVector("....SggO."). find('S', 8));
}
void testRfind1()
{
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind("OggS", 0));
@@ -152,6 +156,20 @@ public:
CPPUNIT_ASSERT_EQUAL((size_t)10, r4.rfind("OggS", 12));
}
void testRfind3()
{
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 0));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 1));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 2));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 3));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 4));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 5));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 6));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 7));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O', 8));
CPPUNIT_ASSERT_EQUAL((size_t)1, ByteVector(".OggS....").rfind('O'));
}
void testToHex()
{
ByteVector v("\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f", 16);
@@ -159,77 +177,71 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector("f0e1d2c3b4a5968778695a4b3c2d1e0f"), v.toHex());
}
void testNumericCoversion()
void testIntegerConversion()
{
// n = { 0x00, 0x88, 0x11, 0x99, ..., 0x77, 0xFF }
ByteVector n(16, 0);
for(size_t i = 0; i < 8; ++i) {
n[i * 2 ] = static_cast<unsigned char>(0x11 * i);
n[i * 2 + 1] = static_cast<unsigned char>(0x11 * (i + 8));
}
const ByteVector data("\x00\xff\x01\xff\x00\xff\x01\xff\x00\xff\x01\xff\x00\xff", 14);
CPPUNIT_ASSERT(n.toUInt16LE(1) == 4488);
CPPUNIT_ASSERT(n.toUInt16BE(2) == 4505);
CPPUNIT_ASSERT(n.toUInt24LE(3) == 11149977);
CPPUNIT_ASSERT(n.toUInt24BE(4) == 2271795);
CPPUNIT_ASSERT(n.toUInt32LE(5) == 1153119146);
CPPUNIT_ASSERT(n.toUInt32BE(6) == 867910860);
CPPUNIT_ASSERT(n.toInt16LE(3) == 8857);
CPPUNIT_ASSERT(n.toInt16BE(7) == -17596);
CPPUNIT_ASSERT(n.toInt16LE(10) == -8875);
CPPUNIT_ASSERT(n.toInt16BE(14) == 30719);
CPPUNIT_ASSERT(n.toInt64LE(5) == 7412174897536512938ll);
CPPUNIT_ASSERT(n.toInt64BE(3) == -7412174897536512939ll);
CPPUNIT_ASSERT(n.toInt64LE(6) == -1268082884489200845ll);
CPPUNIT_ASSERT(n.toInt64BE(4) == 2497865822736504285ll);
CPPUNIT_ASSERT_EQUAL((short)0x00ff, data.toInt16BE(0));
CPPUNIT_ASSERT_EQUAL((short)0xff00, data.toInt16LE(0));
CPPUNIT_ASSERT_EQUAL((short)0xff01, data.toInt16BE(5));
CPPUNIT_ASSERT_EQUAL((short)0x01ff, data.toInt16LE(5));
CPPUNIT_ASSERT_EQUAL((short)0xff, data.toInt16BE(13));
CPPUNIT_ASSERT_EQUAL((short)0xff, data.toInt16LE(13));
CPPUNIT_ASSERT(ByteVector::fromUInt16LE(n.toInt16LE(5)) == n.mid(5, 2));
CPPUNIT_ASSERT(ByteVector::fromUInt16BE(n.toInt16BE(9)) == n.mid(9, 2));
CPPUNIT_ASSERT(ByteVector::fromUInt32LE(n.toUInt32LE(4)) == n.mid(4, 4));
CPPUNIT_ASSERT(ByteVector::fromUInt32BE(n.toUInt32BE(7)) == n.mid(7, 4));
CPPUNIT_ASSERT(ByteVector::fromUInt64LE(n.toInt64LE(1)) == n.mid(1, 8));
CPPUNIT_ASSERT(ByteVector::fromUInt64BE(n.toInt64BE(6)) == n.mid(6, 8));
CPPUNIT_ASSERT_EQUAL((unsigned short)0x00ff, data.toUInt16BE(0));
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff00, data.toUInt16LE(0));
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff01, data.toUInt16BE(5));
CPPUNIT_ASSERT_EQUAL((unsigned short)0x01ff, data.toUInt16LE(5));
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff, data.toUInt16BE(13));
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff, data.toUInt16LE(13));
CPPUNIT_ASSERT(ByteVector::fromUInt16LE(4386) == ByteVector::fromUInt16BE(8721));
CPPUNIT_ASSERT(ByteVector::fromUInt32LE(287454020) == ByteVector::fromUInt32BE(1144201745));
CPPUNIT_ASSERT(ByteVector::fromUInt64LE(1234605615291183940ll) == ByteVector::fromUInt64BE(4914309075945333265ll));
CPPUNIT_ASSERT_EQUAL(0x00ff01ffU, data.toUInt32BE(0));
CPPUNIT_ASSERT_EQUAL(0xff01ff00U, data.toUInt32LE(0));
CPPUNIT_ASSERT_EQUAL(0xff01ff00U, data.toUInt32BE(5));
CPPUNIT_ASSERT_EQUAL(0x00ff01ffU, data.toUInt32LE(5));
CPPUNIT_ASSERT_EQUAL(0x00ffU, data.toUInt32BE(12));
CPPUNIT_ASSERT_EQUAL(0xff00U, data.toUInt32LE(12));
const unsigned char PI32LE[] = { 0x00, 0xdb, 0x0f, 0x49, 0x40 };
const unsigned char PI32BE[] = { 0x00, 0x40, 0x49, 0x0f, 0xdb };
const unsigned char PI64LE[] = { 0x00, 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40 };
const unsigned char PI64BE[] = { 0x00, 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18 };
const unsigned char PI80LE[] = { 0x00, 0x00, 0xc0, 0x68, 0x21, 0xa2, 0xda, 0x0f, 0xc9, 0x00, 0x40 };
const unsigned char PI80BE[] = { 0x00, 0x40, 0x00, 0xc9, 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc0, 0x00 };
CPPUNIT_ASSERT_EQUAL(0x00ff01U, data.toUInt24BE(0));
CPPUNIT_ASSERT_EQUAL(0x01ff00U, data.toUInt24LE(0));
CPPUNIT_ASSERT_EQUAL(0xff01ffU, data.toUInt24BE(5));
CPPUNIT_ASSERT_EQUAL(0xff01ffU, data.toUInt24LE(5));
CPPUNIT_ASSERT_EQUAL(0x00ffU, data.toUInt24BE(12));
CPPUNIT_ASSERT_EQUAL(0xff00U, data.toUInt24LE(12));
ByteVector pi32le(reinterpret_cast<const char*>(PI32LE), 5);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi32le.toFloat32LE(1) * 10000));
CPPUNIT_ASSERT_EQUAL((long long)0x00ff01ff00ff01ffULL, data.toInt64BE(0));
CPPUNIT_ASSERT_EQUAL((long long)0xff01ff00ff01ff00ULL, data.toInt64LE(0));
CPPUNIT_ASSERT_EQUAL((long long)0xff01ff00ff01ff00ULL, data.toInt64BE(5));
CPPUNIT_ASSERT_EQUAL((long long)0x00ff01ff00ff01ffULL, data.toInt64LE(5));
CPPUNIT_ASSERT_EQUAL((long long)0x00ffU, data.toInt64BE(12));
CPPUNIT_ASSERT_EQUAL((long long)0xff00U, data.toInt64LE(12));
}
ByteVector pi32be(reinterpret_cast<const char*>(PI32BE), 5);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi32be.toFloat32BE(1) * 10000));
void testFloatingPointConversion()
{
const double Tolerance = 1.0e-7;
ByteVector pi64le(reinterpret_cast<const char*>(PI64LE), 9);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi64le.toFloat64LE(1) * 10000));
const ByteVector pi32le("\xdb\x0f\x49\x40", 4);
CPPUNIT_ASSERT(std::abs(pi32le.toFloat32LE(0) - M_PI) < Tolerance);
CPPUNIT_ASSERT_EQUAL(pi32le, ByteVector::fromFloat32LE(pi32le.toFloat32LE(0)));
ByteVector pi64be(reinterpret_cast<const char*>(PI64BE), 9);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi64be.toFloat64BE(1) * 10000));
const ByteVector pi32be("\x40\x49\x0f\xdb", 4);
CPPUNIT_ASSERT(std::abs(pi32be.toFloat32BE(0) - M_PI) < Tolerance);
CPPUNIT_ASSERT_EQUAL(pi32be, ByteVector::fromFloat32BE(pi32be.toFloat32BE(0)));
ByteVector pi80le(reinterpret_cast<const char*>(PI80LE), 11);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi80le.toFloat80LE(1) * 10000));
const ByteVector pi64le("\x18\x2d\x44\x54\xfb\x21\x09\x40", 8);
CPPUNIT_ASSERT(std::abs(pi64le.toFloat64LE(0) - M_PI) < Tolerance);
CPPUNIT_ASSERT_EQUAL(pi64le, ByteVector::fromFloat64LE(pi64le.toFloat64LE(0)));
ByteVector pi80be(reinterpret_cast<const char*>(PI80BE), 11);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi80be.toFloat80BE(1) * 10000));
const ByteVector pi64be("\x40\x09\x21\xfb\x54\x44\x2d\x18", 8);
CPPUNIT_ASSERT(std::abs(pi64be.toFloat64BE(0) - M_PI) < Tolerance);
CPPUNIT_ASSERT_EQUAL(pi64be, ByteVector::fromFloat64BE(pi64be.toFloat64BE(0)));
ByteVector pi32le2 = ByteVector::fromFloat32LE(pi32le.toFloat32LE(1));
CPPUNIT_ASSERT(memcmp(pi32le.data() + 1, pi32le2.data(), 4) == 0);
const ByteVector pi80le("\x00\xc0\x68\x21\xa2\xda\x0f\xc9\x00\x40", 10);
CPPUNIT_ASSERT(std::abs(pi80le.toFloat80LE(0) - M_PI) < Tolerance);
ByteVector pi32be2 = ByteVector::fromFloat32BE(pi32be.toFloat32BE(1));
CPPUNIT_ASSERT(memcmp(pi32be.data() + 1, pi32be2.data(), 4) == 0);
ByteVector pi64le2 = ByteVector::fromFloat64LE(pi64le.toFloat64LE(1));
CPPUNIT_ASSERT(memcmp(pi64le.data() + 1, pi64le2.data(), 8) == 0);
ByteVector pi64be2 = ByteVector::fromFloat64BE(pi64be.toFloat64BE(1));
CPPUNIT_ASSERT(memcmp(pi64be.data() + 1, pi64be2.data(), 8) == 0);
const ByteVector pi80be("\x40\x00\xc9\x0f\xda\xa2\x21\x68\xc0\x00", 10);
CPPUNIT_ASSERT(std::abs(pi80be.toFloat80BE(0) - M_PI) < Tolerance);
}
void testReplace()
@@ -253,31 +265,50 @@ public:
ByteVector a("abcdabf");
a.replace(ByteVector("a"), ByteVector("x"));
CPPUNIT_ASSERT_EQUAL(ByteVector("xbcdxbf"), a);
a.replace(ByteVector("x"), ByteVector("a"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdabf"), a);
}
{
ByteVector a("abcdabf");
a.replace('a', 'x');
CPPUNIT_ASSERT_EQUAL(ByteVector("xbcdxbf"), a);
a.replace('x', 'a');
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdabf"), a);
}
{
ByteVector a("abcdabf");
a.replace(ByteVector("ab"), ByteVector("xy"));
CPPUNIT_ASSERT_EQUAL(ByteVector("xycdxyf"), a);
a.replace(ByteVector("xy"), ByteVector("ab"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdabf"), a);
}
{
ByteVector a("abcdabf");
a.replace(ByteVector("a"), ByteVector("<a>"));
CPPUNIT_ASSERT_EQUAL(ByteVector("<a>bcd<a>bf"), a);
a.replace(ByteVector("<a>"), ByteVector("a"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdabf"), a);
}
{
ByteVector a("abcdabf");
a.replace(ByteVector("ab"), ByteVector("x"));
CPPUNIT_ASSERT_EQUAL(ByteVector("xcdxf"), a);
a.replace(ByteVector("b"), ByteVector("<b>"));
CPPUNIT_ASSERT_EQUAL(ByteVector("a<b>cda<b>f"), a);
a.replace(ByteVector("<b>"), ByteVector("b"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdabf"), a);
}
{
ByteVector a("abcdabf");
a.replace(ByteVector("ab"), ByteVector());
CPPUNIT_ASSERT_EQUAL(ByteVector("cdf"), a);
ByteVector a("abcdabc");
a.replace(ByteVector("c"), ByteVector("<c>"));
CPPUNIT_ASSERT_EQUAL(ByteVector("ab<c>dab<c>"), a);
a.replace(ByteVector("<c>"), ByteVector("c"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdabc"), a);
}
{
ByteVector a("abcdabf");
a.replace(ByteVector("bf"), ByteVector("x"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdax"), a);
ByteVector a("abcdaba");
a.replace(ByteVector("a"), ByteVector("<a>"));
CPPUNIT_ASSERT_EQUAL(ByteVector("<a>bcd<a>b<a>"), a);
a.replace(ByteVector("<a>"), ByteVector("a"));
CPPUNIT_ASSERT_EQUAL(ByteVector("abcdaba"), a);
}
}
@@ -372,18 +403,49 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector::npos(), c.find('C'));
}
void testAppend()
void testAppend1()
{
ByteVector v1("taglib");
ByteVector v2 = v1;
ByteVector v1("foo");
v1.append("bar");
CPPUNIT_ASSERT_EQUAL(ByteVector("foobar"), v1);
v1.append("ABC");
CPPUNIT_ASSERT_EQUAL(ByteVector("taglibABC"), v1);
v1.append('1');
v1.append('2');
v1.append('3');
CPPUNIT_ASSERT_EQUAL(ByteVector("taglibABC123"), v1);
CPPUNIT_ASSERT_EQUAL(ByteVector("taglib"), v2);
ByteVector v2("foo");
v2.append("b");
CPPUNIT_ASSERT_EQUAL(ByteVector("foob"), v2);
ByteVector v3;
v3.append("b");
CPPUNIT_ASSERT_EQUAL(ByteVector("b"), v3);
ByteVector v4("foo");
v4.append(v1);
CPPUNIT_ASSERT_EQUAL(ByteVector("foofoobar"), v4);
ByteVector v5("foo");
v5.append('b');
CPPUNIT_ASSERT_EQUAL(ByteVector("foob"), v5);
ByteVector v6;
v6.append('b');
CPPUNIT_ASSERT_EQUAL(ByteVector("b"), v6);
ByteVector v7("taglib");
ByteVector v8 = v7;
v7.append("ABC");
CPPUNIT_ASSERT_EQUAL(ByteVector("taglibABC"), v7);
v7.append('1');
v7.append('2');
v7.append('3');
CPPUNIT_ASSERT_EQUAL(ByteVector("taglibABC123"), v7);
CPPUNIT_ASSERT_EQUAL(ByteVector("taglib"), v8);
}
void testAppend2()
{
ByteVector a("1234");
a.append(a);
CPPUNIT_ASSERT_EQUAL(ByteVector("12341234"), a);
}
void testBase64()
@@ -411,7 +473,7 @@ public:
CPPUNIT_ASSERT_EQUAL(e3, s3.toBase64());
// Decode
CPPUNIT_ASSERT_EQUAL(sempty, eempty.toBase64());
CPPUNIT_ASSERT_EQUAL(sempty, ByteVector::fromBase64(eempty));
CPPUNIT_ASSERT_EQUAL(s0, ByteVector::fromBase64(e0));
CPPUNIT_ASSERT_EQUAL(s1, ByteVector::fromBase64(e1));
CPPUNIT_ASSERT_EQUAL(s2, ByteVector::fromBase64(e2));

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tbytevector.h>
#include <tbytevectorlist.h>
#include <cppunit/extensions/HelperMacros.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2011 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tbytevectorstream.h>
#include <cppunit/extensions/HelperMacros.h>
@@ -13,6 +38,7 @@ class TestByteVectorStream : public CppUnit::TestFixture
CPPUNIT_TEST(testReadBlock);
CPPUNIT_TEST(testRemoveBlock);
CPPUNIT_TEST(testInsert);
CPPUNIT_TEST(testSeekEnd);
CPPUNIT_TEST_SUITE_END();
public:
@@ -87,6 +113,19 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector("yyx123foa"), *stream.data());
}
void testSeekEnd()
{
ByteVector v("abcdefghijklmnopqrstuvwxyz");
ByteVectorStream stream(v);
CPPUNIT_ASSERT_EQUAL(26LL, stream.length());
stream.seek(-4, IOStream::End);
CPPUNIT_ASSERT_EQUAL(ByteVector("w"), stream.readBlock(1));
stream.seek(-25, IOStream::End);
CPPUNIT_ASSERT_EQUAL(ByteVector("b"), stream.readBlock(1));
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestByteVectorStream);

View File

@@ -1,11 +1,11 @@
/***************************************************************************
copyright : (C) 2014 by Lukas Lalinsky
email : lukas@oxygene.sk
copyright : (C) 2015 by Tsuda Kageyu
email : tsuda.kageyu@gmail.com
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 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 *
@@ -15,8 +15,12 @@
* *
* 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 *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tfile.h>
@@ -41,6 +45,7 @@ class TestFile : public CppUnit::TestFixture
CPPUNIT_TEST(testFindInSmallFile);
CPPUNIT_TEST(testRFindInSmallFile);
CPPUNIT_TEST(testSeek);
CPPUNIT_TEST(testTruncate);
CPPUNIT_TEST_SUITE_END();
public:
@@ -125,6 +130,24 @@ public:
CPPUNIT_ASSERT_EQUAL(4428LL, f.tell());
}
void testTruncate()
{
ScopedFileCopy copy("empty", ".ogg");
std::string name = copy.fileName();
{
PlainFile f(name.c_str());
CPPUNIT_ASSERT_EQUAL(4328LL, f.length());
f.truncate(2000);
CPPUNIT_ASSERT_EQUAL(2000LL, f.length());
}
{
PlainFile f(name.c_str());
CPPUNIT_ASSERT_EQUAL(2000LL, f.length());
}
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestFile);

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>
@@ -5,6 +30,15 @@
#include <oggflacfile.h>
#include <vorbisfile.h>
#include <mpegfile.h>
#include <mpcfile.h>
#include <asffile.h>
#include <speexfile.h>
#include <flacfile.h>
#include <trueaudiofile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <apefile.h>
#include <aifffile.h>
#include <cppunit/extensions/HelperMacros.h>
#include "utils.h"
#include <tfilestream.h>
@@ -42,14 +76,15 @@ class TestFileRef : public CppUnit::TestFixture
CPPUNIT_TEST(testTrueAudio);
CPPUNIT_TEST(testAPE);
CPPUNIT_TEST(testWav);
CPPUNIT_TEST(testAIFF);
CPPUNIT_TEST(testAIFC);
CPPUNIT_TEST(testAIFF_1);
CPPUNIT_TEST(testAIFF_2);
CPPUNIT_TEST(testUnsupported);
CPPUNIT_TEST(testFileResolver);
CPPUNIT_TEST_SUITE_END();
public:
template <typename T>
void fileRefSave(const string &filename, const string &ext)
{
ScopedFileCopy copy(filename, ext);
@@ -57,6 +92,7 @@ public:
{
FileRef f(newname.c_str());
CPPUNIT_ASSERT(dynamic_cast<T*>(f.file()));
CPPUNIT_ASSERT(!f.isNull());
f.tag()->setArtist("test artist");
f.tag()->setTitle("test title");
@@ -96,6 +132,7 @@ public:
{
FileStream fs(newname.c_str());
FileRef f(&fs);
CPPUNIT_ASSERT(dynamic_cast<T*>(f.file()));
CPPUNIT_ASSERT(!f.isNull());
CPPUNIT_ASSERT_EQUAL(f.tag()->artist(), String("ttest artist"));
CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("ytest title"));
@@ -108,91 +145,87 @@ public:
void testMusepack()
{
fileRefSave("click", ".mpc");
fileRefSave<MPC::File>("click", ".mpc");
}
void testASF()
{
fileRefSave("silence-1", ".wma");
fileRefSave<ASF::File>("silence-1", ".wma");
}
void testVorbis()
{
fileRefSave("empty", ".ogg");
fileRefSave<Ogg::Vorbis::File>("empty", ".ogg");
}
void testSpeex()
{
fileRefSave("empty", ".spx");
fileRefSave<Ogg::Speex::File>("empty", ".spx");
}
void testFLAC()
{
fileRefSave("no-tags", ".flac");
fileRefSave<FLAC::File>("no-tags", ".flac");
}
void testMP3()
{
fileRefSave("xing", ".mp3");
fileRefSave<MPEG::File>("xing", ".mp3");
}
void testTrueAudio()
{
fileRefSave("empty", ".tta");
fileRefSave<TrueAudio::File>("empty", ".tta");
}
void testMP4_1()
{
fileRefSave("has-tags", ".m4a");
fileRefSave<MP4::File>("has-tags", ".m4a");
}
void testMP4_2()
{
fileRefSave("no-tags", ".m4a");
fileRefSave<MP4::File>("no-tags", ".m4a");
}
void testMP4_3()
{
fileRefSave("no-tags", ".3g2");
fileRefSave<MP4::File>("no-tags", ".3g2");
}
void testMP4_4()
{
fileRefSave("blank_video", ".m4v");
fileRefSave<MP4::File>("blank_video", ".m4v");
}
void testWav()
{
fileRefSave("empty", ".wav");
}
void testAIFF()
{
fileRefSave("empty", ".aiff");
}
void testAIFC()
{
fileRefSave("alaw", ".aifc");
fileRefSave<RIFF::WAV::File>("empty", ".wav");
}
void testOGA_FLAC()
{
FileRef f(TEST_FILE_PATH_C("empty_flac.oga"));
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f.file()) == NULL);
CPPUNIT_ASSERT(dynamic_cast<Ogg::FLAC::File *>(f.file()) != NULL);
fileRefSave<Ogg::FLAC::File>("empty_flac", ".oga");
}
void testOGA_Vorbis()
{
FileRef f(TEST_FILE_PATH_C("empty_vorbis.oga"));
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f.file()) != NULL);
CPPUNIT_ASSERT(dynamic_cast<Ogg::FLAC::File *>(f.file()) == NULL);
fileRefSave<Ogg::Vorbis::File>("empty_vorbis", ".oga");
}
void testAPE()
{
fileRefSave("mac-399", ".ape");
fileRefSave<APE::File>("mac-399", ".ape");
}
void testAIFF_1()
{
fileRefSave<RIFF::AIFF::File>("empty", ".aiff");
}
void testAIFF_2()
{
fileRefSave<RIFF::AIFF::File>("alaw", ".aifc");
}
void testUnsupported()

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2010 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2012 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tstring.h>

View File

@@ -1,6 +1,27 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
@@ -23,6 +44,7 @@
#include <tableofcontentsframe.h>
#include <tdebug.h>
#include <tpropertymap.h>
#include <tzlib.h>
#include <cppunit/extensions/HelperMacros.h>
#include "utils.h"
@@ -47,7 +69,8 @@ class TestID3v2 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestID3v2);
CPPUNIT_TEST(testUnsynchDecode);
CPPUNIT_TEST(testDowngradeUTF8ForID3v23);
CPPUNIT_TEST(testDowngradeUTF8ForID3v23_1);
CPPUNIT_TEST(testDowngradeUTF8ForID3v23_2);
CPPUNIT_TEST(testUTF16BEDelimiter);
CPPUNIT_TEST(testUTF16Delimiter);
CPPUNIT_TEST(testReadStringField);
@@ -73,6 +96,7 @@ class TestID3v2 : public CppUnit::TestFixture
CPPUNIT_TEST(testParseOwnershipFrame);
CPPUNIT_TEST(testRenderOwnershipFrame);
CPPUNIT_TEST(testParseSynchronizedLyricsFrame);
CPPUNIT_TEST(testParseSynchronizedLyricsFrameWithEmptyDescritpion);
CPPUNIT_TEST(testRenderSynchronizedLyricsFrame);
CPPUNIT_TEST(testParseEventTimingCodesFrame);
CPPUNIT_TEST(testRenderEventTimingCodesFrame);
@@ -96,6 +120,7 @@ class TestID3v2 : public CppUnit::TestFixture
CPPUNIT_TEST(testShrinkPadding);
CPPUNIT_TEST(testEmptyFrame);
CPPUNIT_TEST(testDuplicateTags);
CPPUNIT_TEST(testParseTOCFrameWithManyChildren);
CPPUNIT_TEST_SUITE_END();
public:
@@ -107,7 +132,7 @@ public:
CPPUNIT_ASSERT_EQUAL(String("My babe just cares for me"), f.tag()->title());
}
void testDowngradeUTF8ForID3v23()
void testDowngradeUTF8ForID3v23_1()
{
ScopedFileCopy copy("xing", ".mp3");
string newname = copy.fileName();
@@ -131,6 +156,27 @@ public:
CPPUNIT_ASSERT_EQUAL(String::UTF16, f2.textEncoding());
}
void testDowngradeUTF8ForID3v23_2()
{
ScopedFileCopy copy("xing", ".mp3");
ID3v2::UnsynchronizedLyricsFrame *f
= new ID3v2::UnsynchronizedLyricsFrame(String::UTF8);
f->setText("Foo");
MPEG::File file(copy.fileName().c_str());
file.ID3v2Tag(true)->addFrame(f);
file.save(MPEG::File::ID3v2, true, 3);
CPPUNIT_ASSERT(file.hasID3v2Tag());
ByteVector data = f->render();
CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+3+2+2+6+2), data.size());
ID3v2::UnsynchronizedLyricsFrame f2(data);
CPPUNIT_ASSERT_EQUAL(String("Foo"), f2.text());
CPPUNIT_ASSERT_EQUAL(String::UTF16, f2.textEncoding());
}
void testUTF16BEDelimiter()
{
ID3v2::TextIdentificationFrame f(ByteVector("TPE1"), String::UTF16BE);
@@ -208,7 +254,7 @@ public:
ID3v2::Header header;
header.setMajorVersion(2);
ID3v2::AttachedPictureFrame *frame =
static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, &header));
dynamic_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT(frame);
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), frame->mimeType());
@@ -230,8 +276,8 @@ public:
"\x00", 14);
ID3v2::Header header;
header.setMajorVersion(2);
ID3v2::AttachedPictureFrame *frame =
static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, &header));
ID3v2::UnknownFrame *frame =
dynamic_cast<TagLib::ID3v2::UnknownFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT(frame);
@@ -489,6 +535,35 @@ public:
CPPUNIT_ASSERT_EQUAL((unsigned int)4567, stl[1].time);
}
void testParseSynchronizedLyricsFrameWithEmptyDescritpion()
{
ID3v2::SynchronizedLyricsFrame f(
ByteVector("SYLT" // Frame ID
"\x00\x00\x00\x21" // Frame size
"\x00\x00" // Frame flags
"\x00" // Text encoding
"eng" // Language
"\x02" // Time stamp format
"\x01" // Content type
"\x00" // Content descriptor
"Example\x00" // 1st text
"\x00\x00\x04\xd2" // 1st time stamp
"Lyrics\x00" // 2nd text
"\x00\x00\x11\xd7", 40)); // 2nd time stamp
CPPUNIT_ASSERT_EQUAL(String::Latin1, f.textEncoding());
CPPUNIT_ASSERT_EQUAL(ByteVector("eng", 3), f.language());
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchronizedLyricsFrame::AbsoluteMilliseconds,
f.timestampFormat());
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchronizedLyricsFrame::Lyrics, f.type());
CPPUNIT_ASSERT(f.description().isEmpty());
ID3v2::SynchronizedLyricsFrame::SynchedTextList stl = f.synchedText();
CPPUNIT_ASSERT_EQUAL((unsigned int)2, stl.size());
CPPUNIT_ASSERT_EQUAL(String("Example"), stl[0].text);
CPPUNIT_ASSERT_EQUAL((unsigned int)1234, stl[0].time);
CPPUNIT_ASSERT_EQUAL(String("Lyrics"), stl[1].text);
CPPUNIT_ASSERT_EQUAL((unsigned int)4567, stl[1].time);
}
void testRenderSynchronizedLyricsFrame()
{
ID3v2::SynchronizedLyricsFrame f;
@@ -597,8 +672,8 @@ public:
ID3v2::Header header;
header.setMajorVersion(3);
ID3v2::TextIdentificationFrame *frame =
static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT_EQUAL((size_t)1, frame->fieldList().size());
dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT_EQUAL((unsigned int)1, frame->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("Death Metal"), frame->fieldList()[0]);
ID3v2::Tag tag;
@@ -618,8 +693,8 @@ public:
ID3v2::Header header;
header.setMajorVersion(3);
ID3v2::TextIdentificationFrame *frame =
static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT_EQUAL((size_t)2, frame->fieldList().size());
dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT_EQUAL((unsigned int)2, frame->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("4"), frame->fieldList()[0]);
CPPUNIT_ASSERT_EQUAL(String("Eurodisco"), frame->fieldList()[1]);
@@ -638,8 +713,8 @@ public:
"14\0Eurodisco", 23); // Text
ID3v2::Header header;
ID3v2::TextIdentificationFrame *frame =
static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT_EQUAL((size_t)2, frame->fieldList().size());
dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT_EQUAL((unsigned int)2, frame->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("14"), frame->fieldList()[0]);
CPPUNIT_ASSERT_EQUAL(String("Eurodisco"), frame->fieldList()[1]);
@@ -694,11 +769,11 @@ public:
}
{
MPEG::File bar(newname.c_str());
tf = static_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDOR").front());
tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDOR").front());
CPPUNIT_ASSERT(tf);
CPPUNIT_ASSERT_EQUAL((size_t)1, tf->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("2011"), tf->fieldList().front());
tf = static_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDRC").front());
tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDRC").front());
CPPUNIT_ASSERT(tf);
CPPUNIT_ASSERT_EQUAL((size_t)1, tf->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("2012-04-17T12:01"), tf->fieldList().front());
@@ -731,26 +806,23 @@ public:
MPEG::File f(TEST_FILE_PATH_C("compressed_id3_frame.mp3"), false);
CPPUNIT_ASSERT(f.ID3v2Tag()->frameListMap().contains("APIC"));
#ifdef HAVE_ZLIB
if(zlib::isAvailable()) {
ID3v2::AttachedPictureFrame *frame
= dynamic_cast<TagLib::ID3v2::AttachedPictureFrame*>(f.ID3v2Tag()->frameListMap()["APIC"].front());
CPPUNIT_ASSERT(frame);
CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType());
CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type());
CPPUNIT_ASSERT_EQUAL(String(""), frame->description());
CPPUNIT_ASSERT_EQUAL((unsigned int)86414, frame->picture().size());
}
else {
// Skip the test if ZLIB is not installed.
// The message "Compressed frames are currently not supported." will be displayed.
ID3v2::AttachedPictureFrame *frame
= dynamic_cast<TagLib::ID3v2::AttachedPictureFrame*>(f.ID3v2Tag()->frameListMap()["APIC"].front());
CPPUNIT_ASSERT(frame);
CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType());
CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type());
CPPUNIT_ASSERT_EQUAL(String(""), frame->description());
CPPUNIT_ASSERT_EQUAL((size_t)86414, frame->picture().size());
#else
// Skip the test if ZLIB is not installed.
// The message "Compressed frames are currently not supported." will be displayed.
ID3v2::UnknownFrame *frame
= dynamic_cast<TagLib::ID3v2::UnknownFrame*>(f.ID3v2Tag()->frameListMap()["APIC"].front());
CPPUNIT_ASSERT(frame);
#endif
ID3v2::UnknownFrame *frame
= dynamic_cast<TagLib::ID3v2::UnknownFrame*>(f.ID3v2Tag()->frameListMap()["APIC"].front());
CPPUNIT_ASSERT(frame);
}
}
void testW000()
@@ -1157,6 +1229,12 @@ public:
}
}
void testParseTOCFrameWithManyChildren()
{
MPEG::File f(TEST_FILE_PATH_C("toc_many_children.mp3"));
CPPUNIT_ASSERT(f.isValid());
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2);

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2012 by Tsuda Kageyu
email : tsuda.kageyu@gmail.com
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <infotag.h>

View File

@@ -5,7 +5,7 @@
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 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 *
@@ -15,8 +15,12 @@
* *
* 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 *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <itfile.h>

View File

@@ -1,26 +1,27 @@
/* Copyright (C) 2003 Scott Wheeler <wheeler@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tlist.h>
#include <cppunit/extensions/HelperMacros.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tstring.h>
#include <tmap.h>
#include <cppunit/extensions/HelperMacros.h>

View File

@@ -5,7 +5,7 @@
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 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 *
@@ -15,8 +15,12 @@
* *
* 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 *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <modfile.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2008 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2012 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <apetag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tstring.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2012 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2012 by Michael Helmling
email : helmling@mathematik.uni-kl.de
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tpropertymap.h>
#include <tag.h>
#include <id3v1tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <tag.h>
@@ -186,7 +211,7 @@ public:
CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3));
CPPUNIT_ASSERT_EQUAL((unsigned int)(4411 - 8), f.riffSize());
CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize());
}
{
PublicRIFF f(filename.c_str());
@@ -209,6 +234,8 @@ public:
PublicRIFF f(filename.c_str());
CPPUNIT_ASSERT_EQUAL(5928U, f.riffSize());
CPPUNIT_ASSERT_EQUAL(5936LL, f.length());
CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.chunkName(0));
CPPUNIT_ASSERT_EQUAL((long long)(0x000C + 8), f.chunkOffset(0));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(1));
@@ -218,6 +245,8 @@ public:
const ByteVector data(0x400, ' ');
f.setChunkData("SSND", data);
CPPUNIT_ASSERT_EQUAL(1070U, f.riffSize());
CPPUNIT_ASSERT_EQUAL(1078LL, f.length());
CPPUNIT_ASSERT_EQUAL((long long)(0x000C + 8), f.chunkOffset(0));
CPPUNIT_ASSERT_EQUAL((long long)(0x0026 + 8), f.chunkOffset(1));
CPPUNIT_ASSERT_EQUAL((long long)(0x042E + 8), f.chunkOffset(2));
@@ -230,6 +259,8 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
f.setChunkData(0, data);
CPPUNIT_ASSERT_EQUAL(2076U, f.riffSize());
CPPUNIT_ASSERT_EQUAL(2084LL, f.length());
CPPUNIT_ASSERT_EQUAL((long long)(0x000C + 8), f.chunkOffset(0));
CPPUNIT_ASSERT_EQUAL((long long)(0x0414 + 8), f.chunkOffset(1));
CPPUNIT_ASSERT_EQUAL((long long)(0x081C + 8), f.chunkOffset(2));
@@ -242,6 +273,8 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
f.removeChunk("SSND");
CPPUNIT_ASSERT_EQUAL(1044U, f.riffSize());
CPPUNIT_ASSERT_EQUAL(1052LL, f.length());
CPPUNIT_ASSERT_EQUAL((long long)(0x000C + 8), f.chunkOffset(0));
CPPUNIT_ASSERT_EQUAL((long long)(0x0414 + 8), f.chunkOffset(1));
@@ -251,6 +284,7 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
f.removeChunk(0);
CPPUNIT_ASSERT_EQUAL(12U, f.riffSize());
CPPUNIT_ASSERT_EQUAL((long long)(0x000C + 8), f.chunkOffset(0));
f.seek(f.chunkOffset(0) - 8);

View File

@@ -5,7 +5,7 @@
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 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 *
@@ -15,8 +15,12 @@
* *
* 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 *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <s3mfile.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2015 by Tsuda Kageyu
email : tsuda.kageyu@gmail.com
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <speexfile.h>
#include <oggpageheader.h>
#include <cppunit/extensions/HelperMacros.h>

View File

@@ -1,26 +1,27 @@
/* Copyright (C) 2003 Scott Wheeler <wheeler@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <tstring.h>
#include <string.h>
@@ -46,7 +47,8 @@ class TestString : public CppUnit::TestFixture
CPPUNIT_TEST(testSubstr);
CPPUNIT_TEST(testNewline);
CPPUNIT_TEST(testUpper);
CPPUNIT_TEST(testEncode);
CPPUNIT_TEST(testEncodeNonLatin1);
CPPUNIT_TEST(testEncodeEmpty);
CPPUNIT_TEST(testIterator);
CPPUNIT_TEST_SUITE_END();
@@ -104,29 +106,12 @@ public:
String unicode6(L"\u65e5\u672c\u8a9e", String::UTF16LE);
CPPUNIT_ASSERT(unicode6[1] == (littleEndian ? L'\u672c' : L'\u2c67'));
std::wstring stduni = L"\u65e5\u672c\u8a9e";
String unicode7(stduni);
CPPUNIT_ASSERT(unicode7[1] == L'\u672c');
String unicode8(stduni, String::UTF16BE);
CPPUNIT_ASSERT(unicode8[1] == (littleEndian ? L'\u2c67' : L'\u672c'));
String unicode9(stduni, String::UTF16LE);
CPPUNIT_ASSERT(unicode9[1] == (littleEndian ? L'\u672c' : L'\u2c67'));
CPPUNIT_ASSERT(String(" foo ").stripWhiteSpace() == String("foo"));
CPPUNIT_ASSERT(String("foo ").stripWhiteSpace() == String("foo"));
CPPUNIT_ASSERT(String(" foo").stripWhiteSpace() == String("foo"));
CPPUNIT_ASSERT(memcmp(String("foo").data(String::Latin1).data(), "foo", 3) == 0);
CPPUNIT_ASSERT(memcmp(String("f").data(String::Latin1).data(), "f", 1) == 0);
// Check to make sure that the BOM is there and that the data size is correct
const ByteVector utf16 = unicode.data(String::UTF16);
CPPUNIT_ASSERT(utf16.size() == 2 + (unicode.size() * 2));
CPPUNIT_ASSERT(unicode == String(utf16, String::UTF16));
}
void testUTF16Encode()
@@ -258,6 +243,9 @@ public:
String("9999999999").toInt(&ok);
CPPUNIT_ASSERT_EQUAL(ok, false);
CPPUNIT_ASSERT_EQUAL(String("0000").toInt(), 0);
CPPUNIT_ASSERT_EQUAL(String("0001").toInt(), 1);
String("2147483648").toInt(&ok);
CPPUNIT_ASSERT_EQUAL(ok, false);
@@ -267,8 +255,9 @@ public:
void testFromInt()
{
CPPUNIT_ASSERT_EQUAL(String("123"), String::number(123));
CPPUNIT_ASSERT_EQUAL(String("-123"), String::number(-123));
CPPUNIT_ASSERT_EQUAL(String::number(0), String("0"));
CPPUNIT_ASSERT_EQUAL(String::number(12345678), String("12345678"));
CPPUNIT_ASSERT_EQUAL(String::number(-12345678), String("-12345678"));
}
void testSubstr()
@@ -302,41 +291,28 @@ public:
CPPUNIT_ASSERT_EQUAL(String("TAGLIB 012 STRING"), s2);
}
void testEncode()
void testEncodeNonLatin1()
{
String jpn(L"\u65E5\u672C\u8A9E");
ByteVector jpn1 = jpn.data(String::Latin1);
ByteVector jpn2 = jpn.data(String::UTF8);
ByteVector jpn3 = jpn.data(String::UTF16);
ByteVector jpn4 = jpn.data(String::UTF16LE);
ByteVector jpn5 = jpn.data(String::UTF16BE);
std::string jpn6 = jpn.to8Bit(false);
std::string jpn7 = jpn.to8Bit(true);
const String jpn(L"\u65E5\u672C\u8A9E");
CPPUNIT_ASSERT_EQUAL(ByteVector("\xE5\x2C\x9E"), jpn.data(String::Latin1));
CPPUNIT_ASSERT_EQUAL(ByteVector("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"), jpn.data(String::UTF8));
CPPUNIT_ASSERT_EQUAL(ByteVector("\xFF\xFE\xE5\x65\x2C\x67\x9E\x8A"), jpn.data(String::UTF16));
CPPUNIT_ASSERT_EQUAL(ByteVector("\xE5\x65\x2C\x67\x9E\x8A"), jpn.data(String::UTF16LE));
CPPUNIT_ASSERT_EQUAL(ByteVector("\x65\xE5\x67\x2C\x8A\x9E"), jpn.data(String::UTF16BE));
CPPUNIT_ASSERT_EQUAL(std::string("\xE5\x2C\x9E"), jpn.to8Bit(false));
CPPUNIT_ASSERT_EQUAL(std::string("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"), jpn.to8Bit(true));
}
CPPUNIT_ASSERT_EQUAL(ByteVector("\xE5\x2C\x9E"), jpn1);
CPPUNIT_ASSERT_EQUAL(ByteVector("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"), jpn2);
CPPUNIT_ASSERT_EQUAL(ByteVector("\xFF\xFE\xE5\x65\x2C\x67\x9E\x8A"), jpn3);
CPPUNIT_ASSERT_EQUAL(ByteVector("\xE5\x65\x2C\x67\x9E\x8A"), jpn4);
CPPUNIT_ASSERT_EQUAL(ByteVector("\x65\xE5\x67\x2C\x8A\x9E"), jpn5);
CPPUNIT_ASSERT_EQUAL(std::string("\xE5\x2C\x9E"), jpn6);
CPPUNIT_ASSERT_EQUAL(std::string("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"), jpn7);
String empty;
ByteVector empty1 = empty.data(String::Latin1);
ByteVector empty2 = empty.data(String::UTF8);
ByteVector empty3 = empty.data(String::UTF16);
ByteVector empty4 = empty.data(String::UTF16LE);
ByteVector empty5 = empty.data(String::UTF16BE);
std::string empty6 = empty.to8Bit(false);
std::string empty7 = empty.to8Bit(true);
CPPUNIT_ASSERT(empty1.isEmpty());
CPPUNIT_ASSERT(empty2.isEmpty());
CPPUNIT_ASSERT_EQUAL(ByteVector("\xFF\xFE"), empty3);
CPPUNIT_ASSERT(empty4.isEmpty());
CPPUNIT_ASSERT(empty5.isEmpty());
CPPUNIT_ASSERT(empty6.empty());
CPPUNIT_ASSERT(empty7.empty());
void testEncodeEmpty()
{
const String empty;
CPPUNIT_ASSERT(empty.data(String::Latin1).isEmpty());
CPPUNIT_ASSERT(empty.data(String::UTF8).isEmpty());
CPPUNIT_ASSERT_EQUAL(ByteVector("\xFF\xFE"), empty.data(String::UTF16));
CPPUNIT_ASSERT(empty.data(String::UTF16LE).isEmpty());
CPPUNIT_ASSERT(empty.data(String::UTF16BE).isEmpty());
CPPUNIT_ASSERT(empty.to8Bit(false).empty());
CPPUNIT_ASSERT(empty.to8Bit(true).empty());
}
void testIterator()

View File

@@ -1,26 +1,28 @@
/* Copyright (C) 2003 Scott Wheeler <wheeler@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <id3v2synchdata.h>
#include <cppunit/extensions/HelperMacros.h>
@@ -38,6 +40,8 @@ class TestID3v2SynchData : public CppUnit::TestFixture
CPPUNIT_TEST(testToUIntBrokenAndTooLarge);
CPPUNIT_TEST(testDecode1);
CPPUNIT_TEST(testDecode2);
CPPUNIT_TEST(testDecode3);
CPPUNIT_TEST(testDecode4);
CPPUNIT_TEST_SUITE_END();
public:
@@ -102,6 +106,22 @@ public:
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\x44", 2), a);
}
void testDecode3()
{
ByteVector a("\xff\xff\x00", 3);
a = ID3v2::SynchData::decode(a);
CPPUNIT_ASSERT_EQUAL((unsigned int)2, a.size());
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\xff", 2), a);
}
void testDecode4()
{
ByteVector a("\xff\xff\xff", 3);
a = ID3v2::SynchData::decode(a);
CPPUNIT_ASSERT_EQUAL((unsigned int)3, a.size());
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\xff\xff", 3), a);
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2SynchData);

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <id3v1tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2010 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <id3v2tag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2010 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <apetag.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2009 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <string>
#include <stdio.h>
#include <xiphcomment.h>

View File

@@ -5,7 +5,7 @@
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 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 *
@@ -15,8 +15,12 @@
* *
* 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 *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#include <xmfile.h>

View File

@@ -1,3 +1,28 @@
/***************************************************************************
copyright : (C) 2007 by Lukas Lalinsky
email : lukas@oxygene.sk
***************************************************************************/
/***************************************************************************
* 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 *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif