This won't break the ABI compatibility.
}
long APELocation;
- uint APESize;
+ unsigned int APESize;
long ID3v1Location;
ID3v2::Header *ID3v2Header;
long ID3v2Location;
- uint ID3v2Size;
+ unsigned int ID3v2Size;
TagUnion tag;
itemCount(0),
tagSize(0) {}
- uint version;
+ unsigned int version;
bool footerPresent;
bool headerPresent;
bool isHeader;
- uint itemCount;
- uint tagSize;
+ unsigned int itemCount;
+ unsigned int tagSize;
};
////////////////////////////////////////////////////////////////////////////////
// static members
////////////////////////////////////////////////////////////////////////////////
-TagLib::uint APE::Footer::size()
+unsigned int APE::Footer::size()
{
return 32;
}
delete d;
}
-TagLib::uint APE::Footer::version() const
+unsigned int APE::Footer::version() const
{
return d->version;
}
d->headerPresent = b;
}
-TagLib::uint APE::Footer::itemCount() const
+unsigned int APE::Footer::itemCount() const
{
return d->itemCount;
}
-void APE::Footer::setItemCount(uint s)
+void APE::Footer::setItemCount(unsigned int s)
{
d->itemCount = s;
}
-TagLib::uint APE::Footer::tagSize() const
+unsigned int APE::Footer::tagSize() const
{
return d->tagSize;
}
-TagLib::uint APE::Footer::completeTagSize() const
+unsigned int APE::Footer::completeTagSize() const
{
if(d->headerPresent)
return d->tagSize + size();
return d->tagSize;
}
-void APE::Footer::setTagSize(uint s)
+void APE::Footer::setTagSize(unsigned int s)
{
d->tagSize = s;
}
/*!
* Returns the version number. (Note: This is the 1000 or 2000.)
*/
- uint version() const;
+ unsigned int version() const;
/*!
* Returns true if a header is present in the tag.
/*!
* Returns the number of items in the tag.
*/
- uint itemCount() const;
+ unsigned int itemCount() const;
/*!
* Set the item count to \a s.
* \see itemCount()
*/
- void setItemCount(uint s);
+ void setItemCount(unsigned int s);
/*!
* Returns the tag size in bytes. This is the size of the frame content and footer.
*
* \see completeTagSize()
*/
- uint tagSize() const;
+ unsigned int tagSize() const;
/*!
* Returns the tag size, including if present, the header
*
* \see tagSize()
*/
- uint completeTagSize() const;
+ unsigned int completeTagSize() const;
/*!
* Set the tag size to \a s.
* \see tagSize()
*/
- void setTagSize(uint s);
+ void setTagSize(unsigned int s);
/*!
* Returns the size of the footer. Presently this is always 32 bytes.
*/
- static uint size();
+ static unsigned int size();
/*!
* Returns the string used to identify an APE tag inside of a file.
return;
}
- const uint valueLength = data.toUInt(0, false);
- const uint flags = data.toUInt(4, false);
+ const unsigned int valueLength = data.toUInt(0, false);
+ const unsigned int flags = data.toUInt(4, false);
d->key = String(data.mid(8), String::UTF8);
ByteVector APE::Item::render() const
{
ByteVector data;
- TagLib::uint flags = ((d->readOnly) ? 1 : 0) | (d->type << 1);
+ unsigned int flags = ((d->readOnly) ? 1 : 0) | (d->type << 1);
ByteVector value;
if(isEmpty())
int channels;
int version;
int bitsPerSample;
- uint sampleFrames;
+ unsigned int sampleFrames;
};
////////////////////////////////////////////////////////////////////////////////
return d->bitsPerSample;
}
-TagLib::uint APE::Properties::sampleFrames() const
+unsigned int APE::Properties::sampleFrames() const
{
return d->sampleFrames;
}
return;
}
- const uint descriptorBytes = descriptor.toUInt(0, false);
+ const unsigned int descriptorBytes = descriptor.toUInt(0, false);
if((descriptorBytes - 52) > 0)
file->seek(descriptorBytes - 52, File::Current);
d->sampleRate = header.toUInt(20, false);
d->bitsPerSample = header.toShort(16, false);
- const uint totalFrames = header.toUInt(12, false);
+ const unsigned int totalFrames = header.toUInt(12, false);
if(totalFrames == 0)
return;
- const uint blocksPerFrame = header.toUInt(4, false);
- const uint finalFrameBlocks = header.toUInt(8, false);
+ const unsigned int blocksPerFrame = header.toUInt(4, false);
+ const unsigned int finalFrameBlocks = header.toUInt(8, false);
d->sampleFrames = (totalFrames - 1) * blocksPerFrame + finalFrameBlocks;
}
return;
}
- const uint totalFrames = header.toUInt(18, false);
+ const unsigned int totalFrames = header.toUInt(18, false);
// Fail on 0 length APE files (catches non-finalized APE files)
if(totalFrames == 0)
return;
const short compressionLevel = header.toShort(0, false);
- uint blocksPerFrame;
+ unsigned int blocksPerFrame;
if(d->version >= 3950)
blocksPerFrame = 73728 * 4;
else if(d->version >= 3900 || (d->version >= 3800 && compressionLevel == 4000))
d->channels = header.toShort(4, false);
d->sampleRate = header.toUInt(6, false);
- const uint finalFrameBlocks = header.toUInt(22, false);
+ const unsigned int finalFrameBlocks = header.toUInt(22, false);
d->sampleFrames = (totalFrames - 1) * blocksPerFrame + finalFrameBlocks;
// Get the bit depth from the RIFF-fmt chunk.
/*!
* Returns the total number of audio samples in file.
*/
- uint sampleFrames() const;
+ unsigned int sampleFrames() const;
/*!
* Returns APE version.
return d->itemListMap["GENRE"].values().toString();
}
-TagLib::uint APE::Tag::year() const
+unsigned int APE::Tag::year() const
{
if(d->itemListMap["YEAR"].isEmpty())
return 0;
return d->itemListMap["YEAR"].toString().toInt();
}
-TagLib::uint APE::Tag::track() const
+unsigned int APE::Tag::track() const
{
if(d->itemListMap["TRACK"].isEmpty())
return 0;
addValue("GENRE", s, true);
}
-void APE::Tag::setYear(uint i)
+void APE::Tag::setYear(unsigned int i)
{
if(i <= 0)
removeItem("YEAR");
addValue("YEAR", String::number(i), true);
}
-void APE::Tag::setTrack(uint i)
+void APE::Tag::setTrack(unsigned int i)
{
if(i <= 0)
removeItem("TRACK");
PropertyMap properties(origProps); // make a local copy that can be modified
// see comment in properties()
- for(uint i = 0; i < keyConversionsSize; ++i)
+ for(size_t i = 0; i < keyConversionsSize; ++i)
if(properties.contains(keyConversions[i][0])) {
properties.insert(keyConversions[i][1], properties[keyConversions[i][0]]);
properties.erase(keyConversions[i][0]);
d->footer.setData(file->readBlock(Footer::size()));
if(d->footer.tagSize() <= Footer::size() ||
- d->footer.tagSize() > uint(file->length()))
+ d->footer.tagSize() > static_cast<unsigned long>(file->length()))
return;
file->seek(footerLocation + Footer::size() - d->footer.tagSize());
ByteVector APE::Tag::render() const
{
ByteVector data;
- uint itemCount = 0;
+ unsigned int itemCount = 0;
for(ItemListMap::ConstIterator it = d->itemListMap.begin(); it != d->itemListMap.end(); ++it) {
data.append(it->second.render());
if(data.size() < 11)
return;
- uint pos = 0;
+ unsigned int pos = 0;
- for(uint i = 0; i < d->footer.itemCount() && pos <= data.size() - 11; i++) {
+ for(unsigned int i = 0; i < d->footer.itemCount() && pos <= data.size() - 11; i++) {
APE::Item item;
item.parse(data.mid(pos));
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual uint year() const;
- virtual uint track() const;
+ virtual unsigned int year() const;
+ virtual unsigned int track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(uint i);
- virtual void setTrack(uint i);
+ virtual void setYear(unsigned int i);
+ virtual void setTrack(unsigned int i);
/*!
* Implements the unified tag dictionary interface -- export function.
String ASF::Attribute::parse(ASF::File &f, int kind)
{
- uint size, nameLength;
+ unsigned int size, nameLength;
String name;
d->pictureValue = Picture::fromInvalid();
// extended content descriptor
{
public:
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
};
class ASF::File::FilePrivate::StreamPropertiesObject : public ASF::File::FilePrivate::BaseObject
{
public:
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
};
class ASF::File::FilePrivate::ContentDescriptionObject : public ASF::File::FilePrivate::BaseObject
{
public:
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
};
public:
ByteVectorList attributeData;
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
};
public:
ByteVectorList attributeData;
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
};
public:
ByteVectorList attributeData;
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
};
List<ASF::File::FilePrivate::BaseObject *> objects;
HeaderExtensionObject();
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
};
{
public:
ByteVector guid() const;
- void parse(ASF::File *file, uint size);
+ void parse(ASF::File *file, unsigned int size);
private:
enum CodecType
return filePropertiesGuid;
}
-void ASF::File::FilePrivate::FilePropertiesObject::parse(ASF::File *file, uint size)
+void ASF::File::FilePrivate::FilePropertiesObject::parse(ASF::File *file, unsigned int size)
{
BaseObject::parse(file, size);
if(data.size() < 64) {
return streamPropertiesGuid;
}
-void ASF::File::FilePrivate::StreamPropertiesObject::parse(ASF::File *file, uint size)
+void ASF::File::FilePrivate::StreamPropertiesObject::parse(ASF::File *file, unsigned int size)
{
BaseObject::parse(file, size);
if(data.size() < 70) {
return contentDescriptionGuid;
}
-void ASF::File::FilePrivate::ContentDescriptionObject::parse(ASF::File *file, uint /*size*/)
+void ASF::File::FilePrivate::ContentDescriptionObject::parse(ASF::File *file, unsigned int /*size*/)
{
file->d->contentDescriptionObject = this;
const int titleLength = readWORD(file);
return extendedContentDescriptionGuid;
}
-void ASF::File::FilePrivate::ExtendedContentDescriptionObject::parse(ASF::File *file, uint /*size*/)
+void ASF::File::FilePrivate::ExtendedContentDescriptionObject::parse(ASF::File *file, unsigned int /*size*/)
{
file->d->extendedContentDescriptionObject = this;
int count = readWORD(file);
return metadataGuid;
}
-void ASF::File::FilePrivate::MetadataObject::parse(ASF::File *file, uint /*size*/)
+void ASF::File::FilePrivate::MetadataObject::parse(ASF::File *file, unsigned int /*size*/)
{
file->d->metadataObject = this;
int count = readWORD(file);
return metadataLibraryGuid;
}
-void ASF::File::FilePrivate::MetadataLibraryObject::parse(ASF::File *file, uint /*size*/)
+void ASF::File::FilePrivate::MetadataLibraryObject::parse(ASF::File *file, unsigned int /*size*/)
{
file->d->metadataLibraryObject = this;
int count = readWORD(file);
return headerExtensionGuid;
}
-void ASF::File::FilePrivate::HeaderExtensionObject::parse(ASF::File *file, uint /*size*/)
+void ASF::File::FilePrivate::HeaderExtensionObject::parse(ASF::File *file, unsigned int /*size*/)
{
file->d->headerExtensionObject = this;
file->seek(18, File::Current);
return codecListGuid;
}
-void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, uint size)
+void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, unsigned int size)
{
BaseObject::parse(file, size);
if(data.size() <= 20) {
return;
}
- uint pos = 16;
+ unsigned int pos = 16;
const int count = data.toUInt(pos, false);
pos += 4;
int nameLength = data.toUShort(pos, false);
pos += 2;
- const uint namePos = pos;
+ const unsigned int namePos = pos;
pos += nameLength * 2;
const int descLength = data.toUShort(pos, false);
pos += 2;
- const uint descPos = pos;
+ const unsigned int descPos = pos;
pos += descLength * 2;
const int infoLength = data.toUShort(pos, false);
return;
int pos = 0;
d->type = (Type)bytes[0]; ++pos;
- const uint dataLen = bytes.toUInt(pos, false); pos+=4;
+ const unsigned int dataLen = bytes.toUInt(pos, false); pos+=4;
const ByteVector nullStringTerminator(2, 0);
setAttribute("WM/Genre", value);
}
-void ASF::Tag::setYear(uint value)
+void ASF::Tag::setYear(unsigned int value)
{
setAttribute("WM/Year", String::number(value));
}
-void ASF::Tag::setTrack(uint value)
+void ASF::Tag::setTrack(unsigned int value)
{
setAttribute("WM/TrackNumber", String::number(value));
}
/*!
* Returns the year; if there is no year set, this will return 0.
*/
- virtual uint year() const;
+ virtual unsigned int year() const;
/*!
* Returns the track number; if there is no track number set, this will
* return 0.
*/
- virtual uint track() const;
+ virtual unsigned int track() const;
/*!
* Sets the title to \a s.
/*!
* Sets the year to \a i. If \a s is 0 then this value will be cleared.
*/
- virtual void setYear(uint i);
+ virtual void setYear(unsigned int i);
/*!
* Sets the track to \a i. If \a s is 0 then this value will be cleared.
*/
- virtual void setTrack(uint i);
+ virtual void setTrack(unsigned int i);
/*!
* Returns true if the tag does not contain any data. This should be
return v.toUShort(false);
}
- inline uint readDWORD(File *file, bool *ok = 0)
+ inline unsigned int readDWORD(File *file, bool *ok = 0)
{
const ByteVector v = file->readBlock(4);
if(v.size() != 4) {
~FilePrivate()
{
- uint size = blocks.size();
- for(uint i = 0; i < size; i++) {
+ unsigned int size = blocks.size();
+ for(unsigned int i = 0; i < size; i++) {
delete blocks[i];
}
delete properties;
const ID3v2::FrameFactory *ID3v2FrameFactory;
long ID3v2Location;
- uint ID3v2OriginalSize;
+ unsigned int ID3v2OriginalSize;
long ID3v1Location;
bool foundVorbisCommentBlock = false;
List<MetadataBlock *> newBlocks;
- for(uint i = 0; i < d->blocks.size(); i++) {
+ for(unsigned int i = 0; i < d->blocks.size(); i++) {
MetadataBlock *block = d->blocks[i];
if(block->code() == MetadataBlock::VorbisComment) {
// Set the new Vorbis Comment block
// Render data for the metadata blocks
ByteVector data;
- for(uint i = 0; i < newBlocks.size(); i++) {
+ for(unsigned int i = 0; i < newBlocks.size(); i++) {
FLAC::MetadataBlock *block = newBlocks[i];
ByteVector blockData = block->render();
ByteVector blockHeader = ByteVector::fromUInt(blockData.size());
List<FLAC::Picture *> FLAC::File::pictureList()
{
List<Picture *> pictures;
- for(uint i = 0; i < d->blocks.size(); i++) {
+ for(unsigned int i = 0; i < d->blocks.size(); i++) {
Picture *picture = dynamic_cast<Picture *>(d->blocks[i]);
if(picture) {
pictures.append(picture);
void FLAC::File::removePictures()
{
List<MetadataBlock *> newBlocks;
- for(uint i = 0; i < d->blocks.size(); i++) {
+ for(unsigned int i = 0; i < d->blocks.size(); i++) {
Picture *picture = dynamic_cast<Picture *>(d->blocks[i]);
if(picture) {
delete picture;
char blockType = header[0] & 0x7f;
bool isLastBlock = (header[0] & 0x80) != 0;
- uint length = header.toUInt(1U, 3U);
+ unsigned int length = header.toUInt(1U, 3U);
// First block should be the stream_info metadata
return false;
}
- uint pos = 0;
+ unsigned int pos = 0;
d->type = FLAC::Picture::Type(data.toUInt(pos));
pos += 4;
- uint mimeTypeLength = data.toUInt(pos);
+ unsigned int mimeTypeLength = data.toUInt(pos);
pos += 4;
if(pos + mimeTypeLength + 24 > data.size()) {
debug("Invalid picture block.");
}
d->mimeType = String(data.mid(pos, mimeTypeLength), String::UTF8);
pos += mimeTypeLength;
- uint descriptionLength = data.toUInt(pos);
+ unsigned int descriptionLength = data.toUInt(pos);
pos += 4;
if(pos + descriptionLength + 20 > data.size()) {
debug("Invalid picture block.");
pos += 4;
d->numColors = data.toUInt(pos);
pos += 4;
- uint dataLength = data.toUInt(pos);
+ unsigned int dataLength = data.toUInt(pos);
pos += 4;
if(pos + dataLength > data.size()) {
debug("Invalid picture block.");
return;
}
- uint pos = 0;
+ unsigned int pos = 0;
// Minimum block size (in samples)
pos += 2;
// Maximum frame size (in bytes)
pos += 3;
- const uint flags = data.toUInt(pos, true);
+ const unsigned int flags = data.toUInt(pos, true);
pos += 4;
d->sampleRate = flags >> 12;
seek(sampleOffset + 20);
- if((TagLib::uint)(i + instrumentCount) < lines.size())
+ if((unsigned int)(i + instrumentCount) < lines.size())
writeString(lines[i + instrumentCount], 25);
else
writeString(String(), 25);
// write rest as message:
StringList messageLines;
- for(uint i = instrumentCount + sampleCount; i < lines.size(); ++ i)
+ for(unsigned int i = instrumentCount + sampleCount; i < lines.size(); ++ i)
messageLines.append(lines[i]);
ByteVector message = messageLines.toString("\r").data(String::Latin1);
seek(0);
writeString(d->tag.title(), 20);
StringList lines = d->tag.comment().split("\n");
- uint n = std::min(lines.size(), d->properties.instrumentCount());
- for(uint i = 0; i < n; ++ i) {
+ unsigned int n = std::min(lines.size(), d->properties.instrumentCount());
+ for(unsigned int i = 0; i < n; ++ i) {
writeString(lines[i], 22);
seek(8, Current);
}
- for(uint i = n; i < d->properties.instrumentCount(); ++ i) {
+ for(unsigned int i = n; i < d->properties.instrumentCount(); ++ i) {
writeString(String(), 22);
seek(8, Current);
}
ByteVector modId = readBlock(4);
READ_ASSERT(modId.size() == 4);
- int channels = 4;
- uint instruments = 31;
+ int channels = 4;
+ unsigned int instruments = 31;
if(modId == "M.K." || modId == "M!K!" || modId == "M&K!" || modId == "N.T.") {
d->tag.setTrackerName("ProTracker");
channels = 4;
READ_STRING(d->tag.setTitle, 20);
StringList comment;
- for(uint i = 0; i < instruments; ++ i) {
+ for(unsigned int i = 0; i < instruments; ++ i) {
READ_STRING_AS(instrumentName, 22);
// value in words, * 2 (<< 1) for bytes:
READ_U16B_AS(sampleLength);
{
}
- int channels;
- uint instrumentCount;
+ int channels;
+ unsigned int instrumentCount;
unsigned char lengthInPatterns;
};
return d->channels;
}
-TagLib::uint Mod::Properties::instrumentCount() const
+unsigned int Mod::Properties::instrumentCount() const
{
return d->instrumentCount;
}
d->channels = channels;
}
-void Mod::Properties::setInstrumentCount(uint instrumentCount)
+void Mod::Properties::setInstrumentCount(unsigned int instrumentCount)
{
d->instrumentCount = instrumentCount;
}
int sampleRate() const;
int channels() const;
- uint instrumentCount() const;
+ unsigned int instrumentCount() const;
unsigned char lengthInPatterns() const;
void setChannels(int channels);
- void setInstrumentCount(uint sampleCount);
+ void setInstrumentCount(unsigned int sampleCount);
void setLengthInPatterns(unsigned char lengthInPatterns);
private:
return String();
}
-TagLib::uint Mod::Tag::year() const
+unsigned int Mod::Tag::year() const
{
return 0;
}
-TagLib::uint Mod::Tag::track() const
+unsigned int Mod::Tag::track() const
{
return 0;
}
{
}
-void Mod::Tag::setYear(uint)
+void Mod::Tag::setYear(unsigned int)
{
}
-void Mod::Tag::setTrack(uint)
+void Mod::Tag::setTrack(unsigned int)
{
}
/*!
* Not supported by module files. Therefore always returns 0.
*/
- uint year() const;
+ unsigned int year() const;
/*!
* Not supported by module files. Therefore always returns 0.
*/
- uint track() const;
+ unsigned int track() const;
/*!
* Returns the name of the tracker used to create/edit the module file.
/*!
* Not supported by module files and therefore ignored.
*/
- void setYear(uint year);
+ void setYear(unsigned int year);
/*!
* Not supported by module files and therefore ignored.
*/
- void setTrack(uint track);
+ void setTrack(unsigned int track);
/*!
* Sets the tracker name to \a trackerName. If \a trackerName is
int m_int;
IntPair m_intPair;
unsigned char m_byte;
- uint m_uint;
+ unsigned int m_uint;
long long m_longlong;
};
StringList m_stringList;
d->m_byte = value;
}
-MP4::Item::Item(uint value) :
+MP4::Item::Item(unsigned int value) :
d(new ItemPrivate())
{
d->m_uint = value;
return d->m_byte;
}
-TagLib::uint
+unsigned int
MP4::Item::toUInt() const
{
return d->m_uint;
Item(int value);
Item(unsigned char value);
- Item(uint value);
+ Item(unsigned int value);
Item(long long value);
Item(bool value);
Item(int first, int second);
int toInt() const;
unsigned char toByte() const;
- uint toUInt() const;
+ unsigned int toUInt() const;
long long toLongLong() const;
bool toBool() const;
IntPair toIntPair() const;
file->seek(mdhd->offset);
data = file->readBlock(mdhd->length);
- const uint version = data[8];
+ const unsigned int version = data[8];
long long unit;
long long length;
if(version == 1) {
d->bitsPerSample = data.toShort(42U);
d->sampleRate = data.toUInt(46U);
if(data.containsAt("esds", 56) && data[64] == 0x03) {
- uint pos = 65;
+ unsigned int pos = 65;
if(data.containsAt("\x80\x80\x80", pos)) {
pos += 3;
}
ByteVector data = d->file->readBlock(atom->length - 12);
unsigned int count = data.toUInt();
d->file->seek(atom->offset + 16);
- uint pos = 4;
+ unsigned int pos = 4;
while(count--) {
long o = static_cast<long>(data.toUInt(pos));
if(o > offset) {
ByteVector data = d->file->readBlock(atom->length - 12);
unsigned int count = data.toUInt();
d->file->seek(atom->offset + 16);
- uint pos = 4;
+ unsigned int pos = 4;
while(count--) {
long long o = data.toLongLong(pos);
if(o > offset) {
}
void
-MP4::Tag::setYear(uint value)
+MP4::Tag::setYear(unsigned int value)
{
d->items["\251day"] = StringList(String::number(value));
}
void
-MP4::Tag::setTrack(uint value)
+MP4::Tag::setTrack(unsigned int value)
{
d->items["trkn"] = MP4::Item(value, 0);
}
String album() const;
String comment() const;
String genre() const;
- uint year() const;
- uint track() const;
+ unsigned int year() const;
+ unsigned int track() const;
void setTitle(const String &value);
void setArtist(const String &value);
void setAlbum(const String &value);
void setComment(const String &value);
void setGenre(const String &value);
- void setYear(uint value);
- void setTrack(uint value);
+ void setYear(unsigned int value);
+ void setTrack(unsigned int value);
virtual bool isEmpty() const;
}
long APELocation;
- uint APESize;
+ unsigned int APESize;
long ID3v1Location;
ID3v2::Header *ID3v2Header;
long ID3v2Location;
- uint ID3v2Size;
+ unsigned int ID3v2Size;
TagUnion tag;
albumGain(0),
albumPeak(0) {}
- int version;
- int length;
- int bitrate;
- int sampleRate;
- int channels;
- uint totalFrames;
- uint sampleFrames;
- uint trackGain;
- uint trackPeak;
- uint albumGain;
- uint albumPeak;
- String flags;
+ int version;
+ int length;
+ int bitrate;
+ int sampleRate;
+ int channels;
+ unsigned int totalFrames;
+ unsigned int sampleFrames;
+ unsigned int trackGain;
+ unsigned int trackPeak;
+ unsigned int albumGain;
+ unsigned int albumPeak;
+ String flags;
};
////////////////////////////////////////////////////////////////////////////////
return d->version;
}
-TagLib::uint MPC::Properties::totalFrames() const
+unsigned int MPC::Properties::totalFrames() const
{
return d->totalFrames;
}
-TagLib::uint MPC::Properties::sampleFrames() const
+unsigned int MPC::Properties::sampleFrames() const
{
return d->sampleFrames;
}
namespace
{
- unsigned long readSize(File *file, TagLib::uint &sizeLength, bool &eof)
+ unsigned long readSize(File *file, unsigned int &sizeLength, bool &eof)
{
sizeLength = 0;
eof = false;
return size;
}
- unsigned long readSize(const ByteVector &data, TagLib::uint &pos)
+ unsigned long readSize(const ByteVector &data, unsigned int &pos)
{
unsigned char tmp;
unsigned long size = 0;
while(!readSH && !readRG) {
const ByteVector packetType = file->readBlock(2);
- uint packetSizeLength;
+ unsigned int packetSizeLength;
bool eof;
const unsigned long packetSize = readSize(file, packetSizeLength, eof);
if(eof) {
readSH = true;
- TagLib::uint pos = 4;
+ unsigned int pos = 4;
d->version = data[pos];
pos += 1;
d->sampleFrames = readSize(data, pos);
d->sampleRate = sftable[(flags >> 13) & 0x07];
d->channels = ((flags >> 4) & 0x0F) + 1;
- const uint frameCount = d->sampleFrames - begSilence;
+ const unsigned int frameCount = d->sampleFrames - begSilence;
if(frameCount > 0 && d->sampleRate > 0) {
const double length = frameCount * 1000.0 / d->sampleRate;
d->length = static_cast<int>(length + 0.5);
d->totalFrames = data.toUInt(4, false);
- const uint flags = data.toUInt(8, false);
+ const unsigned int flags = data.toUInt(8, false);
d->sampleRate = sftable[(flags >> 16) & 0x03];
d->channels = 2;
- const uint gapless = data.toUInt(5, false);
+ const unsigned int gapless = data.toUInt(5, false);
d->trackGain = data.toShort(14, false);
d->trackPeak = data.toShort(12, false);
bool trueGapless = (gapless >> 31) & 0x0001;
if(trueGapless) {
- uint lastFrameSamples = (gapless >> 20) & 0x07FF;
+ unsigned int lastFrameSamples = (gapless >> 20) & 0x07FF;
d->sampleFrames = d->totalFrames * 1152 - lastFrameSamples;
}
else
d->sampleFrames = d->totalFrames * 1152 - 576;
}
else {
- const uint headerData = data.toUInt(0, false);
+ const unsigned int headerData = data.toUInt(0, false);
d->bitrate = (headerData >> 23) & 0x01ff;
d->version = (headerData >> 11) & 0x03ff;
class File;
- static const uint HeaderSize = 8*7;
+ static const unsigned int HeaderSize = 8 * 7;
//! An implementation of audio property reading for MPC
*/
int mpcVersion() const;
- uint totalFrames() const;
- uint sampleFrames() const;
+ unsigned int totalFrames() const;
+ unsigned int sampleFrames() const;
/*!
* Returns the track gain as an integer value,
return ID3v1::genre(d->genre);
}
-TagLib::uint ID3v1::Tag::year() const
+unsigned int ID3v1::Tag::year() const
{
return d->year.toInt();
}
-TagLib::uint ID3v1::Tag::track() const
+unsigned int ID3v1::Tag::track() const
{
return d->track;
}
d->genre = ID3v1::genreIndex(s);
}
-void ID3v1::Tag::setYear(TagLib::uint i)
+void ID3v1::Tag::setYear(unsigned int i)
{
d->year = i > 0 ? String::number(i) : String();
}
-void ID3v1::Tag::setTrack(TagLib::uint i)
+void ID3v1::Tag::setTrack(unsigned int i)
{
d->track = i < 256 ? i : 0;
}
-TagLib::uint ID3v1::Tag::genreNumber() const
+unsigned int ID3v1::Tag::genreNumber() const
{
return d->genre;
}
-void ID3v1::Tag::setGenreNumber(TagLib::uint i)
+void ID3v1::Tag::setGenreNumber(unsigned int i)
{
d->genre = i < 256 ? i : 255;
}
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual TagLib::uint year() const;
- virtual TagLib::uint track() const;
+ virtual unsigned int year() const;
+ virtual unsigned int track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(TagLib::uint i);
- virtual void setTrack(TagLib::uint i);
+ virtual void setYear(unsigned int i);
+ virtual void setTrack(unsigned int i);
/*!
* Returns the genre in number.
*
* \note Normally 255 indicates that this tag contains no genre.
*/
- TagLib::uint genreNumber() const;
+ unsigned int genreNumber() const;
/*!
* Sets the genre in number to \a i.
* \note Valid value is from 0 up to 255. Normally 255 indicates that
* this tag contains no genre.
*/
- void setGenreNumber(TagLib::uint i);
+ void setGenreNumber(unsigned int i);
/*!
* Sets the string handler that decides how the ID3v1 data will be
d->mimeType = readStringField(data, String::Latin1, &pos);
/* Now we need at least two more bytes available */
- if (uint(pos) + 1 >= data.size()) {
+ if(static_cast<unsigned int>(pos) + 1 >= data.size()) {
debug("Truncated picture frame.");
return;
}
const ID3v2::Header *tagHeader;
ByteVector elementID;
- TagLib::uint startTime;
- TagLib::uint endTime;
- TagLib::uint startOffset;
- TagLib::uint endOffset;
+ unsigned int startTime;
+ unsigned int endTime;
+ unsigned int startOffset;
+ unsigned int endOffset;
FrameListMap embeddedFrameListMap;
FrameList embeddedFrameList;
};
}
ChapterFrame::ChapterFrame(const ByteVector &elementID,
- TagLib::uint startTime, TagLib::uint endTime,
- TagLib::uint startOffset, TagLib::uint endOffset,
+ unsigned int startTime, unsigned int endTime,
+ unsigned int startOffset, unsigned int endOffset,
const FrameList &embeddedFrames) :
ID3v2::Frame("CHAP")
{
return d->elementID;
}
-TagLib::uint ChapterFrame::startTime() const
+unsigned int ChapterFrame::startTime() const
{
return d->startTime;
}
-TagLib::uint ChapterFrame::endTime() const
+unsigned int ChapterFrame::endTime() const
{
return d->endTime;
}
-TagLib::uint ChapterFrame::startOffset() const
+unsigned int ChapterFrame::startOffset() const
{
return d->startOffset;
}
-TagLib::uint ChapterFrame::endOffset() const
+unsigned int ChapterFrame::endOffset() const
{
return d->endOffset;
}
d->elementID = d->elementID.mid(0, d->elementID.size() - 1);
}
-void ChapterFrame::setStartTime(const TagLib::uint &sT)
+void ChapterFrame::setStartTime(const unsigned int &sT)
{
d->startTime = sT;
}
-void ChapterFrame::setEndTime(const TagLib::uint &eT)
+void ChapterFrame::setEndTime(const unsigned int &eT)
{
d->endTime = eT;
}
-void ChapterFrame::setStartOffset(const TagLib::uint &sO)
+void ChapterFrame::setStartOffset(const unsigned int &sO)
{
d->startOffset = sO;
}
-void ChapterFrame::setEndOffset(const TagLib::uint &eO)
+void ChapterFrame::setEndOffset(const unsigned int &eO)
{
d->endOffset = eO;
}
void ChapterFrame::parseFields(const ByteVector &data)
{
- TagLib::uint size = data.size();
+ unsigned int size = data.size();
if(size < 18) {
debug("A CHAP frame must contain at least 18 bytes (1 byte element ID "
"terminated by null and 4x4 bytes for start and end time and offset).");
}
int pos = 0;
- TagLib::uint embPos = 0;
+ unsigned int embPos = 0;
d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1);
d->startTime = data.toUInt(pos, true);
pos += 4;
* All times are in milliseconds.
*/
ChapterFrame(const ByteVector &elementID,
- uint startTime, uint endTime,
- uint startOffset, uint endOffset,
+ unsigned int startTime, unsigned int endTime,
+ unsigned int startOffset, unsigned int endOffset,
const FrameList &embeddedFrames = FrameList());
/*!
*
* \see setStartTime()
*/
- uint startTime() const;
+ unsigned int startTime() const;
/*!
* Returns time of chapter's end (in milliseconds).
*
* \see setEndTime()
*/
- uint endTime() const;
+ unsigned int endTime() const;
/*!
* Returns zero based byte offset (count of bytes from the beginning
* \note If returned value is 0xFFFFFFFF, start time should be used instead.
* \see setStartOffset()
*/
- uint startOffset() const;
+ unsigned int startOffset() const;
/*!
* Returns zero based byte offset (count of bytes from the beginning
* \note If returned value is 0xFFFFFFFF, end time should be used instead.
* \see setEndOffset()
*/
- uint endOffset() const;
+ unsigned int endOffset() const;
/*!
* Sets the element ID of the frame to \a eID. If \a eID isn't
*
* \see startTime()
*/
- void setStartTime(const uint &sT);
+ void setStartTime(const unsigned int &sT);
/*!
* Sets time of chapter's end (in milliseconds) to \a eT.
*
* \see endTime()
*/
- void setEndTime(const uint &eT);
+ void setEndTime(const unsigned int &eT);
/*!
* Sets zero based byte offset (count of bytes from the beginning
*
* \see startOffset()
*/
- void setStartOffset(const uint &sO);
+ void setStartOffset(const unsigned int &sO);
/*!
* Sets zero based byte offset (count of bytes from the beginning
*
* \see endOffset()
*/
- void setEndOffset(const uint &eO);
+ void setEndOffset(const unsigned int &eO);
/*!
* Returns a reference to the frame list map. This is an FrameListMap of
d->synchedEvents.clear();
while(pos + 4 < end) {
EventType type = static_cast<EventType>(static_cast<unsigned char>(data[pos++]));
- uint time = data.toUInt(pos, true);
+ unsigned int time = data.toUInt(pos, true);
pos += 4;
d->synchedEvents.append(SynchedEvent(time, type));
}
* Single entry of time stamp and event.
*/
struct SynchedEvent {
- SynchedEvent(uint ms, EventType t) : time(ms), type(t) {}
- uint time;
+ SynchedEvent(unsigned int ms, EventType t) : time(ms), type(t) {}
+ unsigned int time;
EventType type;
};
PopularimeterFramePrivate() : rating(0), counter(0) {}
String email;
int rating;
- TagLib::uint counter;
+ unsigned int counter;
};
////////////////////////////////////////////////////////////////////////////////
d->rating = s;
}
-TagLib::uint PopularimeterFrame::counter() const
+unsigned int PopularimeterFrame::counter() const
{
return d->counter;
}
-void PopularimeterFrame::setCounter(TagLib::uint s)
+void PopularimeterFrame::setCounter(unsigned int s)
{
d->counter = s;
}
if(pos < size) {
d->rating = (unsigned char)(data[pos++]);
if(pos < size) {
- d->counter = data.toUInt(static_cast<uint>(pos));
+ d->counter = data.toUInt(static_cast<unsigned int>(pos));
}
}
}
*
* \see setCounter()
*/
- uint counter() const;
+ unsigned int counter() const;
/*!
* Set the counter.
*
* \see counter()
*/
- void setCounter(uint counter);
+ void setCounter(unsigned int counter);
protected:
// Reimplementations.
ChannelData &channel = d->channels[type];
- channel.volumeAdjustment = data.toShort(static_cast<uint>(pos));
+ channel.volumeAdjustment = data.toShort(static_cast<unsigned int>(pos));
pos += 2;
channel.peakVolume.bitsRepresentingPeak = data[pos];
d->language = languageEncoding.mid(0, 3);
}
-void SynchronizedLyricsFrame::setTimestampFormat(
- SynchronizedLyricsFrame::TimestampFormat f)
+void SynchronizedLyricsFrame::setTimestampFormat(SynchronizedLyricsFrame::TimestampFormat f)
{
d->timestampFormat = f;
}
if(text.isEmpty() || pos + 4 > end)
return;
- uint time = data.toUInt(pos, true);
+ unsigned int time = data.toUInt(pos, true);
pos += 4;
d->synchedText.append(SynchedText(time, text));
* Single entry of time stamp and lyrics text.
*/
struct SynchedText {
- SynchedText(uint ms, String str) : time(ms), text(str) {}
- uint time;
+ SynchedText(unsigned int ms, String str) : time(ms), text(str) {}
+ unsigned int time;
String text;
};
return d->isOrdered;
}
-TagLib::uint TableOfContentsFrame::entryCount() const
+unsigned int TableOfContentsFrame::entryCount() const
{
return d->childElements.size();
}
void TableOfContentsFrame::parseFields(const ByteVector &data)
{
- TagLib::uint size = data.size();
+ unsigned int size = data.size();
if(size < 6) {
debug("A CTOC frame must contain at least 6 bytes (1 byte element ID terminated by "
"null, 1 byte flags, 1 byte entry count and 1 byte child element ID terminated "
}
int pos = 0;
- TagLib::uint embPos = 0;
+ unsigned int embPos = 0;
d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1);
d->isTopLevel = (data.at(pos) & 2) > 0;
d->isOrdered = (data.at(pos++) & 1) > 0;
- TagLib::uint entryCount = data.at(pos++);
- for(TagLib::uint i = 0; i < entryCount; i++) {
+ unsigned int entryCount = data.at(pos++);
+ for(unsigned int i = 0; i < entryCount; i++) {
ByteVector childElementID = readStringField(data, String::Latin1, &pos).data(String::Latin1);
d->childElements.append(childElementID);
}
*
* \see childElements()
*/
- uint entryCount() const;
+ unsigned int entryCount() const;
/*!
* Returns list of child elements of the frame.
d->textEncoding = encoding;
}
-// array of allowed TIPL prefixes and their corresponding key value
-static const TagLib::uint involvedPeopleSize = 5;
-static const char* involvedPeople[][2] = {
- {"ARRANGER", "ARRANGER"},
- {"ENGINEER", "ENGINEER"},
- {"PRODUCER", "PRODUCER"},
- {"DJ-MIX", "DJMIXER"},
- {"MIX", "MIXER"},
-};
+namespace
+{
+ // array of allowed TIPL prefixes and their corresponding key value
+ const char* involvedPeople[][2] = {
+ {"ARRANGER", "ARRANGER"},
+ {"ENGINEER", "ENGINEER"},
+ {"PRODUCER", "PRODUCER"},
+ {"DJ-MIX", "DJMIXER"},
+ {"MIX", "MIXER"},
+ };
+ const size_t involvedPeopleSize = sizeof(involvedPeople) / sizeof(involvedPeople[0]);
+}
const KeyConversionMap &TextIdentificationFrame::involvedPeopleMap() // static
{
static KeyConversionMap m;
- if(m.isEmpty())
- for(uint i = 0; i < involvedPeopleSize; ++i)
+ if(m.isEmpty()) {
+ for(size_t i = 0; i < involvedPeopleSize; ++i)
m.insert(involvedPeople[i][1], involvedPeople[i][0]);
+ }
return m;
}
StringList l = fieldList();
for(StringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
bool found = false;
- for(uint i = 0; i < involvedPeopleSize; ++i)
+ for(size_t i = 0; i < involvedPeopleSize; ++i)
if(*it == involvedPeople[i][0]) {
map.insert(involvedPeople[i][1], (++it)->split(","));
found = true;
public:
ExtendedHeaderPrivate() : size(0) {}
- uint size;
+ unsigned int size;
};
////////////////////////////////////////////////////////////////////////////////
delete d;
}
-TagLib::uint ExtendedHeader::size() const
+unsigned int ExtendedHeader::size() const
{
return d->size;
}
* Returns the size of the extended header. This is variable for the
* extended header.
*/
- uint size() const;
+ unsigned int size() const;
/*!
* Sets the data that will be used as the extended header. Since the
{
}
-TagLib::uint Footer::size()
+unsigned int Footer::size()
{
return 10;
}
/*!
* Returns the size of the footer. Presently this is always 10 bytes.
*/
- static uint size();
+ static unsigned int size();
/*!
* Renders the footer based on the data in \a header.
// static methods
////////////////////////////////////////////////////////////////////////////////
-TagLib::uint Frame::headerSize()
+unsigned int Frame::headerSize()
{
return Header::size();
}
-TagLib::uint Frame::headerSize(uint version)
+unsigned int Frame::headerSize(unsigned int version)
{
return Header::size(version);
}
return ByteVector();
}
-TagLib::uint Frame::size() const
+unsigned int Frame::size() const
{
if(d->header)
return d->header->frameSize();
ByteVector Frame::fieldData(const ByteVector &frameData) const
{
- uint headerSize = Header::size(d->header->version());
+ unsigned int headerSize = Header::size(d->header->version());
- uint frameDataOffset = headerSize;
- uint frameDataLength = size();
+ unsigned int frameDataOffset = headerSize;
+ unsigned int frameDataLength = size();
if(d->header->compression() || d->header->dataLengthIndicator()) {
frameDataLength = SynchData::toUInt(frameData.mid(headerSize, 4));
stream.avail_in = (uLongf) frameData.size() - frameDataOffset;
stream.next_in = (Bytef *) frameData.data() + frameDataOffset;
- static const uint chunkSize = 1024;
+ static const unsigned int chunkSize = 1024;
ByteVector data;
ByteVector chunk(chunkSize);
return checkEncoding(fields, encoding, 4);
}
-String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding, uint version) // static
+String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding, unsigned int version) // static
{
if((encoding == String::UTF8 || encoding == String::UTF16BE) && version != 4)
return String::UTF16;
{}
ByteVector frameID;
- uint frameSize;
- uint version;
+ unsigned int frameSize;
+ unsigned int version;
// flags
// static members (Frame::Header)
////////////////////////////////////////////////////////////////////////////////
-TagLib::uint Frame::Header::size()
+unsigned int Frame::Header::size()
{
return size(4);
}
-TagLib::uint Frame::Header::size(uint version)
+unsigned int Frame::Header::size(unsigned int version)
{
switch(version) {
case 0:
setData(data, synchSafeInts);
}
-Frame::Header::Header(const ByteVector &data, uint version)
+Frame::Header::Header(const ByteVector &data, unsigned int version)
{
d = new HeaderPrivate;
setData(data, version);
void Frame::Header::setData(const ByteVector &data, bool synchSafeInts)
{
- setData(data, uint(synchSafeInts ? 4 : 3));
+ setData(data, static_cast<unsigned int>(synchSafeInts ? 4 : 3));
}
-void Frame::Header::setData(const ByteVector &data, uint version)
+void Frame::Header::setData(const ByteVector &data, unsigned int version)
{
d->version = version;
d->frameID = id.mid(0, 4);
}
-TagLib::uint Frame::Header::frameSize() const
+unsigned int Frame::Header::frameSize() const
{
return d->frameSize;
}
-void Frame::Header::setFrameSize(uint size)
+void Frame::Header::setFrameSize(unsigned int size)
{
d->frameSize = size;
}
-TagLib::uint Frame::Header::version() const
+unsigned int Frame::Header::version() const
{
return d->version;
}
-void Frame::Header::setVersion(TagLib::uint version)
+void Frame::Header::setVersion(unsigned int version)
{
d->version = version;
}
/*!
* Returns the size of the frame.
*/
- uint size() const;
+ unsigned int size() const;
/*!
* Returns the size of the frame header
* non-binary compatible release this will be made into a non-static
* member that checks the internal ID3v2 version.
*/
- static uint headerSize(); // BIC: remove and make non-static
+ static unsigned int headerSize(); // BIC: remove and make non-static
/*!
* Returns the size of the frame header for the given ID3v2 version.
*
* \deprecated Please see the explanation above.
*/
- static uint headerSize(uint version); // BIC: remove and make non-static
+ static unsigned int headerSize(unsigned int version); // BIC: remove and make non-static
/*!
* Sets the data that will be used as the frame. Since the length is not
*/
// BIC: remove and make non-static
static String::Type checkEncoding(const StringList &fields,
- String::Type encoding, uint version);
+ String::Type encoding, unsigned int version);
/*!
* Checks a the list of string values to see if they can be used with the
*
* \a version should be the ID3v2 version of the tag.
*/
- explicit Header(const ByteVector &data, uint version = 4);
+ explicit Header(const ByteVector &data, unsigned int version = 4);
/*!
* Destroys this Header instance.
* Sets the data for the Header. \a version should indicate the ID3v2
* version number of the tag that this frame is contained in.
*/
- void setData(const ByteVector &data, uint version = 4);
+ void setData(const ByteVector &data, unsigned int version = 4);
/*!
* Returns the Frame ID (Structure, <a href="id3v2-structure.html#4">4</a>)
* Returns the size of the frame data portion, as set when setData() was
* called or set explicitly via setFrameSize().
*/
- uint frameSize() const;
+ unsigned int frameSize() const;
/*!
* Sets the size of the frame data portion.
*/
- void setFrameSize(uint size);
+ void setFrameSize(unsigned int size);
/*!
* Returns the ID3v2 version of the header, as passed in from the
* construction of the header or set via setVersion().
*/
- uint version() const;
+ unsigned int version() const;
/*!
* Sets the ID3v2 version of the header, changing has impact on the
* correct parsing/rendering of frame data.
*/
- void setVersion(uint version);
+ void setVersion(unsigned int version);
/*!
* Returns the size of the frame header in bytes.
* removed in the next binary incompatible release (2.0) and will be
* replaced with a non-static method that checks the frame version.
*/
- static uint size();
+ static unsigned int size();
/*!
* Returns the size of the frame header in bytes for the ID3v2 version
*
* \deprecated Please see the explanation in the version above.
*/
- static uint size(uint version);
+ static unsigned int size(unsigned int version);
/*!
* Returns true if the flag for tag alter preservation is set.
Frame *FrameFactory::createFrame(const ByteVector &data, bool synchSafeInts) const
{
- return createFrame(data, uint(synchSafeInts ? 4 : 3));
+ return createFrame(data, static_cast<unsigned int>(synchSafeInts ? 4 : 3));
}
-Frame *FrameFactory::createFrame(const ByteVector &data, uint version) const
+Frame *FrameFactory::createFrame(const ByteVector &data, unsigned int version) const
{
Header tagHeader;
tagHeader.setMajorVersion(version);
Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader) const
{
ByteVector data = origData;
- uint version = tagHeader->majorVersion();
+ unsigned int version = tagHeader->majorVersion();
Frame::Header *header = new Frame::Header(data, version);
ByteVector frameID = header->frameID();
// characters. Also make sure that there is data in the frame.
if(frameID.size() != (version < 3 ? 3 : 4) ||
- header->frameSize() <= uint(header->dataLengthIndicator() ? 4 : 0) ||
+ header->frameSize() <= static_cast<unsigned int>(header->dataLengthIndicator() ? 4 : 0) ||
header->frameSize() > data.size())
{
delete header;
* \deprecated Please use the method below that accepts a ID3v2::Header
* instance in new code.
*/
- Frame *createFrame(const ByteVector &data, uint version = 4) const;
+ Frame *createFrame(const ByteVector &data, unsigned int version = 4) const;
/*!
* Create a frame based on \a data. \a tagHeader should be a valid
footerPresent(false),
tagSize(0) {}
- uint majorVersion;
- uint revisionNumber;
+ unsigned int majorVersion;
+ unsigned int revisionNumber;
bool unsynchronisation;
bool extendedHeader;
bool experimentalIndicator;
bool footerPresent;
- uint tagSize;
+ unsigned int tagSize;
};
////////////////////////////////////////////////////////////////////////////////
// static members
////////////////////////////////////////////////////////////////////////////////
-TagLib::uint Header::size()
+unsigned int Header::size()
{
return 10;
}
delete d;
}
-TagLib::uint Header::majorVersion() const
+unsigned int Header::majorVersion() const
{
return d->majorVersion;
}
-void Header::setMajorVersion(TagLib::uint version)
+void Header::setMajorVersion(unsigned int version)
{
d->majorVersion = version;
}
-TagLib::uint Header::revisionNumber() const
+unsigned int Header::revisionNumber() const
{
return d->revisionNumber;
}
return d->footerPresent;
}
-TagLib::uint Header::tagSize() const
+unsigned int Header::tagSize() const
{
return d->tagSize;
}
-TagLib::uint Header::completeTagSize() const
+unsigned int Header::completeTagSize() const
{
if(d->footerPresent)
return d->tagSize + size() + Footer::size();
return d->tagSize + size();
}
-void Header::setTagSize(uint s)
+void Header::setTagSize(unsigned int s)
{
d->tagSize = s;
}
* Returns the major version number. (Note: This is the 4, not the 2 in
* ID3v2.4.0. The 2 is implied.)
*/
- uint majorVersion() const;
+ unsigned int majorVersion() const;
/*!
* Set the the major version number to \a version. (Note: This is
* version which is written and in general should not be called by API
* users.
*/
- void setMajorVersion(uint version);
+ void setMajorVersion(unsigned int version);
/*!
* Returns the revision number. (Note: This is the 0, not the 4 in
* ID3v2.4.0. The 2 is implied.)
*/
- uint revisionNumber() const;
+ unsigned int revisionNumber() const;
/*!
* Returns true if unsynchronisation has been applied to all frames.
*
* \see completeTagSize()
*/
- uint tagSize() const;
+ unsigned int tagSize() const;
/*!
* Returns the tag size, including the header and, if present, the footer
*
* \see tagSize()
*/
- uint completeTagSize() const;
+ unsigned int completeTagSize() const;
/*!
* Set the tag size to \a s.
* \see tagSize()
*/
- void setTagSize(uint s);
+ void setTagSize(unsigned int s);
/*!
* Returns the size of the header. Presently this is always 10 bytes.
*/
- static uint size();
+ static unsigned int size();
/*!
* Returns the string used to identify and ID3v2 tag inside of a file.
using namespace TagLib;
using namespace ID3v2;
-TagLib::uint SynchData::toUInt(const ByteVector &data)
+unsigned int SynchData::toUInt(const ByteVector &data)
{
- uint sum = 0;
+ unsigned int sum = 0;
bool notSynchSafe = false;
int last = data.size() > 4 ? 3 : data.size() - 1;
return sum;
}
-ByteVector SynchData::fromUInt(uint value)
+ByteVector SynchData::fromUInt(unsigned int value)
{
ByteVector v(4, 0);
* <a href="id3v2-structure.html#6.2">6.2</a>). The default \a length of
* 4 is used if another value is not specified.
*/
- TAGLIB_EXPORT uint toUInt(const ByteVector &data);
+ TAGLIB_EXPORT unsigned int toUInt(const ByteVector &data);
/*!
* Returns a 4 byte (32 bit) synchsafe integer based on \a value.
*/
- TAGLIB_EXPORT ByteVector fromUInt(uint value);
+ TAGLIB_EXPORT ByteVector fromUInt(unsigned int value);
/*!
* Convert the data from unsynchronized data to its original format.
return genres.toString();
}
-TagLib::uint ID3v2::Tag::year() const
+unsigned int ID3v2::Tag::year() const
{
if(!d->frameListMap["TDRC"].isEmpty())
return d->frameListMap["TDRC"].front()->toString().substr(0, 4).toInt();
return 0;
}
-TagLib::uint ID3v2::Tag::track() const
+unsigned int ID3v2::Tag::track() const
{
if(!d->frameListMap["TRCK"].isEmpty())
return d->frameListMap["TRCK"].front()->toString().toInt();
#endif
}
-void ID3v2::Tag::setYear(uint i)
+void ID3v2::Tag::setYear(unsigned int i)
{
if(i <= 0) {
removeFrames("TDRC");
setTextFrame("TDRC", String::number(i));
}
-void ID3v2::Tag::setTrack(uint i)
+void ID3v2::Tag::setTrack(unsigned int i)
{
if(i <= 0) {
removeFrames("TRCK");
StringList people;
if(frameTMCL) {
StringList v24People = frameTMCL->fieldList();
- for(uint i = 0; i + 1 < v24People.size(); i += 2) {
+ for(unsigned int i = 0; i + 1 < v24People.size(); i += 2) {
people.append(v24People[i]);
people.append(v24People[i+1]);
}
}
if(frameTIPL) {
StringList v24People = frameTIPL->fieldList();
- for(uint i = 0; i + 1 < v24People.size(); i += 2) {
+ for(unsigned int i = 0; i + 1 < v24People.size(); i += 2) {
people.append(v24People[i]);
people.append(v24People[i+1]);
}
paddingSize = MinPaddingSize;
}
- tagData.resize(static_cast<uint>(tagData.size() + paddingSize), '\0');
+ tagData.resize(static_cast<unsigned int>(tagData.size() + paddingSize), '\0');
// Set the version and data size.
d->header.setMajorVersion(version);
// This is a workaround for some faulty files that have duplicate ID3v2 tags.
// Unfortunately, TagLib itself may write such duplicate tags until v1.10.
- uint extraSize = 0;
+ unsigned int extraSize = 0;
while(true) {
if(d->header.unsynchronisation() && d->header.majorVersion() <= 3)
data = SynchData::decode(data);
- uint frameDataPosition = 0;
- uint frameDataLength = data.size();
+ unsigned int frameDataPosition = 0;
+ unsigned int frameDataLength = data.size();
// check for extended header
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual uint year() const;
- virtual uint track() const;
+ virtual unsigned int year() const;
+ virtual unsigned int track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(uint i);
- virtual void setTrack(uint i);
+ virtual void setYear(unsigned int i);
+ virtual void setTrack(unsigned int i);
virtual bool isEmpty() const;
const ID3v2::FrameFactory *ID3v2FrameFactory;
long ID3v2Location;
- uint ID3v2OriginalSize;
+ unsigned int ID3v2OriginalSize;
long APELocation;
long APEFooterLocation;
- uint APEOriginalSize;
+ unsigned int APEOriginalSize;
long ID3v1Location;
if(foundLastSyncPattern && secondSynchByte(buffer[0]))
return position - 1;
- for(uint i = 0; i < buffer.size() - 1; i++) {
+ for(unsigned int i = 0; i < buffer.size() - 1; i++) {
if(firstSyncByte(buffer[i]) && secondSynchByte(buffer[i + 1]))
return position + i;
}
size(0),
type(MPEG::XingHeader::Invalid) {}
- uint frames;
- uint size;
+ unsigned int frames;
+ unsigned int size;
MPEG::XingHeader::HeaderType type;
};
return (d->type != Invalid && d->frames > 0 && d->size > 0);
}
-TagLib::uint MPEG::XingHeader::totalFrames() const
+unsigned int MPEG::XingHeader::totalFrames() const
{
return d->frames;
}
-TagLib::uint MPEG::XingHeader::totalSize() const
+unsigned int MPEG::XingHeader::totalSize() const
{
return d->size;
}
/*!
* Returns the total number of frames.
*/
- uint totalFrames() const;
+ unsigned int totalFrames() const;
/*!
* Returns the total size of stream in bytes.
*/
- uint totalSize() const;
+ unsigned int totalSize() const;
/*!
* Returns the type of the VBR header.
char blockType = header[0] & 0x7f;
bool lastBlock = (header[0] & 0x80) != 0;
- uint length = header.toUInt(1, 3, true);
+ unsigned int length = header.toUInt(1, 3, true);
overhead += length;
// Sanity: First block should be the stream_info metadata
delete lastPageHeader;
}
- uint streamSerialNumber;
+ unsigned int streamSerialNumber;
List<Page *> pages;
PageHeader *firstPageHeader;
PageHeader *lastPageHeader;
delete d;
}
-ByteVector Ogg::File::packet(uint i)
+ByteVector Ogg::File::packet(unsigned int i)
{
// Check to see if we're called setPacket() for this packet since the last
// save:
// If the last read stopped at the packet that we're interested in, don't
// reread its packet list. (This should make sequential packet reads fast.)
- uint pageIndex = d->packetToPageMap[i].front();
+ unsigned int pageIndex = d->packetToPageMap[i].front();
if(d->currentPacketPage != d->pages[pageIndex]) {
d->currentPacketPage = d->pages[pageIndex];
d->currentPackets = d->currentPacketPage->packets();
return packet;
}
-void Ogg::File::setPacket(uint i, const ByteVector &p)
+void Ogg::File::setPacket(unsigned int i, const ByteVector &p)
{
while(d->packetToPageMap.size() <= i) {
if(!nextPage()) {
// Loop through the packets in the page that we just read appending the
// current page number to the packet to page map for each packet.
- for(uint i = 0; i < d->currentPage->packetCount(); i++) {
- uint currentPacket = d->currentPage->firstPacketIndex() + i;
+ for(unsigned int i = 0; i < d->currentPage->packetCount(); i++) {
+ unsigned int currentPacket = d->currentPage->firstPacketIndex() + i;
if(d->packetToPageMap.size() <= currentPacket)
d->packetToPageMap.push_back(List<int>());
d->packetToPageMap[currentPacket].append(d->pages.size() - 1);
int originalSize = 0;
for(List<int>::ConstIterator it = pageGroup.begin(); it != pageGroup.end(); ++it) {
- uint firstPacket = d->pages[*it]->firstPacketIndex();
- uint lastPacket = firstPacket + d->pages[*it]->packetCount() - 1;
+ unsigned int firstPacket = d->pages[*it]->firstPacketIndex();
+ unsigned int lastPacket = firstPacket + d->pages[*it]->packetCount() - 1;
List<int>::ConstIterator last = --pageGroup.end();
- for(uint i = firstPacket; i <= lastPacket; i++) {
+ for(unsigned int i = firstPacket; i <= lastPacket; i++) {
if(it == last && i == lastPacket && !d->dirtyPages.contains(i))
packets.append(d->pages[*it]->packets().back());
* \warning The requires reading at least the packet header for every page
* up to the requested page.
*/
- ByteVector packet(uint i);
+ ByteVector packet(unsigned int i);
/*!
* Sets the packet with index \a i to the value \a p.
*/
- void setPacket(uint i, const ByteVector &p);
+ void setPacket(unsigned int i, const ByteVector &p);
/*!
* Returns a pointer to the PageHeader for the first page in the stream or
return flags;
}
-TagLib::uint Ogg::Page::packetCount() const
+unsigned int Ogg::Page::packetCount() const
{
return d->header.packetSizes().size();
}
List<Ogg::Page *> Ogg::Page::paginate(const ByteVectorList &packets,
PaginationStrategy strategy,
- uint streamSerialNumber,
+ unsigned int streamSerialNumber,
int firstPage,
bool firstPacketContinued,
bool lastPacketCompleted,
////////////////////////////////////////////////////////////////////////////////
Ogg::Page::Page(const ByteVectorList &packets,
- uint streamSerialNumber,
+ unsigned int streamSerialNumber,
int pageNumber,
bool firstPacketContinued,
bool lastPacketCompleted,
/*!
* Returns the number of packets (whole or partial) in this page.
*/
- uint packetCount() const;
+ unsigned int packetCount() const;
/*!
* Returns a list of the packets in this page.
*/
static List<Page *> paginate(const ByteVectorList &packets,
PaginationStrategy strategy,
- uint streamSerialNumber,
+ unsigned int streamSerialNumber,
int firstPage,
bool firstPacketContinued = false,
bool lastPacketCompleted = true,
* for each page will be set to \a pageNumber.
*/
Page(const ByteVectorList &packets,
- uint streamSerialNumber,
+ unsigned int streamSerialNumber,
int pageNumber,
bool firstPacketContinued = false,
bool lastPacketCompleted = true,
bool firstPageOfStream;
bool lastPageOfStream;
long long absoluteGranularPosition;
- uint streamSerialNumber;
+ unsigned int streamSerialNumber;
int pageSequenceNumber;
int size;
int dataSize;
d->pageSequenceNumber = sequenceNumber;
}
-TagLib::uint Ogg::PageHeader::streamSerialNumber() const
+unsigned int Ogg::PageHeader::streamSerialNumber() const
{
return d->streamSerialNumber;
}
-void Ogg::PageHeader::setStreamSerialNumber(uint n)
+void Ogg::PageHeader::setStreamSerialNumber(unsigned int n)
{
d->streamSerialNumber = n;
}
*
* \see setStreamSerialNumber()
*/
- uint streamSerialNumber() const;
+ unsigned int streamSerialNumber() const;
/*!
* Every Ogg logical stream is given a random serial number which is common
*
* \see streamSerialNumber()
*/
- void setStreamSerialNumber(uint n);
+ void setStreamSerialNumber(unsigned int n);
/*!
* Returns the index of the page within the Ogg stream. This helps make it
const ByteVector data = file->packet(0);
// *Magic Signature*
- uint pos = 8;
+ unsigned int pos = 8;
// *Version* (8 bits, unsigned)
d->opusVersion = static_cast<unsigned char>(data.at(pos));
return;
}
- uint pos = 28;
+ unsigned int pos = 28;
// speex_version_id; /**< Version for Speex (for checking compatibility) */
d->speexVersion = data.toUInt(pos, false);
return;
}
- uint pos = 0;
+ unsigned int pos = 0;
if(data.mid(pos, 7) != vorbisSetupHeaderID) {
debug("Vorbis::Properties::read() -- invalid Vorbis identification header");
return d->fieldListMap["GENRE"].toString();
}
-TagLib::uint Ogg::XiphComment::year() const
+unsigned int Ogg::XiphComment::year() const
{
if(!d->fieldListMap["DATE"].isEmpty())
return d->fieldListMap["DATE"].front().toInt();
return 0;
}
-TagLib::uint Ogg::XiphComment::track() const
+unsigned int Ogg::XiphComment::track() const
{
if(!d->fieldListMap["TRACKNUMBER"].isEmpty())
return d->fieldListMap["TRACKNUMBER"].front().toInt();
addField("GENRE", s);
}
-void Ogg::XiphComment::setYear(uint i)
+void Ogg::XiphComment::setYear(unsigned int i)
{
removeFields("YEAR");
if(i == 0)
addField("DATE", String::number(i));
}
-void Ogg::XiphComment::setTrack(uint i)
+void Ogg::XiphComment::setTrack(unsigned int i)
{
removeFields("TRACKNUM");
if(i == 0)
return true;
}
-TagLib::uint Ogg::XiphComment::fieldCount() const
+unsigned int Ogg::XiphComment::fieldCount() const
{
- uint count = 0;
+ unsigned int count = 0;
for(FieldConstIterator it = d->fieldListMap.begin(); it != d->fieldListMap.end(); ++it)
count += (*it).second.size();
// The first thing in the comment data is the vendor ID length, followed by a
// UTF8 string with the vendor ID.
- uint pos = 0;
+ unsigned int pos = 0;
- const uint vendorLength = data.toUInt(0, false);
+ const unsigned int vendorLength = data.toUInt(0, false);
pos += 4;
d->vendorID = String(data.mid(pos, vendorLength), String::UTF8);
// Next the number of fields in the comment vector.
- const uint commentFields = data.toUInt(pos, false);
+ const unsigned int commentFields = data.toUInt(pos, false);
pos += 4;
if(commentFields > (data.size() - 8) / 4) {
return;
}
- for(uint i = 0; i < commentFields; i++) {
+ for(unsigned int i = 0; i < commentFields; i++) {
// Each comment field is in the format "KEY=value" in a UTF8 string and has
// 4 bytes before the text starts that gives the length.
- const uint commentLength = data.toUInt(pos, false);
+ const unsigned int commentLength = data.toUInt(pos, false);
pos += 4;
ByteVector entry = data.mid(pos, commentLength);
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual uint year() const;
- virtual uint track() const;
+ virtual unsigned int year() const;
+ virtual unsigned int track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(uint i);
- virtual void setTrack(uint i);
+ virtual void setYear(unsigned int i);
+ virtual void setTrack(unsigned int i);
virtual bool isEmpty() const;
/*!
* Returns the number of fields present in the comment.
*/
- uint fieldCount() const;
+ unsigned int fieldCount() const;
/*!
* Returns a reference to the map of field lists. Because Xiph comments
void RIFF::AIFF::File::read(bool readProperties)
{
- for(uint i = 0; i < chunkCount(); ++i) {
+ for(unsigned int i = 0; i < chunkCount(); ++i) {
const ByteVector name = chunkName(i);
if(name == "ID3 " || name == "id3 ") {
if(!d->tag) {
ByteVector compressionType;
String compressionName;
- uint sampleFrames;
+ unsigned int sampleFrames;
};
////////////////////////////////////////////////////////////////////////////////
return bitsPerSample();
}
-TagLib::uint RIFF::AIFF::Properties::sampleFrames() const
+unsigned int RIFF::AIFF::Properties::sampleFrames() const
{
return d->sampleFrames;
}
void RIFF::AIFF::Properties::read(File *file)
{
ByteVector data;
- uint streamLength = 0;
- for(uint i = 0; i < file->chunkCount(); i++) {
+ unsigned int streamLength = 0;
+ for(unsigned int i = 0; i < file->chunkCount(); i++) {
const ByteVector name = file->chunkName(i);
if(name == "COMM") {
if(data.isEmpty())
/*!
* Returns the number of sample frames
*/
- uint sampleFrames() const;
+ unsigned int sampleFrames() const;
/*!
* Returns true if the file is in AIFF-C format, false if AIFF format.
struct Chunk
{
- ByteVector name;
- TagLib::uint offset;
- TagLib::uint size;
- char padding;
+ ByteVector name;
+ unsigned int offset;
+ unsigned int size;
+ unsigned int padding;
};
class RIFF::File::FilePrivate
size(0) {}
const Endianness endianness;
- ByteVector type;
- TagLib::uint size;
- ByteVector format;
+ ByteVector type;
+ unsigned int size;
+ ByteVector format;
std::vector<Chunk> chunks;
};
read();
}
-TagLib::uint RIFF::File::riffSize() const
+unsigned int RIFF::File::riffSize() const
{
return d->size;
}
-TagLib::uint RIFF::File::chunkCount() const
+unsigned int RIFF::File::chunkCount() const
{
return d->chunks.size();
}
-TagLib::uint RIFF::File::chunkDataSize(uint i) const
+unsigned int RIFF::File::chunkDataSize(unsigned int i) const
{
return d->chunks[i].size;
}
-TagLib::uint RIFF::File::chunkOffset(uint i) const
+unsigned int RIFF::File::chunkOffset(unsigned int i) const
{
return d->chunks[i].offset;
}
-TagLib::uint RIFF::File::chunkPadding(uint i) const
+unsigned int RIFF::File::chunkPadding(unsigned int i) const
{
return d->chunks[i].padding;
}
-ByteVector RIFF::File::chunkName(uint i) const
+ByteVector RIFF::File::chunkName(unsigned int i) const
{
if(i >= chunkCount())
return ByteVector();
return d->chunks[i].name;
}
-ByteVector RIFF::File::chunkData(uint i)
+ByteVector RIFF::File::chunkData(unsigned int i)
{
if(i >= chunkCount())
return ByteVector();
return readBlock(d->chunks[i].size);
}
-void RIFF::File::setChunkData(uint i, const ByteVector &data)
+void RIFF::File::setChunkData(unsigned int i, const ByteVector &data)
{
// First we update the global size
}
if(!alwaysCreate) {
- for(uint i = 0; i < d->chunks.size(); i++) {
+ for(unsigned int i = 0; i < d->chunks.size(); i++) {
if(d->chunks[i].name == name) {
setChunkData(i, data);
return;
// Couldn't find an existing chunk, so let's create a new one.
- uint i = d->chunks.size() - 1;
+ unsigned int i = d->chunks.size() - 1;
unsigned long offset = d->chunks[i].offset + d->chunks[i].size;
// First we update the global size
d->chunks.push_back(chunk);
}
-void RIFF::File::removeChunk(uint i)
+void RIFF::File::removeChunk(unsigned int i)
{
if(i >= d->chunks.size())
return;
std::vector<Chunk>::iterator it = d->chunks.begin();
std::advance(it, i);
- const uint removeSize = it->size + it->padding + 8;
+ const unsigned int removeSize = it->size + it->padding + 8;
removeBlock(it->offset - 8, removeSize);
it = d->chunks.erase(it);
// + 8: chunk header at least, fix for additional junk bytes
while(tell() + 8 <= length()) {
ByteVector chunkName = readBlock(4);
- uint chunkSize = readBlock(4).toUInt(bigEndian);
+ unsigned int chunkSize = readBlock(4).toUInt(bigEndian);
if(!isValidChunkName(chunkName)) {
debug("RIFF::File::read() -- Chunk '" + chunkName + "' has invalid ID");
}
void RIFF::File::writeChunk(const ByteVector &name, const ByteVector &data,
- unsigned long offset, unsigned long replace, uint leadingPadding)
+ unsigned long offset, unsigned long replace,
+ unsigned int leadingPadding)
{
ByteVector combined;
if(leadingPadding) {
/*!
* \return The size of the main RIFF chunk.
*/
- uint riffSize() const;
+ unsigned int riffSize() const;
/*!
* \return The number of chunks in the file.
*/
- uint chunkCount() const;
+ unsigned int chunkCount() const;
/*!
* \return The offset within the file for the selected chunk number.
*/
- uint chunkOffset(uint i) const;
+ unsigned int chunkOffset(unsigned int i) const;
/*!
* \return The size of the chunk data.
*/
- uint chunkDataSize(uint i) const;
+ unsigned int chunkDataSize(unsigned int i) const;
/*!
* \return The size of the padding after the chunk (can be either 0 or 1).
*/
- uint chunkPadding(uint i) const;
+ unsigned int chunkPadding(unsigned int i) const;
/*!
* \return The name of the specified chunk, for instance, "COMM" or "ID3 "
*/
- ByteVector chunkName(uint i) const;
+ ByteVector chunkName(unsigned int i) const;
/*!
* Reads the chunk data from the file and returns it.
*
* \note This \e will move the read pointer for the file.
*/
- ByteVector chunkData(uint i);
+ ByteVector chunkData(unsigned int i);
/*!
* Sets the data for the specified chunk to \a data.
*
* \warning This will update the file immediately.
*/
- void setChunkData(uint i, const ByteVector &data);
+ void setChunkData(unsigned int i, const ByteVector &data);
/*!
* Sets the data for the chunk \a name to \a data. If a chunk with the
*
* \warning This will update the file immediately.
*/
- void removeChunk(uint i);
+ void removeChunk(unsigned int i);
/*!
* Removes the chunk \a name.
void read();
void writeChunk(const ByteVector &name, const ByteVector &data,
unsigned long offset, unsigned long replace = 0,
- uint leadingPadding = 0);
+ unsigned int leadingPadding = 0);
class FilePrivate;
FilePrivate *d;
return fieldText("IGNR");
}
-TagLib::uint RIFF::Info::Tag::year() const
+unsigned int RIFF::Info::Tag::year() const
{
return fieldText("ICRD").substr(0, 4).toInt();
}
-TagLib::uint RIFF::Info::Tag::track() const
+unsigned int RIFF::Info::Tag::track() const
{
return fieldText("IPRT").toInt();
}
setFieldText("IGNR", s);
}
-void RIFF::Info::Tag::setYear(uint i)
+void RIFF::Info::Tag::setYear(unsigned int i)
{
if(i != 0)
setFieldText("ICRD", String::number(i));
d->fieldListMap.erase("ICRD");
}
-void RIFF::Info::Tag::setTrack(uint i)
+void RIFF::Info::Tag::setTrack(unsigned int i)
{
if(i != 0)
setFieldText("IPRT", String::number(i));
void RIFF::Info::Tag::parse(const ByteVector &data)
{
- uint p = 4;
+ unsigned int p = 4;
while(p < data.size()) {
- const uint size = data.toUInt(p + 4, false);
+ const unsigned int size = data.toUInt(p + 4, false);
if(size > data.size() - p - 8)
break;
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual uint year() const;
- virtual uint track() const;
+ virtual unsigned int year() const;
+ virtual unsigned int track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(uint i);
- virtual void setTrack(uint i);
+ virtual void setYear(unsigned int i);
+ virtual void setTrack(unsigned int i);
virtual bool isEmpty() const;
void RIFF::WAV::File::read(bool readProperties)
{
- for(uint i = 0; i < chunkCount(); ++i) {
+ for(unsigned int i = 0; i < chunkCount(); ++i) {
const ByteVector name = chunkName(i);
if(name == "ID3 " || name == "id3 ") {
if(!d->tag[ID3v2Index]) {
int sampleRate;
int channels;
int bitsPerSample;
- uint sampleFrames;
+ unsigned int sampleFrames;
};
////////////////////////////////////////////////////////////////////////////////
// public members
////////////////////////////////////////////////////////////////////////////////
-RIFF::WAV::Properties::Properties(const ByteVector & /*data*/, ReadStyle style) :
+RIFF::WAV::Properties::Properties(const ByteVector &, ReadStyle style) :
AudioProperties(style),
d(new PropertiesPrivate())
{
debug("RIFF::WAV::Properties::Properties() -- This constructor is no longer used.");
}
-RIFF::WAV::Properties::Properties(const ByteVector & /*data*/, uint /*streamLength*/, ReadStyle style) :
+RIFF::WAV::Properties::Properties(const ByteVector &, unsigned int, ReadStyle style) :
AudioProperties(style),
d(new PropertiesPrivate())
{
return bitsPerSample();
}
-TagLib::uint RIFF::WAV::Properties::sampleFrames() const
+unsigned int RIFF::WAV::Properties::sampleFrames() const
{
return d->sampleFrames;
}
void RIFF::WAV::Properties::read(File *file)
{
ByteVector data;
- uint streamLength = 0;
- uint totalSamples = 0;
+ unsigned int streamLength = 0;
+ unsigned int totalSamples = 0;
- for(uint i = 0; i < file->chunkCount(); ++i) {
+ for(unsigned int i = 0; i < file->chunkCount(); ++i) {
const ByteVector name = file->chunkName(i);
if(name == "fmt ") {
if(data.isEmpty())
d->bitrate = static_cast<int>(streamLength * 8.0 / length + 0.5);
}
else {
- const uint byteRate = data.toUInt(8, false);
+ const unsigned int byteRate = data.toUInt(8, false);
if(byteRate > 0) {
d->length = static_cast<int>(streamLength * 1000.0 / byteRate + 0.5);
d->bitrate = static_cast<int>(byteRate * 8.0 / 1000.0 + 0.5);
*
* \deprecated
*/
- Properties(const ByteVector &data, uint streamLength, ReadStyle style);
+ Properties(const ByteVector &data, unsigned int streamLength, ReadStyle style);
/*!
* Create an instance of WAV::Properties with the data read from the
/*!
* Returns the number of sample frames.
*/
- uint sampleFrames() const;
+ unsigned int sampleFrames() const;
/*!
* Returns the format ID of the file.
/*!
* Returns the year; if there is no year set, this will return 0.
*/
- virtual uint year() const = 0;
+ virtual unsigned int year() const = 0;
/*!
* Returns the track number; if there is no track number set, this will
* return 0.
*/
- virtual uint track() const = 0;
+ virtual unsigned int track() const = 0;
/*!
* Sets the title to \a s. If \a s is String::null then this value will be
/*!
* Sets the year to \a i. If \a s is 0 then this value will be cleared.
*/
- virtual void setYear(uint i) = 0;
+ virtual void setYear(unsigned int i) = 0;
/*!
* Sets the track to \a i. If \a s is 0 then this value will be cleared.
*/
- virtual void setTrack(uint i) = 0;
+ virtual void setTrack(unsigned int i) = 0;
/*!
* Returns true if the tag does not contain any data. This should be
stringUnion(genre);
}
-TagLib::uint TagUnion::year() const
+unsigned int TagUnion::year() const
{
numberUnion(year);
}
-TagLib::uint TagUnion::track() const
+unsigned int TagUnion::track() const
{
numberUnion(track);
}
setUnion(Genre, s);
}
-void TagUnion::setYear(uint i)
+void TagUnion::setYear(unsigned int i)
{
setUnion(Year, i);
}
-void TagUnion::setTrack(uint i)
+void TagUnion::setTrack(unsigned int i)
{
setUnion(Track, i);
}
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual uint year() const;
- virtual uint track() const;
+ virtual unsigned int year() const;
+ virtual unsigned int track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(uint i);
- virtual void setTrack(uint i);
+ virtual void setYear(unsigned int i);
+ virtual void setTrack(unsigned int i);
virtual bool isEmpty() const;
template <class T> T *access(int index, bool create)
class String;
+ // These integer types are deprecated. Do not use them.
+
typedef wchar_t wchar; // Assumed to be sufficient to store a UTF-16 char.
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
+ typedef unsigned long ulong;
typedef unsigned long long ulonglong;
- // long/ulong can be either 32-bit or 64-bit wide.
- typedef unsigned long ulong;
-
/*!
* Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3)
* so I'm providing something here that should be constant.
static const char hexTable[17] = "0123456789abcdef";
-static const uint crcTable[256] = {
+static const unsigned int crcTable[256] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7,
template <class TIterator>
int findChar(
const TIterator dataBegin, const TIterator dataEnd,
- char c, uint offset, int byteAlign)
+ char c, unsigned int offset, int byteAlign)
{
const size_t dataSize = dataEnd - dataBegin;
if(offset + 1 > dataSize)
int findVector(
const TIterator dataBegin, const TIterator dataEnd,
const TIterator patternBegin, const TIterator patternEnd,
- uint offset, int byteAlign)
+ unsigned int offset, int byteAlign)
{
const size_t dataSize = dataEnd - dataBegin;
const size_t patternSize = patternEnd - patternBegin;
class ByteVector::ByteVectorPrivate
{
public:
- ByteVectorPrivate(uint l, char c) :
+ ByteVectorPrivate(unsigned int l, char c) :
counter(new RefCounter()),
data(new std::vector<char>(l, c)),
offset(0),
length(l) {}
- ByteVectorPrivate(const char *s, uint l) :
+ ByteVectorPrivate(const char *s, unsigned int l) :
counter(new RefCounter()),
data(new std::vector<char>(s, s + l)),
offset(0),
length(l) {}
- ByteVectorPrivate(const ByteVectorPrivate &d, uint o, uint l) :
+ ByteVectorPrivate(const ByteVectorPrivate &d, unsigned int o, unsigned int l) :
counter(d.counter),
data(d.data),
offset(d.offset + o),
RefCounter *counter;
std::vector<char> *data;
- uint offset;
- uint length;
+ unsigned int offset;
+ unsigned int length;
};
////////////////////////////////////////////////////////////////////////////////
ByteVector ByteVector::null;
-ByteVector ByteVector::fromCString(const char *s, uint length)
+ByteVector ByteVector::fromCString(const char *s, unsigned int length)
{
if(length == 0xffffffff)
return ByteVector(s, ::strlen(s));
return ByteVector(s, length);
}
-ByteVector ByteVector::fromUInt(uint value, bool mostSignificantByteFirst)
+ByteVector ByteVector::fromUInt(unsigned int value, bool mostSignificantByteFirst)
{
- return fromNumber<uint>(value, mostSignificantByteFirst);
+ return fromNumber<unsigned int>(value, mostSignificantByteFirst);
}
ByteVector ByteVector::fromShort(short value, bool mostSignificantByteFirst)
ByteVector ByteVector::fromFloat32LE(float value)
{
- return fromFloat<float, uint, Utils::LittleEndian>(value);
+ return fromFloat<float, unsigned int, Utils::LittleEndian>(value);
}
ByteVector ByteVector::fromFloat32BE(float value)
{
- return fromFloat<float, uint, Utils::BigEndian>(value);
+ return fromFloat<float, unsigned int, Utils::BigEndian>(value);
}
ByteVector ByteVector::fromFloat64LE(double value)
{
}
-ByteVector::ByteVector(uint size, char value) :
+ByteVector::ByteVector(unsigned int size, char value) :
d(new ByteVectorPrivate(size, value))
{
}
{
}
-ByteVector::ByteVector(const ByteVector &v, uint offset, uint length) :
+ByteVector::ByteVector(const ByteVector &v, unsigned int offset, unsigned int length) :
d(new ByteVectorPrivate(*v.d, offset, length))
{
}
{
}
-ByteVector::ByteVector(const char *data, uint length) :
+ByteVector::ByteVector(const char *data, unsigned int length) :
d(new ByteVectorPrivate(data, length))
{
}
delete d;
}
-ByteVector &ByteVector::setData(const char *s, uint length)
+ByteVector &ByteVector::setData(const char *s, unsigned int length)
{
ByteVector(s, length).swap(*this);
return *this;
return (size() > 0) ? (&(*d->data)[d->offset]) : 0;
}
-ByteVector ByteVector::mid(uint index, uint length) const
+ByteVector ByteVector::mid(unsigned int index, unsigned int length) const
{
index = std::min(index, size());
length = std::min(length, size() - index);
return ByteVector(*this, index, length);
}
-char ByteVector::at(uint index) const
+char ByteVector::at(unsigned int index) const
{
return (index < size()) ? (*d->data)[d->offset + index] : 0;
}
-int ByteVector::find(const ByteVector &pattern, uint offset, int byteAlign) const
+int ByteVector::find(const ByteVector &pattern, unsigned int offset, int byteAlign) const
{
return findVector<ConstIterator>(
begin(), end(), pattern.begin(), pattern.end(), offset, byteAlign);
}
-int ByteVector::find(char c, uint offset, int byteAlign) const
+int ByteVector::find(char c, unsigned int offset, int byteAlign) const
{
return findChar<ConstIterator>(begin(), end(), c, offset, byteAlign);
}
-int ByteVector::rfind(const ByteVector &pattern, uint offset, int byteAlign) const
+int ByteVector::rfind(const ByteVector &pattern, unsigned int offset, int byteAlign) const
{
if(offset > 0) {
offset = size() - offset - pattern.size();
return size() - pos - pattern.size();
}
-bool ByteVector::containsAt(const ByteVector &pattern, uint offset, uint patternOffset, uint patternLength) const
+bool ByteVector::containsAt(const ByteVector &pattern, unsigned int offset, unsigned int patternOffset, unsigned int patternLength) const
{
if(pattern.size() < patternLength)
patternLength = pattern.size();
// do some sanity checking -- all of these things are needed for the search to be valid
- const uint compareLength = patternLength - patternOffset;
+ const unsigned int compareLength = patternLength - patternOffset;
if(offset + compareLength > size() || patternOffset >= pattern.size() || patternLength == 0)
return false;
// try to match the last n-1 bytes from the vector (where n is the pattern
// size) -- continue trying to match n-2, n-3...1 bytes
- for(uint i = 1; i < pattern.size(); i++) {
+ for(unsigned int i = 1; i < pattern.size(); i++) {
if(containsAt(pattern, startIndex + i, 0, pattern.size() - i))
return startIndex + i;
}
{
if(v.d->length != 0) {
detach();
- uint originalSize = size();
+ unsigned int originalSize = size();
resize(originalSize + v.size());
::memcpy(data() + originalSize, v.data(), v.size());
}
return *this;
}
-TagLib::uint ByteVector::size() const
+unsigned int ByteVector::size() const
{
return d->length;
}
-ByteVector &ByteVector::resize(uint size, char padding)
+ByteVector &ByteVector::resize(unsigned int size, char padding)
{
if(size != d->length) {
detach();
return (d->length == 0);
}
-TagLib::uint ByteVector::checksum() const
+unsigned int ByteVector::checksum() const
{
- uint sum = 0;
+ unsigned int sum = 0;
for(ByteVector::ConstIterator it = begin(); it != end(); ++it)
sum = (sum << 8) ^ crcTable[((sum >> 24) & 0xff) ^ static_cast<unsigned char>(*it)];
return sum;
}
-TagLib::uint ByteVector::toUInt(bool mostSignificantByteFirst) const
+unsigned int ByteVector::toUInt(bool mostSignificantByteFirst) const
{
- return toNumber<uint>(*this, 0, mostSignificantByteFirst);
+ return toNumber<unsigned int>(*this, 0, mostSignificantByteFirst);
}
-TagLib::uint ByteVector::toUInt(uint offset, bool mostSignificantByteFirst) const
+unsigned int ByteVector::toUInt(unsigned int offset, bool mostSignificantByteFirst) const
{
- return toNumber<uint>(*this, offset, mostSignificantByteFirst);
+ return toNumber<unsigned int>(*this, offset, mostSignificantByteFirst);
}
-TagLib::uint ByteVector::toUInt(uint offset, uint length, bool mostSignificantByteFirst) const
+unsigned int ByteVector::toUInt(unsigned int offset, unsigned int length, bool mostSignificantByteFirst) const
{
- return toNumber<uint>(*this, offset, length, mostSignificantByteFirst);
+ return toNumber<unsigned int>(*this, offset, length, mostSignificantByteFirst);
}
short ByteVector::toShort(bool mostSignificantByteFirst) const
return toNumber<unsigned short>(*this, 0, mostSignificantByteFirst);
}
-short ByteVector::toShort(uint offset, bool mostSignificantByteFirst) const
+short ByteVector::toShort(unsigned int offset, bool mostSignificantByteFirst) const
{
return toNumber<unsigned short>(*this, offset, mostSignificantByteFirst);
}
return toNumber<unsigned short>(*this, 0, mostSignificantByteFirst);
}
-unsigned short ByteVector::toUShort(uint offset, bool mostSignificantByteFirst) const
+unsigned short ByteVector::toUShort(unsigned int offset, bool mostSignificantByteFirst) const
{
return toNumber<unsigned short>(*this, offset, mostSignificantByteFirst);
}
return toNumber<unsigned long long>(*this, 0, mostSignificantByteFirst);
}
-long long ByteVector::toLongLong(uint offset, bool mostSignificantByteFirst) const
+long long ByteVector::toLongLong(unsigned int offset, bool mostSignificantByteFirst) const
{
return toNumber<unsigned long long>(*this, offset, mostSignificantByteFirst);
}
float ByteVector::toFloat32LE(size_t offset) const
{
- return toFloat<float, uint, Utils::LittleEndian>(*this, offset);
+ return toFloat<float, unsigned int, Utils::LittleEndian>(*this, offset);
}
float ByteVector::toFloat32BE(size_t offset) const
{
- return toFloat<float, uint, Utils::BigEndian>(*this, offset);
+ return toFloat<float, unsigned int, Utils::BigEndian>(*this, offset);
}
double ByteVector::toFloat64LE(size_t offset) const
ByteVector encoded(size() * 2);
char *p = encoded.data();
- for(uint i = 0; i < size(); i++) {
+ for(unsigned int i = 0; i < size(); i++) {
unsigned char c = data()[i];
*p++ = hexTable[(c >> 4) & 0x0F];
*p++ = hexTable[(c ) & 0x0F];
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80
};
- uint len = input.size();
+ unsigned int len = input.size();
ByteVector output(len);
{
static const char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
if (size()) {
- uint len = size();
+ unsigned int len = size();
ByteVector output(4 * ((len - 1) / 3 + 1)); // note roundup
const char * src = data();
std::ostream &operator<<(std::ostream &s, const TagLib::ByteVector &v)
{
- for(TagLib::uint i = 0; i < v.size(); i++)
+ for(unsigned int i = 0; i < v.size(); i++)
s << v[i];
return s;
}
* Construct a vector of size \a size with all values set to \a value by
* default.
*/
- ByteVector(uint size, char value = 0);
+ ByteVector(unsigned int size, char value = 0);
/*!
* Constructs a byte vector that is a copy of \a v.
/*!
* Constructs a byte vector that is a copy of \a v.
*/
- ByteVector(const ByteVector &v, uint offset, uint length);
+ ByteVector(const ByteVector &v, unsigned int offset, unsigned int length);
/*!
* Constructs a byte vector that contains \a c.
/*!
* Constructs a byte vector that copies \a data for up to \a length bytes.
*/
- ByteVector(const char *data, uint length);
+ ByteVector(const char *data, unsigned int length);
/*!
* Constructs a byte vector that copies \a data up to the first null
/*!
* Sets the data for the byte array using the first \a length bytes of \a data
*/
- ByteVector &setData(const char *data, uint length);
+ ByteVector &setData(const char *data, unsigned int length);
/*!
* Sets the data for the byte array copies \a data up to the first null
* for \a length bytes. If \a length is not specified it will return the bytes
* from \a index to the end of the vector.
*/
- ByteVector mid(uint index, uint length = 0xffffffff) const;
+ ByteVector mid(unsigned int index, unsigned int length = 0xffffffff) const;
/*!
* This essentially performs the same as operator[](), but instead of causing
* a runtime error if the index is out of bounds, it will return a null byte.
*/
- char at(uint index) const;
+ char at(unsigned int index) const;
/*!
* Searches the ByteVector for \a pattern starting at \a offset and returns
* specified the pattern will only be matched if it starts on a byte divisible
* by \a byteAlign (starting from \a offset).
*/
- int find(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const;
+ int find(const ByteVector &pattern, unsigned int offset = 0, int byteAlign = 1) const;
/*!
* Searches the char for \a c starting at \a offset and returns
* specified the pattern will only be matched if it starts on a byte divisible
* by \a byteAlign (starting from \a offset).
*/
- int find(char c, uint offset = 0, int byteAlign = 1) const;
+ int find(char c, unsigned int offset = 0, int byteAlign = 1) const;
/*!
* Searches the ByteVector for \a pattern starting from either the end of the
* not found. If \a byteAlign is specified the pattern will only be matched
* if it starts on a byte divisible by \a byteAlign (starting from \a offset).
*/
- int rfind(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const;
+ int rfind(const ByteVector &pattern, unsigned int offset = 0, int byteAlign = 1) const;
/*!
* Checks to see if the vector contains the \a pattern starting at position
* specify to only check for the first \a patternLength bytes of \a pattern with
* the \a patternLength argument.
*/
- bool containsAt(const ByteVector &pattern, uint offset, uint patternOffset = 0, uint patternLength = 0xffffffff) const;
+ bool containsAt(const ByteVector &pattern, unsigned int offset,
+ unsigned int patternOffset = 0, unsigned int patternLength = 0xffffffff) const;
/*!
* Returns true if the vector starts with \a pattern.
/*!
* Returns the size of the array.
*/
- uint size() const;
+ unsigned int size() const;
/*!
* Resize the vector to \a size. If the vector is currently less than
* \a size, pad the remaining spaces with \a padding. Returns a reference
* to the resized vector.
*/
- ByteVector &resize(uint size, char padding = 0);
+ ByteVector &resize(unsigned int size, char padding = 0);
/*!
* Returns an Iterator that points to the front of the vector.
* \note This uses an uncommon variant of CRC32 specializes in Ogg.
*/
// BIC: Remove or make generic.
- uint checksum() const;
+ unsigned int checksum() const;
/*!
* Converts the first 4 bytes of the vector to an unsigned integer.
*
* \see fromUInt()
*/
- uint toUInt(bool mostSignificantByteFirst = true) const;
+ unsigned int toUInt(bool mostSignificantByteFirst = true) const;
/*!
* Converts the 4 bytes at \a offset of the vector to an unsigned integer.
*
* \see fromUInt()
*/
- uint toUInt(uint offset, bool mostSignificantByteFirst = true) const;
+ unsigned int toUInt(unsigned int offset, bool mostSignificantByteFirst = true) const;
/*!
* Converts the \a length bytes at \a offset of the vector to an unsigned
*
* \see fromUInt()
*/
- uint toUInt(uint offset, uint length, bool mostSignificantByteFirst = true) const;
+ unsigned int toUInt(unsigned int offset, unsigned int length,
+ bool mostSignificantByteFirst = true) const;
/*!
* Converts the first 2 bytes of the vector to a (signed) short.
*
* \see fromShort()
*/
- short toShort(uint offset, bool mostSignificantByteFirst = true) const;
+ short toShort(unsigned int offset, bool mostSignificantByteFirst = true) const;
/*!
* Converts the first 2 bytes of the vector to a unsigned short.
*
* \see fromShort()
*/
- unsigned short toUShort(uint offset, bool mostSignificantByteFirst = true) const;
+ unsigned short toUShort(unsigned int offset, bool mostSignificantByteFirst = true) const;
/*!
* Converts the first 8 bytes of the vector to a (signed) long long.
*
* \see fromUInt()
*/
- long long toLongLong(uint offset, bool mostSignificantByteFirst = true) const;
+ long long toLongLong(unsigned int offset, bool mostSignificantByteFirst = true) const;
/*
* Converts the 4 bytes at \a offset of the vector to a float as an IEEE754
*
* \see toUInt()
*/
- static ByteVector fromUInt(uint value, bool mostSignificantByteFirst = true);
+ static ByteVector fromUInt(unsigned int value, bool mostSignificantByteFirst = true);
/*!
* Creates a 2 byte ByteVector based on \a value. If
/*!
* Returns a ByteVector based on the CString \a s.
*/
- static ByteVector fromCString(const char *s, uint length = 0xffffffff);
+ static ByteVector fromCString(const char *s, unsigned int length = 0xffffffff);
/*!
* Returns a const reference to the byte at \a index.
ByteVector toBase64() const;
/*!
- * Decodes the base64 encoded byte vector.
+ * Decodes the base64 encoded byte vector.
*/
static ByteVector fromBase64(const ByteVector &);
{
ByteVectorList l;
- uint previousOffset = 0;
+ unsigned int previousOffset = 0;
for(int offset = v.find(pattern, 0, byteAlign);
offset != -1 && (max == 0 || max > int(l.size()) + 1);
offset = v.find(pattern, offset + pattern.size(), byteAlign))
void ByteVectorStream::writeBlock(const ByteVector &data)
{
- uint size = data.size();
+ unsigned int size = data.size();
if(long(d->position + size) > length()) {
truncate(d->position + size);
}
// protected members
////////////////////////////////////////////////////////////////////////////////
-TagLib::uint File::bufferSize()
+unsigned int File::bufferSize()
{
return 1024;
}
/*!
* Returns the buffer size that is used for internal buffering.
*/
- static uint bufferSize();
+ static unsigned int bufferSize();
private:
File(const File &);
if(length > bufferSize() && length > streamLength)
length = streamLength;
- ByteVector buffer(static_cast<uint>(length));
+ ByteVector buffer(static_cast<unsigned int>(length));
const size_t count = readFile(d->file, buffer);
- buffer.resize(static_cast<uint>(count));
+ buffer.resize(static_cast<unsigned int>(count));
return buffer;
}
long writePosition = start;
ByteVector buffer = data;
- ByteVector aboutToOverwrite(static_cast<uint>(bufferLength));
+ ByteVector aboutToOverwrite(static_cast<unsigned int>(bufferLength));
while(true)
{
long readPosition = start + length;
long writePosition = start;
- ByteVector buffer(static_cast<uint>(bufferLength));
+ ByteVector buffer(static_cast<unsigned int>(bufferLength));
for(size_t bytesRead = -1; bytesRead != 0;)
{
#endif
}
-TagLib::uint FileStream::bufferSize()
+unsigned int FileStream::bufferSize()
{
return 1024;
}
/*!
* Returns the buffer size that is used for internal buffering.
*/
- static uint bufferSize();
+ static unsigned int bufferSize();
private:
class FileStreamPrivate;
*
* \see isEmpty()
*/
- uint size() const;
+ unsigned int size() const;
/*!
* Returns whether or not the list is empty.
*
* \warning This method is slow. Use iterators to loop through the list.
*/
- T &operator[](uint i);
+ T &operator[](unsigned int i);
/*!
* Returns a const reference to item \a i in the list.
*
* \warning This method is slow. Use iterators to loop through the list.
*/
- const T &operator[](uint i) const;
+ const T &operator[](unsigned int i) const;
/*!
* Make a shallow, implicitly shared, copy of \a l. Because this is
}
template <class T>
-TagLib::uint List<T>::size() const
+unsigned int List<T>::size() const
{
return d->list.size();
}
}
template <class T>
-T &List<T>::operator[](uint i)
+T &List<T>::operator[](unsigned int i)
{
Iterator it = d->list.begin();
std::advance(it, i);
}
template <class T>
-const T &List<T>::operator[](uint i) const
+const T &List<T>::operator[](unsigned int i) const
{
ConstIterator it = d->list.begin();
std::advance(it, i);
*
* \see isEmpty()
*/
- uint size() const;
+ unsigned int size() const;
/*!
* Returns true if the map is empty.
}
template <class Key, class T>
-TagLib::uint Map<Key, T>::size() const
+unsigned int Map<Key, T>::size() const
{
return d->map.size();
}
StringPrivate() :
RefCounter() {}
- StringPrivate(uint n, wchar_t c) :
+ StringPrivate(unsigned int n, wchar_t c) :
RefCounter(),
data(static_cast<size_t>(n), c) {}
return substr(0, s.length()) == s;
}
-String String::substr(uint position, uint n) const
+String String::substr(unsigned int position, unsigned int n) const
{
return String(d->data.substr(position, n));
}
return s;
}
-TagLib::uint String::size() const
+unsigned int String::size() const
{
return d->data.size();
}
-TagLib::uint String::length() const
+unsigned int String::length() const
{
return size();
}
* Extract a substring from this string starting at \a position and
* continuing for \a n characters.
*/
- String substr(uint position, uint n = 0xffffffff) const;
+ String substr(unsigned int position, unsigned int n = 0xffffffff) const;
/*!
* Append \a s to the current string and return a reference to the current
/*!
* Returns the size of the string.
*/
- uint size() const;
+ unsigned int size() const;
/*!
* Returns the length of the string. Equivalent to size().
*/
- uint length() const;
+ unsigned int length() const;
/*!
* Returns true if the string is empty.
/*!
* Reverses the order of bytes in an 32-bit integer.
*/
- inline uint byteSwap(uint x)
+ inline unsigned int byteSwap(unsigned int x)
{
#if defined(HAVE_BOOST_BYTESWAP)
const ID3v2::FrameFactory *ID3v2FrameFactory;
long ID3v2Location;
- uint ID3v2OriginalSize;
+ unsigned int ID3v2OriginalSize;
long ID3v1Location;
int sampleRate;
int channels;
int bitsPerSample;
- uint sampleFrames;
+ unsigned int sampleFrames;
};
////////////////////////////////////////////////////////////////////////////////
return d->channels;
}
-TagLib::uint TrueAudio::Properties::sampleFrames() const
+unsigned int TrueAudio::Properties::sampleFrames() const
{
return d->sampleFrames;
}
return;
}
- uint pos = 3;
+ unsigned int pos = 3;
d->version = data[pos] - '0';
pos += 1;
class File;
- static const uint HeaderSize = 18;
+ static const unsigned int HeaderSize = 18;
//! An implementation of audio property reading for TrueAudio
/*!
* Returns the total number of sample frames
*/
- uint sampleFrames() const;
+ unsigned int sampleFrames() const;
/*!
* Returns the major version number.
}
long APELocation;
- uint APESize;
+ unsigned int APESize;
long ID3v1Location;
int version;
int bitsPerSample;
bool lossless;
- uint sampleFrames;
+ unsigned int sampleFrames;
};
////////////////////////////////////////////////////////////////////////////////
return d->lossless;
}
-TagLib::uint WavPack::Properties::sampleFrames() const
+unsigned int WavPack::Properties::sampleFrames() const
{
return d->sampleFrames;
}
break;
}
- const uint flags = data.toUInt(24, false);
+ const unsigned int flags = data.toUInt(24, false);
if(offset == 0) {
d->version = data.toShort(8, false);
if(flags & FINAL_BLOCK)
break;
- const uint blockSize = data.toUInt(4, false);
+ const unsigned int blockSize = data.toUInt(4, false);
offset += blockSize + 8;
}
}
}
-TagLib::uint WavPack::Properties::seekFinalIndex(File *file, long streamLength)
+unsigned int WavPack::Properties::seekFinalIndex(File *file, long streamLength)
{
const long offset = file->rfind("wvpk", streamLength);
if(offset == -1)
if(version < MIN_STREAM_VERS || version > MAX_STREAM_VERS)
return 0;
- const uint flags = data.toUInt(24, false);
+ const unsigned int flags = data.toUInt(24, false);
if(!(flags & FINAL_BLOCK))
return 0;
- const uint blockIndex = data.toUInt(16, false);
- const uint blockSamples = data.toUInt(20, false);
+ const unsigned int blockIndex = data.toUInt(16, false);
+ const unsigned int blockSamples = data.toUInt(20, false);
return blockIndex + blockSamples;
}
class File;
- static const uint HeaderSize = 32;
+ static const unsigned int HeaderSize = 32;
//! An implementation of audio property reading for WavPack
/*!
* Returns the total number of audio samples in file.
*/
- uint sampleFrames() const;
+ unsigned int sampleFrames() const;
/*!
* Returns WavPack version.
Properties &operator=(const Properties &);
void read(File *file, long streamLength);
- uint seekFinalIndex(File *file, long streamLength);
+ unsigned int seekFinalIndex(File *file, long streamLength);
class PropertiesPrivate;
PropertiesPrivate *d;
using namespace TagLib;
using namespace XM;
-using TagLib::uint;
/*!
* The Reader classes are helpers to make handling of the stripped XM
* Reads associated values from \a file, but never reads more
* then \a limit bytes.
*/
- virtual uint read(TagLib::File &file, uint limit) = 0;
+ virtual unsigned int read(TagLib::File &file, unsigned int limit) = 0;
/*!
* Returns the number of bytes this reader would like to read.
*/
- virtual uint size() const = 0;
+ virtual unsigned int size() const = 0;
};
class SkipReader : public Reader
{
public:
- SkipReader(uint size) : m_size(size)
+ SkipReader(unsigned int size) : m_size(size)
{
}
- uint read(TagLib::File &file, uint limit)
+ unsigned int read(TagLib::File &file, unsigned int limit)
{
- uint count = std::min(m_size, limit);
+ unsigned int count = std::min(m_size, limit);
file.seek(count, TagLib::File::Current);
return count;
}
- uint size() const
+ unsigned int size() const
{
return m_size;
}
private:
- uint m_size;
+ unsigned int m_size;
};
template<typename T>
class StringReader : public ValueReader<String>
{
public:
- StringReader(String &string, uint size) :
+ StringReader(String &string, unsigned int size) :
ValueReader<String>(string), m_size(size)
{
}
- uint read(TagLib::File &file, uint limit)
+ unsigned int read(TagLib::File &file, unsigned int limit)
{
ByteVector data = file.readBlock(std::min(m_size, limit));
- uint count = data.size();
+ unsigned int count = data.size();
int index = data.find((char) 0);
if(index > -1) {
data.resize(index);
return count;
}
- uint size() const
+ unsigned int size() const
{
return m_size;
}
private:
- uint m_size;
+ unsigned int m_size;
};
class ByteReader : public ValueReader<unsigned char>
public:
ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {}
- uint read(TagLib::File &file, uint limit)
+ unsigned int read(TagLib::File &file, unsigned int limit)
{
ByteVector data = file.readBlock(std::min(1U,limit));
if(data.size() > 0) {
return data.size();
}
- uint size() const
+ unsigned int size() const
{
return 1;
}
U16Reader(unsigned short &value, bool bigEndian)
: NumberReader<unsigned short>(value, bigEndian) {}
- uint read(TagLib::File &file, uint limit)
+ unsigned int read(TagLib::File &file, unsigned int limit)
{
ByteVector data = file.readBlock(std::min(2U,limit));
value = data.toUShort(bigEndian);
return data.size();
}
- uint size() const
+ unsigned int size() const
{
return 2;
}
{
}
- uint read(TagLib::File &file, uint limit)
+ unsigned int read(TagLib::File &file, unsigned int limit)
{
ByteVector data = file.readBlock(std::min(4U,limit));
value = data.toUInt(bigEndian);
return data.size();
}
- uint size() const
+ unsigned int size() const
{
return 4;
}
/*!
* Don't read anything but skip \a size bytes.
*/
- StructReader &skip(uint size)
+ StructReader &skip(unsigned int size)
{
m_readers.append(new SkipReader(size));
return *this;
/*!
* Read a string of \a size characters (bytes) into \a string.
*/
- StructReader &string(String &string, uint size)
+ StructReader &string(String &string, unsigned int size)
{
m_readers.append(new StringReader(string, size));
return *this;
return u32(number, true);
}
- uint size() const
+ unsigned int size() const
{
- uint size = 0;
+ unsigned int size = 0;
for(List<Reader*>::ConstIterator i = m_readers.begin();
i != m_readers.end(); ++ i) {
size += (*i)->size();
return size;
}
- uint read(TagLib::File &file, uint limit)
+ unsigned int read(TagLib::File &file, unsigned int limit)
{
- uint sumcount = 0;
+ unsigned int sumcount = 0;
for(List<Reader*>::ConstIterator i = m_readers.begin();
limit > 0 && i != m_readers.end(); ++ i) {
- uint count = (*i)->read(file, limit);
+ unsigned int count = (*i)->read(file, limit);
limit -= count;
sumcount += count;
}
}
const StringList lines = d->tag.comment().split("\n");
- uint sampleNameIndex = instrumentCount;
+ unsigned int sampleNameIndex = instrumentCount;
for(unsigned short i = 0; i < instrumentCount; ++ i) {
seek(pos);
unsigned long instrumentHeaderSize = 0;
return false;
seek(pos + 4);
- const uint len = std::min(22UL, instrumentHeaderSize - 4U);
+ const unsigned int len = std::min(22UL, instrumentHeaderSize - 4U);
if(i >= lines.size())
writeString(String(), len);
else
if(sampleHeaderSize > 18U) {
seek(pos + 18);
- const uint len = std::min(sampleHeaderSize - 18U, 22UL);
+ const unsigned int len = std::min(sampleHeaderSize - 18U, 22UL);
if(sampleNameIndex >= lines.size())
writeString(String(), len);
else
.u16L(tempo)
.u16L(bpmSpeed);
- uint count = header.read(*this, headerSize - 4U);
- uint size = std::min(headerSize - 4U, (unsigned long)header.size());
+ unsigned int count = header.read(*this, headerSize - 4U);
+ unsigned int size = std::min(headerSize - 4U, (unsigned long)header.size());
READ_ASSERT(count == size);
StructReader pattern;
pattern.byte(packingType).u16L(rowCount).u16L(dataSize);
- uint count = pattern.read(*this, patternHeaderLength - 4U);
+ unsigned int count = pattern.read(*this, patternHeaderLength - 4U);
READ_ASSERT(count == std::min(patternHeaderLength - 4U, (unsigned long)pattern.size()));
seek(patternHeaderLength - (4 + count) + dataSize, Current);
StringList intrumentNames;
StringList sampleNames;
- uint sumSampleCount = 0;
+ unsigned int sumSampleCount = 0;
// read instruments:
for(unsigned short i = 0; i < instrumentCount; ++ i) {
instrument.string(instrumentName, 22).byte(instrumentType).u16L(sampleCount);
// 4 for instrumentHeaderSize
- uint count = 4 + instrument.read(*this, instrumentHeaderSize - 4U);
+ unsigned int count = 4 + instrument.read(*this, instrumentHeaderSize - 4U);
READ_ASSERT(count == std::min(instrumentHeaderSize, (unsigned long)instrument.size() + 4));
unsigned long sampleHeaderSize = 0;
.byte(compression)
.string(sampleName, 22);
- uint count = sample.read(*this, sampleHeaderSize);
+ unsigned int count = sample.read(*this, sampleHeaderSize);
READ_ASSERT(count == std::min(sampleHeaderSize, (unsigned long)sample.size()));
// skip unhandeled header proportion:
seek(sampleHeaderSize - count, Current);
unsigned short restartPosition;
unsigned short patternCount;
unsigned short instrumentCount;
- uint sampleCount;
+ unsigned int sampleCount;
unsigned short flags;
unsigned short tempo;
unsigned short bpmSpeed;
return d->instrumentCount;
}
-TagLib::uint XM::Properties::sampleCount() const
+unsigned int XM::Properties::sampleCount() const
{
return d->sampleCount;
}
d->instrumentCount = instrumentCount;
}
-void XM::Properties::setSampleCount(uint sampleCount)
+void XM::Properties::setSampleCount(unsigned int sampleCount)
{
d->sampleCount = sampleCount;
}
unsigned short restartPosition() const;
unsigned short patternCount() const;
unsigned short instrumentCount() const;
- uint sampleCount() const;
+ unsigned int sampleCount() const;
unsigned short flags() const;
unsigned short tempo() const;
unsigned short bpmSpeed() const;
void setRestartPosition(unsigned short restartPosition);
void setPatternCount(unsigned short patternCount);
void setInstrumentCount(unsigned short instrumentCount);
- void setSampleCount(uint sampleCount);
+ void setSampleCount(unsigned int sampleCount);
void setFlags(unsigned short flags);
void setTempo(unsigned short tempo);
void setBpmSpeed(unsigned short bpmSpeed);
APE::Item item3 = APE::Item("TRACKNUMBER", "29");
tag.setItem("TRACKNUMBER", item3);
properties = tag.properties();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), properties["TRACKNUMBER"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, properties["TRACKNUMBER"].size());
CPPUNIT_ASSERT_EQUAL(String("17"), properties["TRACKNUMBER"][0]);
CPPUNIT_ASSERT_EQUAL(String("29"), properties["TRACKNUMBER"][1]);
APE::Tag tag;
PropertyMap unsuccessful = tag.setProperties(properties);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), unsuccessful.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, unsuccessful.size());
CPPUNIT_ASSERT(unsuccessful.contains("A"));
CPPUNIT_ASSERT(unsuccessful.contains("MP+"));
}
CPPUNIT_ASSERT(f.tag()->contains("WM/TrackNumber"));
CPPUNIT_ASSERT_EQUAL(ASF::Attribute::DWordType,
f.tag()->attribute("WM/TrackNumber").front().type());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(123), f.tag()->track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)123, f.tag()->track());
f.tag()->setTrack(234);
f.save();
}
CPPUNIT_ASSERT(f.tag()->contains("WM/TrackNumber"));
CPPUNIT_ASSERT_EQUAL(ASF::Attribute::UnicodeType,
f.tag()->attribute("WM/TrackNumber").front().type());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(234), f.tag()->track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)234, f.tag()->track());
}
}
{
ASF::File f(newname.c_str());
ASF::AttributeList values2 = f.tag()->attribute("WM/Picture");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), values2.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, values2.size());
ASF::Attribute attr2 = values2.front();
ASF::Picture picture2 = attr2.toPicture();
CPPUNIT_ASSERT(picture2.isValid());
{
ASF::File f(newname.c_str());
ASF::AttributeList values2 = f.tag()->attribute("WM/Picture");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), values2.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, values2.size());
ASF::Picture picture3 = values2[1].toPicture();
CPPUNIT_ASSERT(picture3.isValid());
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), picture3.mimeType());
ByteVector a = ByteVector("0123456789");
ByteVector b = a.mid(3, 4);
b.resize(6, 'A');
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(6), b.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)6, b.size());
CPPUNIT_ASSERT_EQUAL('6', b[3]);
CPPUNIT_ASSERT_EQUAL('A', b[4]);
CPPUNIT_ASSERT_EQUAL('A', b[5]);
b.resize(10, 'B');
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), b.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)10, b.size());
CPPUNIT_ASSERT_EQUAL('6', b[3]);
CPPUNIT_ASSERT_EQUAL('B', b[6]);
CPPUNIT_ASSERT_EQUAL('B', b[9]);
b.resize(3, 'C');
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), b.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, b.size());
CPPUNIT_ASSERT_EQUAL(-1, b.find('C'));
b.resize(3);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), b.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, b.size());
// Check if a and b were properly detached.
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), a.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)10, a.size());
CPPUNIT_ASSERT_EQUAL('3', a[3]);
CPPUNIT_ASSERT_EQUAL('5', a[5]);
ByteVector c = ByteVector("0123456789").mid(3, 4);
c.resize(6, 'A');
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(6), c.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)6, c.size());
CPPUNIT_ASSERT_EQUAL('6', c[3]);
CPPUNIT_ASSERT_EQUAL('A', c[4]);
CPPUNIT_ASSERT_EQUAL('A', c[5]);
c.resize(10, 'B');
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), c.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)10, c.size());
CPPUNIT_ASSERT_EQUAL('6', c[3]);
CPPUNIT_ASSERT_EQUAL('B', c[6]);
CPPUNIT_ASSERT_EQUAL('B', c[9]);
c.resize(3, 'C');
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), c.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, c.size());
CPPUNIT_ASSERT_EQUAL(-1, c.find('C'));
}
CPPUNIT_ASSERT_EQUAL(t2, ByteVector::fromBase64(s2.toBase64()));
CPPUNIT_ASSERT_EQUAL(t3, ByteVector::fromBase64(s3.toBase64()));
- ByteVector all((uint)256);
+ ByteVector all((unsigned int)256);
// in order
{
ByteVector v("a b");
ByteVectorList l = ByteVectorList::split(v, " ");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), l.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
CPPUNIT_ASSERT_EQUAL(ByteVector("a"), l[0]);
CPPUNIT_ASSERT_EQUAL(ByteVector("b"), l[1]);
}
ByteVector v("a");
ByteVectorList l = ByteVectorList::split(v, " ");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), l.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, l.size());
CPPUNIT_ASSERT_EQUAL(ByteVector("a"), l[0]);
}
file.seek(0);
const ByteVector v = file.readBlock(file.length());
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)10, v.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)10, v.size());
CPPUNIT_ASSERT_EQUAL((long)v.find("23"), file.find("23"));
CPPUNIT_ASSERT_EQUAL((long)v.find("23", 2), file.find("23", 2));
file.seek(0);
const ByteVector v = file.readBlock(file.length());
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)10, v.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)10, v.size());
CPPUNIT_ASSERT_EQUAL((long)v.rfind("23"), file.rfind("23"));
CPPUNIT_ASSERT_EQUAL((long)v.rfind("23", 7), file.rfind("23", 7));
CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("test title"));
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("Test!"));
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("albummmm"));
- CPPUNIT_ASSERT_EQUAL(f.tag()->track(), TagLib::uint(5));
- CPPUNIT_ASSERT_EQUAL(f.tag()->year(), TagLib::uint(2020));
+ CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)5);
+ CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2020);
f.tag()->setArtist("ttest artist");
f.tag()->setTitle("ytest title");
f.tag()->setGenre("uTest!");
CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("ytest title"));
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!"));
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm"));
- CPPUNIT_ASSERT_EQUAL(f.tag()->track(), TagLib::uint(7));
- CPPUNIT_ASSERT_EQUAL(f.tag()->year(), TagLib::uint(2080));
+ CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7);
+ CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080);
}
{
FileStream fs(newname.c_str());
CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("ytest title"));
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!"));
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm"));
- CPPUNIT_ASSERT_EQUAL(f.tag()->track(), TagLib::uint(7));
- CPPUNIT_ASSERT_EQUAL(f.tag()->year(), TagLib::uint(2080));
+ CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7);
+ CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080);
}
}
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
FLAC::Picture *pic = lst.front();
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::FrontCover, pic->type());
CPPUNIT_ASSERT_EQUAL(0, pic->numColors());
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType());
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic->data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic->data().size());
}
void testAddPicture()
{
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
FLAC::Picture *newpic = new FLAC::Picture();
newpic->setType(FLAC::Picture::BackCover);
{
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, lst.size());
FLAC::Picture *pic = lst[0];
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::FrontCover, pic->type());
CPPUNIT_ASSERT_EQUAL(0, pic->numColors());
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType());
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic->data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic->data().size());
pic = lst[1];
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::BackCover, pic->type());
{
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
FLAC::Picture *newpic = new FLAC::Picture();
newpic->setType(FLAC::Picture::BackCover);
{
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
FLAC::Picture *pic = lst[0];
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::BackCover, pic->type());
{
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
f.removePictures();
f.save();
{
FLAC::File f(newname.c_str());
List<FLAC::Picture *> lst = f.pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, lst.size());
}
}
{
FLAC::File f(newname.c_str());
Ogg::FieldListMap m = f.xiphComment()->fieldListMap();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), m["ARTIST"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, m["ARTIST"].size());
CPPUNIT_ASSERT_EQUAL(String("artist 1"), m["ARTIST"][0]);
CPPUNIT_ASSERT_EQUAL(String("artist 2"), m["ARTIST"][1]);
}
{
FLAC::File f(newname.c_str());
PropertyMap dict = f.properties();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["ARTIST"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["ARTIST"].size());
CPPUNIT_ASSERT_EQUAL(String("artøst 1"), dict["ARTIST"][0]);
CPPUNIT_ASSERT_EQUAL(String("artöst 2"), dict["ARTIST"][1]);
}
map[L"H\x00c4\x00d6"] = String("bla");
FLAC::File f(copy.fileName().c_str());
PropertyMap invalid = f.setProperties(map);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), invalid.size());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.properties().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, invalid.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.properties().size());
}
void testAudioProperties()
CPPUNIT_ASSERT_EQUAL(0, pic.numColors());
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic.mimeType());
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic.description());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic.data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic.data().size());
}
void testPassThrough()
"d\x00"
"\x00", 14);
ID3v2::AttachedPictureFrame *frame =
- static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, TagLib::uint(2)));
+ static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, (unsigned int)2));
CPPUNIT_ASSERT(frame);
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), frame->mimeType());
"d\x00"
"\x00", 14);
ID3v2::AttachedPictureFrame *frame =
- static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, TagLib::uint(2)));
+ static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, (unsigned int)2));
CPPUNIT_ASSERT(frame);
ID3v2::Tag tag;
tag.addFrame(frame);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1034), tag.render().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1034, tag.render().size());
}
// http://bugs.kde.org/show_bug.cgi?id=151078
"\x00\x00\x00\x03", 33));
CPPUNIT_ASSERT_EQUAL(String("email@example.com"), f.email());
CPPUNIT_ASSERT_EQUAL(2, f.rating());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.counter());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, f.counter());
}
void testParsePOPMWithoutCounter()
"\x02", 29));
CPPUNIT_ASSERT_EQUAL(String("email@example.com"), f.email());
CPPUNIT_ASSERT_EQUAL(2, f.rating());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.counter());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.counter());
}
void testRenderPOPM()
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchronizedLyricsFrame::Lyrics, f.type());
CPPUNIT_ASSERT_EQUAL(String("foo"), f.description());
ID3v2::SynchronizedLyricsFrame::SynchedTextList stl = f.synchedText();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), stl.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, stl.size());
CPPUNIT_ASSERT_EQUAL(String("Example"), stl[0].text);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1234), stl[0].time);
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1234, stl[0].time);
CPPUNIT_ASSERT_EQUAL(String("Lyrics"), stl[1].text);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4567), stl[1].time);
+ CPPUNIT_ASSERT_EQUAL((unsigned int)4567, stl[1].time);
}
void testRenderSynchronizedLyricsFrame()
CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::AbsoluteMilliseconds,
f.timestampFormat());
ID3v2::EventTimingCodesFrame::SynchedEventList sel = f.synchedEvents();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), sel.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, sel.size());
CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::IntroStart, sel[0].type);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(62300), sel[0].time);
+ CPPUNIT_ASSERT_EQUAL((unsigned int)62300, sel[0].time);
CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::AudioFileEnds, sel[1].type);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3600000), sel[1].time);
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3600000, sel[1].time);
}
void testRenderEventTimingCodesFrame()
"\x00" // Encoding
"(22)Death Metal", 26); // Text
ID3v2::TextIdentificationFrame *frame =
- static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, TagLib::uint(3)));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), frame->fieldList().size());
+ static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, frame->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("Death Metal"), frame->fieldList()[0]);
ID3v2::Tag tag;
"\x00" // Encoding
"(4)Eurodisco", 23); // Text
ID3v2::TextIdentificationFrame *frame =
- static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, TagLib::uint(3)));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), frame->fieldList().size());
+ static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)3));
+ 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]);
"\0" // Encoding
"14\0Eurodisco", 23); // Text
ID3v2::TextIdentificationFrame *frame =
- static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, TagLib::uint(4)));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), frame->fieldList().size());
+ static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)4));
+ 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]);
{
MPEG::File f(TEST_FILE_PATH_C("id3v22-tda.mp3"), false);
CPPUNIT_ASSERT(f.tag());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2010), f.tag()->year());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2010, f.tag()->year());
}
void testUpdateFullDate22()
MPEG::File bar(newname.c_str());
tf = static_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDOR").front());
CPPUNIT_ASSERT(tf);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), tf->fieldList().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, tf->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("2011"), tf->fieldList().front());
tf = static_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDRC").front());
CPPUNIT_ASSERT(tf);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), tf->fieldList().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, tf->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("2012-04-17T12:01"), tf->fieldList().front());
tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TIPL").front());
CPPUNIT_ASSERT(tf);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), tf->fieldList().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)8, tf->fieldList().size());
CPPUNIT_ASSERT_EQUAL(String("Guitar"), tf->fieldList()[0]);
CPPUNIT_ASSERT_EQUAL(String("Artist 1"), tf->fieldList()[1]);
CPPUNIT_ASSERT_EQUAL(String("Drums"), tf->fieldList()[2]);
CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType());
CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type());
CPPUNIT_ASSERT_EQUAL(String(""), frame->description());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(86414), frame->picture().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)86414, frame->picture().size());
#else
string newname = copy.fileName();
MPEG::File f(newname.c_str());
PropertyMap dict = f.ID3v2Tag(false)->properties();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(6), dict.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)6, dict.size());
CPPUNIT_ASSERT(dict.contains("USERTEXTDESCRIPTION1"));
CPPUNIT_ASSERT(dict.contains("QuodLibet::USERTEXTDESCRIPTION2"));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["USERTEXTDESCRIPTION1"].size());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["QuodLibet::USERTEXTDESCRIPTION2"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["USERTEXTDESCRIPTION1"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["QuodLibet::USERTEXTDESCRIPTION2"].size());
CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["USERTEXTDESCRIPTION1"][0]);
CPPUNIT_ASSERT_EQUAL(String("userTextData2"), dict["USERTEXTDESCRIPTION1"][1]);
CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["QuodLibet::USERTEXTDESCRIPTION2"][0]);
ID3v2::ChapterFrame f1(&header, chapterData);
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f1.elementID());
- CPPUNIT_ASSERT((TagLib::uint)0x03 == f1.startTime());
- CPPUNIT_ASSERT((TagLib::uint)0x05 == f1.endTime());
- CPPUNIT_ASSERT((TagLib::uint)0x02 == f1.startOffset());
- CPPUNIT_ASSERT((TagLib::uint)0x03 == f1.endOffset());
- CPPUNIT_ASSERT((TagLib::uint)0x00 == f1.embeddedFrameList().size());
+ CPPUNIT_ASSERT((unsigned int)0x03 == f1.startTime());
+ CPPUNIT_ASSERT((unsigned int)0x05 == f1.endTime());
+ CPPUNIT_ASSERT((unsigned int)0x02 == f1.startOffset());
+ CPPUNIT_ASSERT((unsigned int)0x03 == f1.endOffset());
+ CPPUNIT_ASSERT((unsigned int)0x00 == f1.embeddedFrameList().size());
ID3v2::ChapterFrame f2(&header, chapterData + embeddedFrameData);
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f2.elementID());
- CPPUNIT_ASSERT((TagLib::uint)0x03 == f2.startTime());
- CPPUNIT_ASSERT((TagLib::uint)0x05 == f2.endTime());
- CPPUNIT_ASSERT((TagLib::uint)0x02 == f2.startOffset());
- CPPUNIT_ASSERT((TagLib::uint)0x03 == f2.endOffset());
- CPPUNIT_ASSERT((TagLib::uint)0x01 == f2.embeddedFrameList().size());
+ CPPUNIT_ASSERT((unsigned int)0x03 == f2.startTime());
+ CPPUNIT_ASSERT((unsigned int)0x05 == f2.endTime());
+ CPPUNIT_ASSERT((unsigned int)0x02 == f2.startOffset());
+ CPPUNIT_ASSERT((unsigned int)0x03 == f2.endOffset());
+ CPPUNIT_ASSERT((unsigned int)0x01 == f2.embeddedFrameList().size());
CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2").size() == 1);
CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2")[0]->toString() == "CH1");
}
CPPUNIT_ASSERT_EQUAL(ByteVector("T"), f.elementID());
CPPUNIT_ASSERT(!f.isTopLevel());
CPPUNIT_ASSERT(f.isOrdered());
- CPPUNIT_ASSERT((TagLib::uint)0x02 == f.entryCount());
+ CPPUNIT_ASSERT((unsigned int)0x02 == f.entryCount());
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f.childElements()[0]);
CPPUNIT_ASSERT_EQUAL(ByteVector("D"), f.childElements()[1]);
- CPPUNIT_ASSERT((TagLib::uint)0x01 == f.embeddedFrameList().size());
+ CPPUNIT_ASSERT((unsigned int)0x01 == f.embeddedFrameList().size());
CPPUNIT_ASSERT(f.embeddedFrameList("TIT2").size() == 1);
CPPUNIT_ASSERT(f.embeddedFrameList("TIT2")[0]->toString() == "TC1");
}
// Sample rate will be 32000 if we can't skip the second tag.
CPPUNIT_ASSERT(f.hasID3v2Tag());
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)8049, f.ID3v2Tag()->header()->completeTagSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)8049, f.ID3v2Tag()->header()->completeTagSize());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
MPEG::File f(copy.fileName().c_str());
CPPUNIT_ASSERT(f.hasID3v2Tag());
CPPUNIT_ASSERT_EQUAL((long)3594, f.length());
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)1505, f.ID3v2Tag()->header()->completeTagSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1505, f.ID3v2Tag()->header()->completeTagSize());
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f.ID3v2Tag()->artist());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
tag.setFieldText("TEST", "Dummy Text");
CPPUNIT_ASSERT_EQUAL(String("Test title 1"), tag.title());
-
+
RIFF::Info::FieldListMap map = tag.fieldListMap();
CPPUNIT_ASSERT_EQUAL(String("Test title 1"), map["INAM"]);
CPPUNIT_ASSERT_EQUAL(String("Dummy Text"), map["TEST"]);
{
RIFF::Info::Tag tag;
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)0, tag.track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, tag.track());
tag.setTrack(1234);
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)1234, tag.track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1234, tag.track());
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("IPRT"));
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)0, tag.year());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, tag.year());
tag.setYear(1234);
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)1234, tag.year());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1234, tag.year());
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("ICRD"));
}
};
using namespace std;
using namespace TagLib;
-using TagLib::uint;
static const String titleBefore("test song name");
static const String titleAfter("changed title");
MP4::File f(TEST_FILE_PATH_C("has-tags.m4a"));
CPPUNIT_ASSERT(f.tag()->contains("covr"));
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), l.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(79), l[0].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(287), l[1].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
}
void testCovrWrite()
MP4::File f(filename.c_str());
CPPUNIT_ASSERT(f.tag()->contains("covr"));
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), l.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, l.size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(79), l[0].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(287), l[1].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[2].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), l[2].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, l[2].data().size());
}
}
MP4::File f(TEST_FILE_PATH_C("covr-junk.m4a"));
CPPUNIT_ASSERT(f.tag()->contains("covr"));
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), l.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(79), l[0].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(287), l[1].data().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
}
void testProperties()
}
{
MPEG::File f2(newname.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f2.ID3v2Tag()->header()->majorVersion());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)4, f2.ID3v2Tag()->header()->majorVersion());
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
}
}
{
MPEG::File f2(newname.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f2.ID3v2Tag()->header()->majorVersion());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)4, f2.ID3v2Tag()->header()->majorVersion());
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
}
}
{
MPEG::File f2(newname.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f2.ID3v2Tag()->header()->majorVersion());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, f2.ID3v2Tag()->header()->majorVersion());
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
}
Vorbis::File f(newname.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.tag()->properties().size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.tag()->properties().size());
PropertyMap newTags;
StringList values("value 1");
f.tag()->setProperties(newTags);
PropertyMap map = f.tag()->properties();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), map.size());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), map["ARTIST"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, map.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, map["ARTIST"].size());
CPPUNIT_ASSERT_EQUAL(String("value 1"), map["ARTIST"][0]);
}
Vorbis::File f(newname.c_str());
PropertyMap tags = f.tag()->properties();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), tags["UNUSUALTAG"].size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2, tags["UNUSUALTAG"].size());
CPPUNIT_ASSERT_EQUAL(String("usual value"), tags["UNUSUALTAG"][0]);
CPPUNIT_ASSERT_EQUAL(String("another value"), tags["UNUSUALTAG"][1]);
CPPUNIT_ASSERT_EQUAL(
f.save();
f.seek(0x50);
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)0x3d3bd92d, f.readBlock(4).toUInt(0, true));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0x3d3bd92d, f.readBlock(4).toUInt(0, true));
}
{
Vorbis::File f(copy.fileName().c_str());
f.save();
f.seek(0x50);
- CPPUNIT_ASSERT_EQUAL((TagLib::uint)0xd985291c, f.readBlock(4).toUInt(0, true));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0xd985291c, f.readBlock(4).toUInt(0, true));
}
}
f = new Vorbis::File(newname.c_str());
List<FLAC::Picture *> lst = f->tag()->pictureList();
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
CPPUNIT_ASSERT_EQUAL(int(5), lst[0]->width());
CPPUNIT_ASSERT_EQUAL(int(6), lst[0]->height());
CPPUNIT_ASSERT_EQUAL(int(16), lst[0]->colorDepth());
{
public:
PublicRIFF(FileName file) : RIFF::File(file, BigEndian) {};
- TagLib::uint riffSize() { return RIFF::File::riffSize(); };
- TagLib::uint chunkCount() { return RIFF::File::chunkCount(); };
- TagLib::uint chunkOffset(TagLib::uint i) { return RIFF::File::chunkOffset(i); };
- TagLib::uint chunkPadding(TagLib::uint i) { return RIFF::File::chunkPadding(i); };
- TagLib::uint chunkDataSize(TagLib::uint i) { return RIFF::File::chunkDataSize(i); };
- ByteVector chunkName(TagLib::uint i) { return RIFF::File::chunkName(i); };
- ByteVector chunkData(TagLib::uint i) { return RIFF::File::chunkData(i); };
- void setChunkData(TagLib::uint i, const ByteVector &data) {
+ unsigned int riffSize() { return RIFF::File::riffSize(); };
+ unsigned int chunkCount() { return RIFF::File::chunkCount(); };
+ unsigned int chunkOffset(unsigned int i) { return RIFF::File::chunkOffset(i); };
+ unsigned int chunkPadding(unsigned int i) { return RIFF::File::chunkPadding(i); };
+ unsigned int chunkDataSize(unsigned int i) { return RIFF::File::chunkDataSize(i); };
+ ByteVector chunkName(unsigned int i) { return RIFF::File::chunkName(i); };
+ ByteVector chunkData(unsigned int i) { return RIFF::File::chunkData(i); };
+ void setChunkData(unsigned int i, const ByteVector &data) {
RIFF::File::setChunkData(i, data);
}
void setChunkData(const ByteVector &name, const ByteVector &data) {
virtual TagLib::Tag* tag() const { return 0; };
virtual TagLib::AudioProperties* audioProperties() const { return 0;};
virtual bool save() { return false; };
- void removeChunk(TagLib::uint i) { RIFF::File::removeChunk(i); }
+ void removeChunk(unsigned int i) { RIFF::File::removeChunk(i); }
void removeChunk(const ByteVector &name) { RIFF::File::removeChunk(name); }
};
{
PublicRIFF f(filename.c_str());
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x1728 + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x1728 + 8), f.chunkOffset(2));
f.setChunkData("TEST", "foo");
}
PublicRIFF f(filename.c_str());
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("foo"), f.chunkData(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.chunkDataSize(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x1728 + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x1728 + 8), f.chunkOffset(2));
f.setChunkData("SSND", "abcd");
{
PublicRIFF f(filename.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0xff0 + 8), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0xff0 + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
CPPUNIT_ASSERT_EQUAL(long(4400), f.length());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4399 - 8), f.riffSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize());
f.setChunkData("TEST", "abcd");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4412 - 8), f.riffSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize());
}
{
PublicRIFF f(filename.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
CPPUNIT_ASSERT_EQUAL(long(4412), f.length());
}
}
{
PublicRIFF f(filename.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0xff0 + 8), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0xff0 + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(2));
CPPUNIT_ASSERT_EQUAL(long(4399), f.length());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4399 - 8), f.riffSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize());
f.setChunkData("TEST", "abcd");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4412 - 8), f.riffSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize());
}
{
PublicRIFF f(filename.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
CPPUNIT_ASSERT_EQUAL(long(4412), f.length());
}
}
{
PublicRIFF f(filename.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0xff0 + 8), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0xff0 + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(2));
CPPUNIT_ASSERT_EQUAL(long(4399), f.length());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4399 - 8), f.riffSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize());
f.setChunkData("TEST", "abc");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.chunkDataSize(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4411 - 8), f.riffSize());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4411 - 8), f.riffSize());
}
{
PublicRIFF f(filename.c_str());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.chunkDataSize(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(3));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3));
CPPUNIT_ASSERT_EQUAL(long(4412), f.length());
}
}
PublicRIFF f(filename.c_str());
CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.chunkName(0));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0));
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(1));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0026 + 8), f.chunkOffset(1));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0026 + 8), f.chunkOffset(1));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x1728 + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x1728 + 8), f.chunkOffset(2));
const ByteVector data(0x400, ' ');
f.setChunkData("SSND", data);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0026 + 8), f.chunkOffset(1));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x042E + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0026 + 8), f.chunkOffset(1));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x042E + 8), f.chunkOffset(2));
f.seek(f.chunkOffset(0) - 8);
CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.readBlock(4));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
f.setChunkData(0, data);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0414 + 8), f.chunkOffset(1));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x081C + 8), f.chunkOffset(2));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0414 + 8), f.chunkOffset(1));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x081C + 8), f.chunkOffset(2));
f.seek(f.chunkOffset(0) - 8);
CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.readBlock(4));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
f.removeChunk("SSND");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0414 + 8), f.chunkOffset(1));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0414 + 8), f.chunkOffset(1));
f.seek(f.chunkOffset(0) - 8);
CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.readBlock(4));
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
f.removeChunk(0);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0));
f.seek(f.chunkOffset(0) - 8);
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4));
ByteVector lf("abc\x0axyz", 7);
ByteVector crlf("abc\x0d\x0axyz", 8);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), String(cr).size());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), String(lf).size());
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), String(crlf).size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)7, String(cr).size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)7, String(lf).size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)8, String(crlf).size());
CPPUNIT_ASSERT_EQUAL(L'\x0d', String(cr)[3]);
CPPUNIT_ASSERT_EQUAL(L'\x0a', String(lf)[3]);
char data[] = { 0, 0, 0, 127 };
ByteVector v(data, 4);
- CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(127));
+ CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)127);
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(127), v);
}
char data[] = { 0, 0, 1, 0 };
ByteVector v(data, 4);
- CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(128));
+ CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)128);
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(128), v);
}
char data[] = { 0, 0, 1, 1 };
ByteVector v(data, 4);
- CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(129));
+ CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)129);
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(129), v);
}
char data[] = { 0, 0, 0, -1 };
char data2[] = { 0, 0, -1, -1 };
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(255), ID3v2::SynchData::toUInt(ByteVector(data, 4)));
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(65535), ID3v2::SynchData::toUInt(ByteVector(data2, 4)));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(ByteVector(data, 4)));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)65535, ID3v2::SynchData::toUInt(ByteVector(data2, 4)));
}
void testToUIntBrokenAndTooLarge()
char data[] = { 0, 0, 0, -1, 0 };
ByteVector v(data, 5);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(255), ID3v2::SynchData::toUInt(v));
+ CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(v));
}
void testDecode1()
void testYear()
{
Ogg::XiphComment cmt;
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), cmt.year());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, cmt.year());
cmt.addField("YEAR", "2009");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2009), cmt.year());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2009, cmt.year());
cmt.addField("DATE", "2008");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(2008), cmt.year());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)2008, cmt.year());
}
void testSetYear()
void testTrack()
{
Ogg::XiphComment cmt;
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), cmt.track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)0, cmt.track());
cmt.addField("TRACKNUM", "7");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), cmt.track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)7, cmt.track());
cmt.addField("TRACKNUMBER", "8");
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), cmt.track());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)8, cmt.track());
}
void testSetTrack()
Ogg::XiphComment cmt;
PropertyMap unsuccessful = cmt.setProperties(map);
- CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), unsuccessful.size());
+ CPPUNIT_ASSERT_EQUAL((unsigned int)3, unsuccessful.size());
CPPUNIT_ASSERT(cmt.properties().isEmpty());
}