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
This commit is contained in:
Scott Wheeler 2019-09-11 00:37:02 +02:00
parent b8dc105ae3
commit c05fa78406
53 changed files with 114 additions and 124 deletions

View File

@ -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

View File

@ -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

View File

@ -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;
/*!

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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 &);

View File

@ -126,6 +126,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();
@ -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;
}

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 &);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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:
/*!

View File

@ -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;

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -77,7 +77,6 @@ public:
i.clear();
CPPUNIT_ASSERT(i.isEmpty());
CPPUNIT_ASSERT(!i.isNull()); // deprecated, but worth it to check.
}
void testFind1()

View File

@ -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"),

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());
}

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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);

View File

@ -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());

View File

@ -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());
}

View File

@ -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());