aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wheeler <scott@directededge.com>2019-09-11 00:37:02 +0200
committerScott Wheeler <scott@directededge.com>2019-09-11 00:39:37 +0200
commitc05fa78406fd8ce7382a11c1f63a17c4bfbe83fa (patch)
treea7c75d612b8ec70e0f523cacf171c6f994559ae2
parentb8dc105ae3ae5948ac6c7e3a45d5e4d6d846bd75 (diff)
Mark deprected methods and remove internal usage
This does not put the deprecated marker on methods that will or could resolve to the same overload, e.g.: void foo(bool bar = true); // <-- not marked void foo(Bar bar) // <-- since this will have a default argument in the new version
-rw-r--r--taglib/ape/apeproperties.h4
-rw-r--r--taglib/asf/asfproperties.h2
-rw-r--r--taglib/asf/asftag.h1
-rw-r--r--taglib/dsdiff/dsdiffdiintag.cpp4
-rw-r--r--taglib/dsdiff/dsdifffile.cpp10
-rw-r--r--taglib/flac/flacfile.h6
-rw-r--r--taglib/flac/flacproperties.h4
-rw-r--r--taglib/mp4/mp4properties.h2
-rw-r--r--taglib/mp4/mp4tag.h4
-rw-r--r--taglib/mpc/mpcfile.h2
-rw-r--r--taglib/mpc/mpcproperties.h2
-rw-r--r--taglib/mpeg/id3v2/frames/chapterframe.cpp2
-rw-r--r--taglib/mpeg/id3v2/frames/relativevolumeframe.h4
-rw-r--r--taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp2
-rw-r--r--taglib/mpeg/id3v2/id3v2frame.h13
-rw-r--r--taglib/mpeg/id3v2/id3v2framefactory.cpp7
-rw-r--r--taglib/mpeg/id3v2/id3v2framefactory.h11
-rw-r--r--taglib/mpeg/id3v2/id3v2tag.h4
-rw-r--r--taglib/mpeg/mpegfile.cpp2
-rw-r--r--taglib/mpeg/mpegfile.h8
-rw-r--r--taglib/mpeg/mpegheader.h2
-rw-r--r--taglib/mpeg/mpegproperties.h2
-rw-r--r--taglib/mpeg/xingheader.h4
-rw-r--r--taglib/ogg/oggpage.h2
-rw-r--r--taglib/ogg/opus/opusproperties.h2
-rw-r--r--taglib/ogg/speex/speexproperties.h2
-rw-r--r--taglib/ogg/vorbis/vorbisproperties.h2
-rw-r--r--taglib/ogg/xiphcomment.h2
-rw-r--r--taglib/riff/aiff/aiffproperties.h6
-rw-r--r--taglib/riff/wav/wavproperties.h8
-rw-r--r--taglib/toolkit/taglib.h8
-rw-r--r--taglib/toolkit/tbytevector.h4
-rw-r--r--taglib/toolkit/tfile.h4
-rw-r--r--taglib/toolkit/tstring.h6
-rw-r--r--taglib/trueaudio/trueaudiofile.h2
-rw-r--r--taglib/trueaudio/trueaudioproperties.h2
-rw-r--r--taglib/wavpack/wavpackproperties.h6
-rw-r--r--tests/test_aiff.cpp4
-rw-r--r--tests/test_ape.cpp5
-rw-r--r--tests/test_asf.cpp2
-rw-r--r--tests/test_bytevector.cpp1
-rw-r--r--tests/test_flac.cpp2
-rw-r--r--tests/test_id3v2.cpp34
-rw-r--r--tests/test_mp4.cpp3
-rw-r--r--tests/test_mpc.cpp4
-rw-r--r--tests/test_mpeg.cpp8
-rw-r--r--tests/test_ogg.cpp1
-rw-r--r--tests/test_opus.cpp1
-rw-r--r--tests/test_speex.cpp1
-rw-r--r--tests/test_string.cpp1
-rw-r--r--tests/test_trueaudio.cpp2
-rw-r--r--tests/test_wav.cpp8
-rw-r--r--tests/test_wavpack.cpp3
53 files changed, 114 insertions, 124 deletions
diff --git a/taglib/ape/apeproperties.h b/taglib/ape/apeproperties.h
index 91625483..ebbf949b 100644
--- a/taglib/ape/apeproperties.h
+++ b/taglib/ape/apeproperties.h
@@ -55,7 +55,7 @@ namespace TagLib {
*
* \deprecated
*/
- Properties(File *file, ReadStyle style = Average);
+ TAGLIB_DEPRECATED Properties(File *file, ReadStyle style = Average);
/*!
* Create an instance of APE::Properties with the data read from the
@@ -76,7 +76,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/asf/asfproperties.h b/taglib/asf/asfproperties.h
index b89349b3..317bf104 100644
--- a/taglib/asf/asfproperties.h
+++ b/taglib/asf/asfproperties.h
@@ -88,7 +88,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/asf/asftag.h b/taglib/asf/asftag.h
index 049b9f66..bbd98212 100644
--- a/taglib/asf/asftag.h
+++ b/taglib/asf/asftag.h
@@ -160,6 +160,7 @@ namespace TagLib {
* Returns a reference to the item list map. This is an AttributeListMap of
* all of the items in the tag.
*/
+ // BIC: return by value
const AttributeListMap &attributeListMap() const;
/*!
diff --git a/taglib/dsdiff/dsdiffdiintag.cpp b/taglib/dsdiff/dsdiffdiintag.cpp
index c027410a..a897ab20 100644
--- a/taglib/dsdiff/dsdiffdiintag.cpp
+++ b/taglib/dsdiff/dsdiffdiintag.cpp
@@ -88,7 +88,7 @@ unsigned int DSDIFF::DIIN::Tag::track() const
void DSDIFF::DIIN::Tag::setTitle(const String &title)
{
- if(title.isNull() || title.isEmpty())
+ if(title.isEmpty())
d->title = String();
else
d->title = title;
@@ -96,7 +96,7 @@ void DSDIFF::DIIN::Tag::setTitle(const String &title)
void DSDIFF::DIIN::Tag::setArtist(const String &artist)
{
- if(artist.isNull() || artist.isEmpty())
+ if(artist.isEmpty())
d->artist = String();
else
d->artist = artist;
diff --git a/taglib/dsdiff/dsdifffile.cpp b/taglib/dsdiff/dsdifffile.cpp
index 73b2dbb2..ac867b2b 100644
--- a/taglib/dsdiff/dsdifffile.cpp
+++ b/taglib/dsdiff/dsdifffile.cpp
@@ -230,7 +230,7 @@ bool DSDIFF::File::save()
if(d->hasDiin) {
DSDIFF::DIIN::Tag *diinTag = d->tag.access<DSDIFF::DIIN::Tag>(DIINIndex, false);
- if(!diinTag->title().isNull() && !diinTag->title().isEmpty()) {
+ if(!diinTag->title().isEmpty()) {
ByteVector diinTitle;
diinTitle.append(ByteVector::fromUInt(diinTag->title().size(), d->endianness == BigEndian));
diinTitle.append(ByteVector::fromCString(diinTag->title().toCString()));
@@ -239,7 +239,7 @@ bool DSDIFF::File::save()
else
setChildChunkData("DITI", ByteVector(), DIINChunk);
- if(!diinTag->artist().isNull() && !diinTag->artist().isEmpty()) {
+ if(!diinTag->artist().isEmpty()) {
ByteVector diinArtist;
diinArtist.append(ByteVector::fromUInt(diinTag->artist().size(), d->endianness == BigEndian));
diinArtist.append(ByteVector::fromCString(diinTag->artist().toCString()));
@@ -264,7 +264,7 @@ bool DSDIFF::File::save()
void DSDIFF::File::setRootChunkData(unsigned int i, const ByteVector &data)
{
- if(data.isNull() || data.isEmpty()) {
+ if(data.isEmpty()) {
// Null data: remove chunk
// Update global size
unsigned long long removedChunkTotalSize = d->chunks[i].size + d->chunks[i].padding + 12;
@@ -344,7 +344,7 @@ void DSDIFF::File::setChildChunkData(unsigned int i,
{
std::vector<Chunk64> &childChunks = d->childChunks[childChunkNum];
- if(data.isNull() || data.isEmpty()) {
+ if(data.isEmpty()) {
// Null data: remove chunk
// Update global size
unsigned long long removedChunkTotalSize = childChunks[i].size + childChunks[i].padding + 12;
@@ -426,7 +426,7 @@ void DSDIFF::File::setChildChunkData(const ByteVector &name,
}
// Do not attempt to remove a non existing chunk
- if(data.isNull() || data.isEmpty())
+ if(data.isEmpty())
return;
// Couldn't find an existing chunk, so let's create a new one.
diff --git a/taglib/flac/flacfile.h b/taglib/flac/flacfile.h
index 645090e0..1b8654eb 100644
--- a/taglib/flac/flacfile.h
+++ b/taglib/flac/flacfile.h
@@ -240,7 +240,7 @@ namespace TagLib {
* \see ID3v2FrameFactory
* \deprecated This value should be passed in via the constructor
*/
- void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
+ TAGLIB_DEPRECATED void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
/*!
* Returns the block of data used by FLAC::Properties for parsing the
@@ -248,7 +248,7 @@ namespace TagLib {
*
* \deprecated Always returns an empty vector.
*/
- ByteVector streamInfoData(); // BIC: remove
+ TAGLIB_DEPRECATED ByteVector streamInfoData(); // BIC: remove
/*!
* Returns the length of the audio-stream, used by FLAC::Properties for
@@ -256,7 +256,7 @@ namespace TagLib {
*
* \deprecated Always returns zero.
*/
- long streamLength(); // BIC: remove
+ TAGLIB_DEPRECATED long streamLength(); // BIC: remove
/*!
* Returns a list of pictures attached to the FLAC file.
diff --git a/taglib/flac/flacproperties.h b/taglib/flac/flacproperties.h
index 6f13ce62..743e5872 100644
--- a/taglib/flac/flacproperties.h
+++ b/taglib/flac/flacproperties.h
@@ -72,7 +72,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
@@ -120,7 +120,7 @@ namespace TagLib {
*
* \deprecated
*/
- int sampleWidth() const;
+ TAGLIB_DEPRECATED int sampleWidth() const;
/*!
* Return the number of sample frames.
diff --git a/taglib/mp4/mp4properties.h b/taglib/mp4/mp4properties.h
index 410d5348..492a48cc 100644
--- a/taglib/mp4/mp4properties.h
+++ b/taglib/mp4/mp4properties.h
@@ -57,7 +57,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/mp4/mp4tag.h b/taglib/mp4/mp4tag.h
index d477a86e..e5b70af3 100644
--- a/taglib/mp4/mp4tag.h
+++ b/taglib/mp4/mp4tag.h
@@ -42,7 +42,7 @@ namespace TagLib {
/*!
* \deprecated
*/
- typedef TagLib::Map<String, Item> ItemListMap;
+ TAGLIB_DEPRECATED typedef TagLib::Map<String, Item> ItemListMap;
typedef TagLib::Map<String, Item> ItemMap;
class TAGLIB_EXPORT Tag: public TagLib::Tag
@@ -74,7 +74,7 @@ namespace TagLib {
/*!
* \deprecated Use the item() and setItem() API instead
*/
- ItemMap &itemListMap();
+ TAGLIB_DEPRECATED ItemMap &itemListMap();
/*!
* Returns a string-keyed map of the MP4::Items for this tag.
diff --git a/taglib/mpc/mpcfile.h b/taglib/mpc/mpcfile.h
index 89a866e3..eb3ec54a 100644
--- a/taglib/mpc/mpcfile.h
+++ b/taglib/mpc/mpcfile.h
@@ -198,7 +198,7 @@ namespace TagLib {
* \deprecated
* \see strip
*/
- void remove(int tags = AllTags);
+ TAGLIB_DEPRECATED void remove(int tags = AllTags);
/*!
* Returns whether or not the file on disk actually has an ID3v1 tag.
diff --git a/taglib/mpc/mpcproperties.h b/taglib/mpc/mpcproperties.h
index d5fdfbb9..9a902dc9 100644
--- a/taglib/mpc/mpcproperties.h
+++ b/taglib/mpc/mpcproperties.h
@@ -74,7 +74,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/mpeg/id3v2/frames/chapterframe.cpp b/taglib/mpeg/id3v2/frames/chapterframe.cpp
index 69fe1df0..049f947d 100644
--- a/taglib/mpeg/id3v2/frames/chapterframe.cpp
+++ b/taglib/mpeg/id3v2/frames/chapterframe.cpp
@@ -267,7 +267,7 @@ void ChapterFrame::parseFields(const ByteVector &data)
return;
while(embPos < size - header()->size()) {
- Frame *frame = FrameFactory::instance()->createFrame(data.mid(pos + embPos), (d->tagHeader != 0));
+ Frame *frame = FrameFactory::instance()->createFrame(data.mid(pos + embPos), d->tagHeader);
if(!frame)
return;
diff --git a/taglib/mpeg/id3v2/frames/relativevolumeframe.h b/taglib/mpeg/id3v2/frames/relativevolumeframe.h
index 695e26f5..de01254c 100644
--- a/taglib/mpeg/id3v2/frames/relativevolumeframe.h
+++ b/taglib/mpeg/id3v2/frames/relativevolumeframe.h
@@ -131,12 +131,12 @@ namespace TagLib {
/*!
* \deprecated Always returns master volume.
*/
- ChannelType channelType() const;
+ TAGLIB_DEPRECATED ChannelType channelType() const;
/*!
* \deprecated This method no longer has any effect.
*/
- void setChannelType(ChannelType t);
+ TAGLIB_DEPRECATED void setChannelType(ChannelType t);
/*
* There was a terrible API goof here, and while this can't be changed to
diff --git a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp
index 9bd63fbe..937cb4d2 100644
--- a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp
+++ b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp
@@ -304,7 +304,7 @@ void TableOfContentsFrame::parseFields(const ByteVector &data)
return;
while(embPos < size - header()->size()) {
- Frame *frame = FrameFactory::instance()->createFrame(data.mid(pos + embPos), (d->tagHeader != 0));
+ Frame *frame = FrameFactory::instance()->createFrame(data.mid(pos + embPos), d->tagHeader);
if(!frame)
return;
diff --git a/taglib/mpeg/id3v2/id3v2frame.h b/taglib/mpeg/id3v2/id3v2frame.h
index ad2056da..ac531f36 100644
--- a/taglib/mpeg/id3v2/id3v2frame.h
+++ b/taglib/mpeg/id3v2/id3v2frame.h
@@ -89,14 +89,15 @@ namespace TagLib {
* non-binary compatible release this will be made into a non-static
* member that checks the internal ID3v2 version.
*/
- static unsigned int headerSize(); // BIC: remove and make non-static
+ static unsigned int headerSize(); // BIC: make non-static
/*!
* Returns the size of the frame header for the given ID3v2 version.
*
* \deprecated Please see the explanation above.
*/
- static unsigned int headerSize(unsigned int version); // BIC: remove and make non-static
+ // BIC: remove
+ static unsigned int headerSize(unsigned int version);
/*!
* Sets the data that will be used as the frame. Since the length is not
@@ -334,7 +335,7 @@ namespace TagLib {
* \deprecated Please use the constructor below that accepts a version
* number.
*/
- Header(const ByteVector &data, bool synchSafeInts);
+ TAGLIB_DEPRECATED Header(const ByteVector &data, bool synchSafeInts);
/*!
* Construct a Frame Header based on \a data. \a data must at least
@@ -356,7 +357,7 @@ namespace TagLib {
* \deprecated Please use the version below that accepts an ID3v2 version
* number.
*/
- void setData(const ByteVector &data, bool synchSafeInts);
+ TAGLIB_DEPRECATED void setData(const ByteVector &data, bool synchSafeInts);
/*!
* Sets the data for the Header. \a version should indicate the ID3v2
@@ -411,6 +412,7 @@ namespace TagLib {
* removed in the next binary incompatible release (2.0) and will be
* replaced with a non-static method that checks the frame version.
*/
+ // BIC: make non-static
static unsigned int size();
/*!
@@ -419,6 +421,7 @@ namespace TagLib {
*
* \deprecated Please see the explanation in the version above.
*/
+ // BIC: remove
static unsigned int size(unsigned int version);
/*!
@@ -502,7 +505,7 @@ namespace TagLib {
/*!
* \deprecated
*/
- bool frameAlterPreservation() const;
+ TAGLIB_DEPRECATED bool frameAlterPreservation() const;
private:
Header(const Header &);
diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp
index 155d0a9d..be07754a 100644
--- a/taglib/mpeg/id3v2/id3v2framefactory.cpp
+++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp
@@ -127,6 +127,11 @@ Frame *FrameFactory::createFrame(const ByteVector &data, unsigned int version) c
Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader) const
{
+ return createFrame(origData, const_cast<const Header *>(tagHeader));
+}
+
+Frame *FrameFactory::createFrame(const ByteVector &origData, const Header *tagHeader) const
+{
ByteVector data = origData;
unsigned int version = tagHeader->majorVersion();
Frame::Header *header = new Frame::Header(data, version);
@@ -164,7 +169,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader)
if(version > 3 && (tagHeader->unsynchronisation() || header->unsynchronisation())) {
// Data lengths are not part of the encoded data, but since they are synch-safe
// integers they will be never actually encoded.
- ByteVector frameData = data.mid(Frame::Header::size(version), header->frameSize());
+ ByteVector frameData = data.mid(header->size(), header->frameSize());
frameData = SynchData::decode(frameData);
data = data.mid(0, Frame::Header::size(version)) + frameData;
}
diff --git a/taglib/mpeg/id3v2/id3v2framefactory.h b/taglib/mpeg/id3v2/id3v2framefactory.h
index 33c7f67e..e8ff6062 100644
--- a/taglib/mpeg/id3v2/id3v2framefactory.h
+++ b/taglib/mpeg/id3v2/id3v2framefactory.h
@@ -74,7 +74,7 @@ namespace TagLib {
* \deprecated Please use the method below that accepts a ID3v2::Header
* instance in new code.
*/
- Frame *createFrame(const ByteVector &data, bool synchSafeInts) const;
+ TAGLIB_DEPRECATED Frame *createFrame(const ByteVector &data, bool synchSafeInts) const;
/*!
* Create a frame based on \a data. \a version should indicate the ID3v2
@@ -84,14 +84,19 @@ namespace TagLib {
* \deprecated Please use the method below that accepts a ID3v2::Header
* instance in new code.
*/
- Frame *createFrame(const ByteVector &data, unsigned int version = 4) const;
+ TAGLIB_DEPRECATED Frame *createFrame(const ByteVector &data, unsigned int version = 4) const;
/*!
+ * \deprecated
+ */
+ // BIC: remove
+ Frame *createFrame(const ByteVector &data, Header *tagHeader) const;
+ /*!
* Create a frame based on \a data. \a tagHeader should be a valid
* ID3v2::Header instance.
*/
// BIC: make virtual
- Frame *createFrame(const ByteVector &data, Header *tagHeader) const;
+ Frame *createFrame(const ByteVector &data, const Header *tagHeader) const;
/*!
* After a tag has been read, this tries to rebuild some of them
diff --git a/taglib/mpeg/id3v2/id3v2tag.h b/taglib/mpeg/id3v2/id3v2tag.h
index 96b6fb4a..7709b839 100644
--- a/taglib/mpeg/id3v2/id3v2tag.h
+++ b/taglib/mpeg/id3v2/id3v2tag.h
@@ -193,7 +193,7 @@ namespace TagLib {
* prone to change my mind, so this gets to stay around until near a
* release.
*/
- Footer *footer() const;
+ TAGLIB_DEPRECATED Footer *footer() const;
/*!
* Returns a reference to the frame list map. This is an FrameListMap of
@@ -340,7 +340,7 @@ namespace TagLib {
/*!
* \deprecated
*/
- ByteVector render(int version) const;
+ TAGLIB_DEPRECATED ByteVector render(int version) const;
/*!
* Render the tag back to binary data, suitable to be written to disk.
diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp
index ddfe7f9e..472cbdad 100644
--- a/taglib/mpeg/mpegfile.cpp
+++ b/taglib/mpeg/mpegfile.cpp
@@ -200,7 +200,7 @@ bool MPEG::File::save()
bool MPEG::File::save(int tags)
{
- return save(tags, true);
+ return save(tags, StripOthers);
}
bool MPEG::File::save(int tags, bool stripOthers)
diff --git a/taglib/mpeg/mpegfile.h b/taglib/mpeg/mpegfile.h
index 40beefc0..3fcb7272 100644
--- a/taglib/mpeg/mpegfile.h
+++ b/taglib/mpeg/mpegfile.h
@@ -196,19 +196,19 @@ namespace TagLib {
* \deprecated
*/
// BIC: combine with the above method
- bool save(int tags, bool stripOthers);
+ TAGLIB_DEPRECATED bool save(int tags, bool stripOthers);
/*!
* \deprecated
*/
// BIC: combine with the above method
- bool save(int tags, bool stripOthers, int id3v2Version);
+ TAGLIB_DEPRECATED bool save(int tags, bool stripOthers, int id3v2Version);
/*!
* \deprecated
*/
// BIC: combine with the above method
- bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags);
+ TAGLIB_DEPRECATED bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags);
/*!
* Save the file. This will attempt to save all of the tag types that are
@@ -317,7 +317,7 @@ namespace TagLib {
* \see ID3v2FrameFactory
* \deprecated This value should be passed in via the constructor
*/
- void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
+ TAGLIB_DEPRECATED void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
/*!
* Returns the position in the file of the first MPEG frame.
diff --git a/taglib/mpeg/mpegheader.h b/taglib/mpeg/mpegheader.h
index 024aa112..ca51184c 100644
--- a/taglib/mpeg/mpegheader.h
+++ b/taglib/mpeg/mpegheader.h
@@ -52,7 +52,7 @@ namespace TagLib {
*
* \deprecated
*/
- Header(const ByteVector &data);
+ TAGLIB_DEPRECATED Header(const ByteVector &data);
/*!
* Parses an MPEG header based on \a file and \a offset.
diff --git a/taglib/mpeg/mpegproperties.h b/taglib/mpeg/mpegproperties.h
index f11fad11..a1a1af4a 100644
--- a/taglib/mpeg/mpegproperties.h
+++ b/taglib/mpeg/mpegproperties.h
@@ -67,7 +67,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/mpeg/xingheader.h b/taglib/mpeg/xingheader.h
index f512e234..ce756190 100644
--- a/taglib/mpeg/xingheader.h
+++ b/taglib/mpeg/xingheader.h
@@ -111,8 +111,8 @@ namespace TagLib {
*
* \deprecated Always returns 0.
*/
- static int xingHeaderOffset(TagLib::MPEG::Header::Version v,
- TagLib::MPEG::Header::ChannelMode c);
+ TAGLIB_DEPRECATED static int xingHeaderOffset(TagLib::MPEG::Header::Version v,
+ TagLib::MPEG::Header::ChannelMode c);
private:
XingHeader(const XingHeader &);
diff --git a/taglib/ogg/oggpage.h b/taglib/ogg/oggpage.h
index 13e3e7f9..af3fe2c9 100644
--- a/taglib/ogg/oggpage.h
+++ b/taglib/ogg/oggpage.h
@@ -93,7 +93,7 @@ namespace TagLib {
*
* \deprecated Always returns null.
*/
- Page* getCopyWithNewPageSequenceNumber(int sequenceNumber);
+ TAGLIB_DEPRECATED Page *getCopyWithNewPageSequenceNumber(int sequenceNumber);
/*!
* Returns the index of the first packet wholly or partially contained in
diff --git a/taglib/ogg/opus/opusproperties.h b/taglib/ogg/opus/opusproperties.h
index be88b146..2e44dea5 100644
--- a/taglib/ogg/opus/opusproperties.h
+++ b/taglib/ogg/opus/opusproperties.h
@@ -69,7 +69,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/ogg/speex/speexproperties.h b/taglib/ogg/speex/speexproperties.h
index 64e6fac3..3f5a20f3 100644
--- a/taglib/ogg/speex/speexproperties.h
+++ b/taglib/ogg/speex/speexproperties.h
@@ -69,7 +69,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/ogg/vorbis/vorbisproperties.h b/taglib/ogg/vorbis/vorbisproperties.h
index 9da0ac9d..472e0390 100644
--- a/taglib/ogg/vorbis/vorbisproperties.h
+++ b/taglib/ogg/vorbis/vorbisproperties.h
@@ -75,7 +75,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/ogg/xiphcomment.h b/taglib/ogg/xiphcomment.h
index 14fc5407..674d6169 100644
--- a/taglib/ogg/xiphcomment.h
+++ b/taglib/ogg/xiphcomment.h
@@ -186,7 +186,7 @@ namespace TagLib {
* \deprecated Using this method may lead to a linkage error.
*/
// BIC: remove and merge with below
- void removeField(const String &key, const String &value = String::null);
+ TAGLIB_DEPRECATED void removeField(const String &key, const String &value = String());
/*!
* Remove all the fields specified by \a key.
diff --git a/taglib/riff/aiff/aiffproperties.h b/taglib/riff/aiff/aiffproperties.h
index d8bbaca9..dbb4c214 100644
--- a/taglib/riff/aiff/aiffproperties.h
+++ b/taglib/riff/aiff/aiffproperties.h
@@ -52,7 +52,7 @@ namespace TagLib {
*
* \deprecated
*/
- Properties(const ByteVector &data, ReadStyle style);
+ TAGLIB_DEPRECATED Properties(const ByteVector &data, ReadStyle style);
/*!
* Create an instance of AIFF::Properties with the data read from the
@@ -73,7 +73,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
@@ -119,7 +119,7 @@ namespace TagLib {
*
* \deprecated
*/
- int sampleWidth() const;
+ TAGLIB_DEPRECATED int sampleWidth() const;
/*!
* Returns the number of sample frames
diff --git a/taglib/riff/wav/wavproperties.h b/taglib/riff/wav/wavproperties.h
index 6716876a..1ca73100 100644
--- a/taglib/riff/wav/wavproperties.h
+++ b/taglib/riff/wav/wavproperties.h
@@ -55,7 +55,7 @@ namespace TagLib {
*
* \deprecated
*/
- Properties(const ByteVector &data, ReadStyle style);
+ TAGLIB_DEPRECATED Properties(const ByteVector &data, ReadStyle style);
/*!
* Create an instance of WAV::Properties with the data read from the
@@ -63,7 +63,7 @@ namespace TagLib {
*
* \deprecated
*/
- Properties(const ByteVector &data, unsigned int streamLength, ReadStyle style);
+ TAGLIB_DEPRECATED Properties(const ByteVector &data, unsigned int streamLength, ReadStyle style);
/*!
* Create an instance of WAV::Properties with the data read from the
@@ -84,7 +84,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
@@ -130,7 +130,7 @@ namespace TagLib {
*
* \deprecated
*/
- int sampleWidth() const;
+ TAGLIB_DEPRECATED int sampleWidth() const;
/*!
* Returns the number of sample frames.
diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h
index 6b029974..450d8a32 100644
--- a/taglib/toolkit/taglib.h
+++ b/taglib/toolkit/taglib.h
@@ -44,6 +44,14 @@
#define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long>(x)
#endif
+#if __cplusplus >= 201402
+#define TAGLIB_DEPRECATED [[deprecated]]
+#elif defined(__GNUC__) || defined(__clang__)
+#define TAGLIB_DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define TAGLIB_DEPRECATED __declspec(deprecated)
+#endif
+
#include <string>
//! A namespace for all TagLib related classes and functions
diff --git a/taglib/toolkit/tbytevector.h b/taglib/toolkit/tbytevector.h
index e1549bb9..41373c72 100644
--- a/taglib/toolkit/tbytevector.h
+++ b/taglib/toolkit/tbytevector.h
@@ -281,7 +281,7 @@ namespace TagLib {
* \deprecated
*/
// BIC: remove
- bool isNull() const;
+ TAGLIB_DEPRECATED bool isNull() const;
/*!
* Returns true if the ByteVector is empty.
@@ -595,7 +595,7 @@ namespace TagLib {
* \deprecated
*/
// BIC: remove
- static ByteVector null;
+ TAGLIB_DEPRECATED static ByteVector null;
/*!
* Returns a hex-encoded copy of the byte vector.
diff --git a/taglib/toolkit/tfile.h b/taglib/toolkit/tfile.h
index c9a9d37e..3b6ff621 100644
--- a/taglib/toolkit/tfile.h
+++ b/taglib/toolkit/tfile.h
@@ -264,14 +264,14 @@ namespace TagLib {
*
* \deprecated
*/
- static bool isReadable(const char *file);
+ TAGLIB_DEPRECATED static bool isReadable(const char *file);
/*!
* Returns true if \a file can be opened for writing.
*
* \deprecated
*/
- static bool isWritable(const char *name);
+ TAGLIB_DEPRECATED static bool isWritable(const char *name);
protected:
/*!
diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h
index b1be04b8..7028aab2 100644
--- a/taglib/toolkit/tstring.h
+++ b/taglib/toolkit/tstring.h
@@ -340,7 +340,7 @@ namespace TagLib {
* \deprecated
*/
// BIC: remove
- bool isNull() const;
+ TAGLIB_DEPRECATED bool isNull() const;
/*!
* Returns a ByteVector containing the string's data. If \a t is Latin1 or
@@ -525,7 +525,7 @@ namespace TagLib {
* \deprecated
*/
// BIC: remove
- static String null;
+ TAGLIB_DEPRECATED static String null;
protected:
/*!
@@ -541,7 +541,7 @@ namespace TagLib {
* may lead to a linkage error.
*/
// BIC: remove
- static const Type WCharByteOrder;
+ TAGLIB_DEPRECATED static const Type WCharByteOrder;
class StringPrivate;
StringPrivate *d;
diff --git a/taglib/trueaudio/trueaudiofile.h b/taglib/trueaudio/trueaudiofile.h
index 3737ac63..1f664d25 100644
--- a/taglib/trueaudio/trueaudiofile.h
+++ b/taglib/trueaudio/trueaudiofile.h
@@ -166,7 +166,7 @@ namespace TagLib {
* \see ID3v2FrameFactory
* \deprecated This value should be passed in via the constructor
*/
- void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
+ TAGLIB_DEPRECATED void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
/*!
* Saves the file.
diff --git a/taglib/trueaudio/trueaudioproperties.h b/taglib/trueaudio/trueaudioproperties.h
index 8dfcf375..d25c7a77 100644
--- a/taglib/trueaudio/trueaudioproperties.h
+++ b/taglib/trueaudio/trueaudioproperties.h
@@ -69,7 +69,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/taglib/wavpack/wavpackproperties.h b/taglib/wavpack/wavpackproperties.h
index 0f5d1dcb..e6acdcc3 100644
--- a/taglib/wavpack/wavpackproperties.h
+++ b/taglib/wavpack/wavpackproperties.h
@@ -58,12 +58,12 @@ namespace TagLib {
* \deprecated This constructor will be dropped in favor of the one below
* in a future version.
*/
- Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
+ TAGLIB_DEPRECATED Properties(const ByteVector &data, long streamLength,
+ ReadStyle style = Average);
/*!
* Create an instance of WavPack::Properties.
*/
- // BIC: merge with the above constructor
Properties(File *file, long streamLength, ReadStyle style = Average);
/*!
@@ -79,7 +79,7 @@ namespace TagLib {
*
* \deprecated
*/
- virtual int length() const;
+ TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
diff --git a/tests/test_aiff.cpp b/tests/test_aiff.cpp
index 9619b1d8..cc7df9aa 100644
--- a/tests/test_aiff.cpp
+++ b/tests/test_aiff.cpp
@@ -51,14 +51,12 @@ public:
{
RIFF::AIFF::File f(TEST_FILE_PATH_C("empty.aiff"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(67, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(706, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(2941U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(false, f.audioProperties()->isAiffC());
}
@@ -67,14 +65,12 @@ public:
{
RIFF::AIFF::File f(TEST_FILE_PATH_C("alaw.aifc"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(37, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(355, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(1622U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(true, f.audioProperties()->isAiffC());
CPPUNIT_ASSERT_EQUAL(ByteVector("ALAW"), f.audioProperties()->compressionType());
diff --git a/tests/test_ape.cpp b/tests/test_ape.cpp
index 81f4425d..8c120483 100644
--- a/tests/test_ape.cpp
+++ b/tests/test_ape.cpp
@@ -57,7 +57,6 @@ public:
{
APE::File f(TEST_FILE_PATH_C("mac-399.ape"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(192, f.audioProperties()->bitrate());
@@ -72,7 +71,6 @@ public:
{
APE::File f(TEST_FILE_PATH_C("mac-399-tagged.ape"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(192, f.audioProperties()->bitrate());
@@ -87,7 +85,6 @@ public:
{
APE::File f(TEST_FILE_PATH_C("mac-399-id3v2.ape"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(192, f.audioProperties()->bitrate());
@@ -102,7 +99,6 @@ public:
{
APE::File f(TEST_FILE_PATH_C("mac-396.ape"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3685, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
@@ -117,7 +113,6 @@ public:
{
APE::File f(TEST_FILE_PATH_C("mac-390-hdr.ape"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(15, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(15, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(15630, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
diff --git a/tests/test_asf.cpp b/tests/test_asf.cpp
index 3f0eff63..e9b8dab7 100644
--- a/tests/test_asf.cpp
+++ b/tests/test_asf.cpp
@@ -59,7 +59,6 @@ public:
{
ASF::File f(TEST_FILE_PATH_C("silence-1.wma"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3712, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->bitrate());
@@ -76,7 +75,6 @@ public:
{
ASF::File f(TEST_FILE_PATH_C("lossless.wma"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3549, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(1152, f.audioProperties()->bitrate());
diff --git a/tests/test_bytevector.cpp b/tests/test_bytevector.cpp
index f03dda1a..26cde765 100644
--- a/tests/test_bytevector.cpp
+++ b/tests/test_bytevector.cpp
@@ -77,7 +77,6 @@ public:
i.clear();
CPPUNIT_ASSERT(i.isEmpty());
- CPPUNIT_ASSERT(!i.isNull()); // deprecated, but worth it to check.
}
void testFind1()
diff --git a/tests/test_flac.cpp b/tests/test_flac.cpp
index 5bae7d88..0cc2b7ec 100644
--- a/tests/test_flac.cpp
+++ b/tests/test_flac.cpp
@@ -326,14 +326,12 @@ public:
{
FLAC::File f(TEST_FILE_PATH_C("sinewave.flac"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(145, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(156556ULL, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(
ByteVector("\xcf\xe3\xd9\xda\xba\xde\xab\x2c\xbf\x2c\xa2\x35\x27\x4b\x7f\x76"),
diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp
index d42907a5..6e5452ba 100644
--- a/tests/test_id3v2.cpp
+++ b/tests/test_id3v2.cpp
@@ -251,8 +251,10 @@ public:
"\x01"
"d\x00"
"\x00", 14);
+ ID3v2::Header header;
+ header.setMajorVersion(2);
ID3v2::AttachedPictureFrame *frame =
- dynamic_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, (unsigned int)2));
+ dynamic_cast<TagLib::ID3v2::AttachedPictureFrame *>(factory->createFrame(data, &header));
CPPUNIT_ASSERT(frame);
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), frame->mimeType());
@@ -272,8 +274,10 @@ public:
"\x01"
"d\x00"
"\x00", 14);
+ ID3v2::Header header;
+ header.setMajorVersion(2);
ID3v2::UnknownFrame *frame =
- dynamic_cast<TagLib::ID3v2::UnknownFrame*>(factory->createFrame(data, (unsigned int)2));
+ dynamic_cast<TagLib::ID3v2::UnknownFrame*>(factory->createFrame(data, &header));
CPPUNIT_ASSERT(frame);
@@ -665,8 +669,10 @@ public:
"\x00\x00" // Frame flags
"\x00" // Encoding
"(22)Death Metal", 26); // Text
+ ID3v2::Header header;
+ header.setMajorVersion(3);
ID3v2::TextIdentificationFrame *frame =
- dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)3));
+ 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]);
@@ -684,8 +690,10 @@ public:
"\x00\x00" // Frame flags
"\x00" // Encoding
"(4)Eurodisco", 23); // Text
+ ID3v2::Header header;
+ header.setMajorVersion(3);
ID3v2::TextIdentificationFrame *frame =
- dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)3));
+ 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]);
@@ -703,8 +711,9 @@ public:
"\x00\x00" // Frame flags
"\0" // Encoding
"14\0Eurodisco", 23); // Text
+ ID3v2::Header header;
ID3v2::TextIdentificationFrame *frame =
- dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)4));
+ 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]);
@@ -954,10 +963,13 @@ public:
CPPUNIT_ASSERT_EQUAL(frameDataMvin, frameMvin->render());
ID3v2::FrameFactory *factory = ID3v2::FrameFactory::instance();
+ ID3v2::Header header;
ID3v2::TextIdentificationFrame *parsedFrameMvnm =
- dynamic_cast<ID3v2::TextIdentificationFrame *>(factory->createFrame(frameDataMvnm));
+ dynamic_cast<ID3v2::TextIdentificationFrame *>(
+ factory->createFrame(frameDataMvnm, &header));
ID3v2::TextIdentificationFrame *parsedFrameMvin =
- dynamic_cast<ID3v2::TextIdentificationFrame *>(factory->createFrame(frameDataMvin));
+ dynamic_cast<ID3v2::TextIdentificationFrame *>(
+ factory->createFrame(frameDataMvin, &header));
CPPUNIT_ASSERT(parsedFrameMvnm);
CPPUNIT_ASSERT(parsedFrameMvin);
CPPUNIT_ASSERT_EQUAL(String("Movement Name"), parsedFrameMvnm->toString());
@@ -986,8 +998,10 @@ public:
CPPUNIT_ASSERT_EQUAL(frameDataGrp1, frameGrp1->render());
ID3v2::FrameFactory *factory = ID3v2::FrameFactory::instance();
+ ID3v2::Header header;
ID3v2::TextIdentificationFrame *parsedFrameGrp1 =
- dynamic_cast<ID3v2::TextIdentificationFrame *>(factory->createFrame(frameDataGrp1));
+ dynamic_cast<ID3v2::TextIdentificationFrame *>(
+ factory->createFrame(frameDataGrp1, &header));
CPPUNIT_ASSERT(parsedFrameGrp1);
CPPUNIT_ASSERT_EQUAL(String("Grouping"), parsedFrameGrp1->toString());
@@ -1210,14 +1224,14 @@ public:
{
MPEG::File f(newname.c_str());
f.ID3v2Tag()->setTitle(longText(64 * 1024));
- f.save(MPEG::File::ID3v2, true);
+ f.save(MPEG::File::ID3v2, File::StripOthers);
}
{
MPEG::File f(newname.c_str());
CPPUNIT_ASSERT(f.hasID3v2Tag());
CPPUNIT_ASSERT_EQUAL(74789L, f.length());
f.ID3v2Tag()->setTitle("ABCDEFGHIJ");
- f.save(MPEG::File::ID3v2, true);
+ f.save(MPEG::File::ID3v2, File::StripOthers);
}
{
MPEG::File f(newname.c_str());
diff --git a/tests/test_mp4.cpp b/tests/test_mp4.cpp
index c8d65723..05bf6bd3 100644
--- a/tests/test_mp4.cpp
+++ b/tests/test_mp4.cpp
@@ -67,7 +67,6 @@ public:
{
MP4::File f(TEST_FILE_PATH_C("has-tags.m4a"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3708, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->bitrate());
@@ -82,7 +81,6 @@ public:
{
MP4::File f(TEST_FILE_PATH_C("empty_alac.m4a"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3705, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->bitrate());
@@ -97,7 +95,6 @@ public:
{
MP4::File f(TEST_FILE_PATH_C("blank_video.m4v"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(975, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(96, f.audioProperties()->bitrate());
diff --git a/tests/test_mpc.cpp b/tests/test_mpc.cpp
index d8ed984e..059e521f 100644
--- a/tests/test_mpc.cpp
+++ b/tests/test_mpc.cpp
@@ -59,7 +59,6 @@ public:
MPC::File f(TEST_FILE_PATH_C("sv8_header.mpc"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->mpcVersion());
- CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(1497, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->bitrate());
@@ -73,7 +72,6 @@ public:
MPC::File f(TEST_FILE_PATH_C("click.mpc"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(7, f.audioProperties()->mpcVersion());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(40, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(318, f.audioProperties()->bitrate());
@@ -91,7 +89,6 @@ public:
MPC::File f(TEST_FILE_PATH_C("sv5_header.mpc"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(5, f.audioProperties()->mpcVersion());
- CPPUNIT_ASSERT_EQUAL(26, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(26, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(26371, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
@@ -105,7 +102,6 @@ public:
MPC::File f(TEST_FILE_PATH_C("sv4_header.mpc"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(4, f.audioProperties()->mpcVersion());
- CPPUNIT_ASSERT_EQUAL(26, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(26, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(26371, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
diff --git a/tests/test_mpeg.cpp b/tests/test_mpeg.cpp
index 45d60ece..240231a4 100644
--- a/tests/test_mpeg.cpp
+++ b/tests/test_mpeg.cpp
@@ -73,7 +73,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("lame_cbr.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(1887, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(1887, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(1887164, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->bitrate());
@@ -86,7 +85,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("lame_vbr.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(1887, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(1887, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(1887164, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(70, f.audioProperties()->bitrate());
@@ -99,7 +97,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("rare_frames.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(222, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(222, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(222198, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(233, f.audioProperties()->bitrate());
@@ -112,7 +109,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("bladeenc.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3553, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->bitrate());
@@ -131,7 +127,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("invalid-frames1.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(392, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(160, f.audioProperties()->bitrate());
@@ -144,7 +139,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("invalid-frames2.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(314, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(192, f.audioProperties()->bitrate());
@@ -157,7 +151,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("invalid-frames3.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(183, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(320, f.audioProperties()->bitrate());
@@ -170,7 +163,6 @@ public:
{
MPEG::File f(TEST_FILE_PATH_C("mpeg2.mp3"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(5387, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(5387, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(5387285, f.audioProperties()->lengthInMilliseconds());
}
diff --git a/tests/test_ogg.cpp b/tests/test_ogg.cpp
index ebb865fd..6564a247 100644
--- a/tests/test_ogg.cpp
+++ b/tests/test_ogg.cpp
@@ -188,7 +188,6 @@ public:
{
Ogg::Vorbis::File f(TEST_FILE_PATH_C("empty.ogg"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3685, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->bitrate());
diff --git a/tests/test_opus.cpp b/tests/test_opus.cpp
index cdf77eae..9a49d239 100644
--- a/tests/test_opus.cpp
+++ b/tests/test_opus.cpp
@@ -50,7 +50,6 @@ public:
{
Ogg::Opus::File f(TEST_FILE_PATH_C("correctness_gain_silent_output.opus"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(7, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(7, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(7737, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(36, f.audioProperties()->bitrate());
diff --git a/tests/test_speex.cpp b/tests/test_speex.cpp
index 7c0f9dc7..1f5bb754 100644
--- a/tests/test_speex.cpp
+++ b/tests/test_speex.cpp
@@ -44,7 +44,6 @@ public:
{
Ogg::Speex::File f(TEST_FILE_PATH_C("empty.spx"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3685, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(53, f.audioProperties()->bitrate());
diff --git a/tests/test_string.cpp b/tests/test_string.cpp
index 6f00b62d..7b60b814 100644
--- a/tests/test_string.cpp
+++ b/tests/test_string.cpp
@@ -75,7 +75,6 @@ public:
s.clear();
CPPUNIT_ASSERT(s.isEmpty());
- CPPUNIT_ASSERT(!s.isNull()); // deprecated, but still worth it to check.
String unicode("José Carlos", String::UTF8);
CPPUNIT_ASSERT(strcmp(unicode.toCString(), "Jos\xe9 Carlos") == 0);
diff --git a/tests/test_trueaudio.cpp b/tests/test_trueaudio.cpp
index 81393ff3..2a040367 100644
--- a/tests/test_trueaudio.cpp
+++ b/tests/test_trueaudio.cpp
@@ -50,7 +50,6 @@ public:
{
TrueAudio::File f(TEST_FILE_PATH_C("empty.tta"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3685, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(173, f.audioProperties()->bitrate());
@@ -65,7 +64,6 @@ public:
{
TrueAudio::File f(TEST_FILE_PATH_C("tagged.tta"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3685, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(173, f.audioProperties()->bitrate());
diff --git a/tests/test_wav.cpp b/tests/test_wav.cpp
index 7520cf00..8e96795f 100644
--- a/tests/test_wav.cpp
+++ b/tests/test_wav.cpp
@@ -59,14 +59,12 @@ public:
{
RIFF::WAV::File f(TEST_FILE_PATH_C("empty.wav"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3675, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(32, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(1000, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(3675U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->format());
}
@@ -75,14 +73,12 @@ public:
{
RIFF::WAV::File f(TEST_FILE_PATH_C("alaw.wav"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(128, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(8000, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(28400U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(6, f.audioProperties()->format());
}
@@ -91,14 +87,12 @@ public:
{
RIFF::WAV::File f(TEST_FILE_PATH_C("float64.wav"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(97, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(5645, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(4281U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->format());
}
@@ -277,14 +271,12 @@ public:
{
RIFF::WAV::File f(TEST_FILE_PATH_C("pcm_with_fact_chunk.wav"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3675, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(32, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(1000, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
- CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->sampleWidth());
CPPUNIT_ASSERT_EQUAL(3675U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->format());
}
diff --git a/tests/test_wavpack.cpp b/tests/test_wavpack.cpp
index 65a27c76..6c64f08d 100644
--- a/tests/test_wavpack.cpp
+++ b/tests/test_wavpack.cpp
@@ -53,7 +53,6 @@ public:
{
WavPack::File f(TEST_FILE_PATH_C("no_length.wv"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3705, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->bitrate());
@@ -69,7 +68,6 @@ public:
{
WavPack::File f(TEST_FILE_PATH_C("four_channels.wv"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3833, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(112, f.audioProperties()->bitrate());
@@ -85,7 +83,6 @@ public:
{
WavPack::File f(TEST_FILE_PATH_C("tagged.wv"));
CPPUNIT_ASSERT(f.audioProperties());
- CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(172, f.audioProperties()->bitrate());