mirror of
https://github.com/taglib/taglib.git
synced 2026-07-14 15:21:31 -04:00
Use a standard type rather than TagLib::uint.
This won't break the ABI compatibility.
This commit is contained in:
@@ -144,12 +144,12 @@ String ID3v1::Tag::genre() const
|
||||
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;
|
||||
}
|
||||
@@ -179,22 +179,22 @@ void ID3v1::Tag::setGenre(const String &s)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -140,23 +140,23 @@ namespace TagLib {
|
||||
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.
|
||||
@@ -164,7 +164,7 @@ namespace TagLib {
|
||||
* \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
|
||||
|
||||
@@ -137,7 +137,7 @@ void AttachedPictureFrame::parseFields(const ByteVector &data)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
|
||||
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;
|
||||
};
|
||||
@@ -65,8 +65,8 @@ ChapterFrame::ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &dat
|
||||
}
|
||||
|
||||
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")
|
||||
{
|
||||
@@ -97,22 +97,22 @@ ByteVector ChapterFrame::elementID() const
|
||||
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;
|
||||
}
|
||||
@@ -125,22 +125,22 @@ void ChapterFrame::setElementID(const ByteVector &eID)
|
||||
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;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ ChapterFrame *ChapterFrame::findByElementID(const ID3v2::Tag *tag, const ByteVec
|
||||
|
||||
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).");
|
||||
@@ -246,7 +246,7 @@ void ChapterFrame::parseFields(const ByteVector &data)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace TagLib {
|
||||
* 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());
|
||||
|
||||
/*!
|
||||
@@ -84,14 +84,14 @@ namespace TagLib {
|
||||
*
|
||||
* \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
|
||||
@@ -100,7 +100,7 @@ namespace TagLib {
|
||||
* \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
|
||||
@@ -109,7 +109,7 @@ namespace TagLib {
|
||||
* \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
|
||||
@@ -124,14 +124,14 @@ namespace TagLib {
|
||||
*
|
||||
* \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
|
||||
@@ -139,7 +139,7 @@ namespace TagLib {
|
||||
*
|
||||
* \see startOffset()
|
||||
*/
|
||||
void setStartOffset(const uint &sO);
|
||||
void setStartOffset(const unsigned int &sO);
|
||||
|
||||
/*!
|
||||
* Sets zero based byte offset (count of bytes from the beginning
|
||||
@@ -147,7 +147,7 @@ namespace TagLib {
|
||||
*
|
||||
* \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
|
||||
|
||||
@@ -110,7 +110,7 @@ void EventTimingCodesFrame::parseFields(const ByteVector &data)
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ namespace TagLib {
|
||||
* 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;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
PopularimeterFramePrivate() : rating(0), counter(0) {}
|
||||
String email;
|
||||
int rating;
|
||||
TagLib::uint counter;
|
||||
unsigned int counter;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -84,12 +84,12 @@ void PopularimeterFrame::setRating(int s)
|
||||
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;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ void PopularimeterFrame::parseFields(const ByteVector &data)
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,14 +100,14 @@ namespace TagLib {
|
||||
*
|
||||
* \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.
|
||||
|
||||
@@ -191,7 +191,7 @@ void RelativeVolumeFrame::parseFields(const ByteVector &data)
|
||||
|
||||
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];
|
||||
|
||||
@@ -117,8 +117,7 @@ void SynchronizedLyricsFrame::setLanguage(const ByteVector &languageEncoding)
|
||||
d->language = languageEncoding.mid(0, 3);
|
||||
}
|
||||
|
||||
void SynchronizedLyricsFrame::setTimestampFormat(
|
||||
SynchronizedLyricsFrame::TimestampFormat f)
|
||||
void SynchronizedLyricsFrame::setTimestampFormat(SynchronizedLyricsFrame::TimestampFormat f)
|
||||
{
|
||||
d->timestampFormat = f;
|
||||
}
|
||||
@@ -193,7 +192,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
|
||||
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));
|
||||
|
||||
@@ -85,8 +85,8 @@ namespace TagLib {
|
||||
* 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;
|
||||
};
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ bool TableOfContentsFrame::isOrdered() const
|
||||
return d->isOrdered;
|
||||
}
|
||||
|
||||
TagLib::uint TableOfContentsFrame::entryCount() const
|
||||
unsigned int TableOfContentsFrame::entryCount() const
|
||||
{
|
||||
return d->childElements.size();
|
||||
}
|
||||
@@ -261,7 +261,7 @@ TableOfContentsFrame *TableOfContentsFrame::findTopLevel(const ID3v2::Tag *tag)
|
||||
|
||||
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 "
|
||||
@@ -270,12 +270,12 @@ void TableOfContentsFrame::parseFields(const ByteVector &data)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace TagLib {
|
||||
*
|
||||
* \see childElements()
|
||||
*/
|
||||
uint entryCount() const;
|
||||
unsigned int entryCount() const;
|
||||
|
||||
/*!
|
||||
* Returns list of child elements of the frame.
|
||||
|
||||
@@ -119,22 +119,26 @@ void TextIdentificationFrame::setTextEncoding(String::Type encoding)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -265,7 +269,7 @@ PropertyMap TextIdentificationFrame::makeTIPLProperties() const
|
||||
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;
|
||||
|
||||
@@ -34,7 +34,7 @@ class ExtendedHeader::ExtendedHeaderPrivate
|
||||
public:
|
||||
ExtendedHeaderPrivate() : size(0) {}
|
||||
|
||||
uint size;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -51,7 +51,7 @@ ExtendedHeader::~ExtendedHeader()
|
||||
delete d;
|
||||
}
|
||||
|
||||
TagLib::uint ExtendedHeader::size() const
|
||||
unsigned int ExtendedHeader::size() const
|
||||
{
|
||||
return d->size;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace TagLib {
|
||||
* 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
|
||||
|
||||
@@ -42,7 +42,7 @@ Footer::~Footer()
|
||||
{
|
||||
}
|
||||
|
||||
TagLib::uint Footer::size()
|
||||
unsigned int Footer::size()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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.
|
||||
|
||||
@@ -85,12 +85,12 @@ namespace
|
||||
// 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);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ ByteVector Frame::frameID() const
|
||||
return ByteVector();
|
||||
}
|
||||
|
||||
TagLib::uint Frame::size() const
|
||||
unsigned int Frame::size() const
|
||||
{
|
||||
if(d->header)
|
||||
return d->header->frameSize();
|
||||
@@ -241,10 +241,10 @@ void Frame::parse(const ByteVector &data)
|
||||
|
||||
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));
|
||||
@@ -268,7 +268,7 @@ ByteVector Frame::fieldData(const ByteVector &frameData) const
|
||||
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);
|
||||
@@ -335,7 +335,7 @@ String::Type Frame::checkEncoding(const StringList &fields, String::Type encodin
|
||||
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;
|
||||
@@ -572,8 +572,8 @@ public:
|
||||
{}
|
||||
|
||||
ByteVector frameID;
|
||||
uint frameSize;
|
||||
uint version;
|
||||
unsigned int frameSize;
|
||||
unsigned int version;
|
||||
|
||||
// flags
|
||||
|
||||
@@ -591,12 +591,12 @@ public:
|
||||
// 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:
|
||||
@@ -620,7 +620,7 @@ Frame::Header::Header(const ByteVector &data, bool synchSafeInts)
|
||||
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);
|
||||
@@ -633,10 +633,10 @@ Frame::Header::~Header()
|
||||
|
||||
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;
|
||||
|
||||
@@ -777,22 +777,22 @@ void Frame::Header::setFrameID(const ByteVector &id)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Returns the size of the frame.
|
||||
*/
|
||||
uint size() const;
|
||||
unsigned int size() const;
|
||||
|
||||
/*!
|
||||
* Returns the size of the frame header
|
||||
@@ -89,14 +89,14 @@ namespace TagLib {
|
||||
* 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
|
||||
@@ -242,7 +242,7 @@ namespace TagLib {
|
||||
*/
|
||||
// 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
|
||||
@@ -343,7 +343,7 @@ namespace TagLib {
|
||||
*
|
||||
* \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.
|
||||
@@ -362,7 +362,7 @@ namespace TagLib {
|
||||
* 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>)
|
||||
@@ -384,24 +384,24 @@ namespace TagLib {
|
||||
* 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.
|
||||
@@ -411,7 +411,7 @@ namespace TagLib {
|
||||
* removed in the next binary incompatible release (2.0) and will be
|
||||
* replaced with a non-static method that checks the frame version.
|
||||
*/
|
||||
static uint size();
|
||||
static unsigned int size();
|
||||
|
||||
/*!
|
||||
* Returns the size of the frame header in bytes for the ID3v2 version
|
||||
@@ -419,7 +419,7 @@ namespace TagLib {
|
||||
*
|
||||
* \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.
|
||||
|
||||
@@ -117,10 +117,10 @@ FrameFactory *FrameFactory::instance()
|
||||
|
||||
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);
|
||||
@@ -130,7 +130,7 @@ Frame *FrameFactory::createFrame(const ByteVector &data, uint version) const
|
||||
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();
|
||||
|
||||
@@ -138,7 +138,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader)
|
||||
// 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;
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace TagLib {
|
||||
* \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
|
||||
|
||||
@@ -48,22 +48,22 @@ public:
|
||||
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;
|
||||
}
|
||||
@@ -93,17 +93,17 @@ Header::~Header()
|
||||
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;
|
||||
}
|
||||
@@ -128,12 +128,12 @@ bool Header::footerPresent() const
|
||||
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();
|
||||
@@ -141,7 +141,7 @@ TagLib::uint Header::completeTagSize() const
|
||||
return d->tagSize + size();
|
||||
}
|
||||
|
||||
void Header::setTagSize(uint s)
|
||||
void Header::setTagSize(unsigned int s)
|
||||
{
|
||||
d->tagSize = s;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace TagLib {
|
||||
* 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
|
||||
@@ -78,13 +78,13 @@ namespace TagLib {
|
||||
* 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.
|
||||
@@ -116,7 +116,7 @@ namespace TagLib {
|
||||
*
|
||||
* \see completeTagSize()
|
||||
*/
|
||||
uint tagSize() const;
|
||||
unsigned int tagSize() const;
|
||||
|
||||
/*!
|
||||
* Returns the tag size, including the header and, if present, the footer
|
||||
@@ -124,18 +124,18 @@ namespace TagLib {
|
||||
*
|
||||
* \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.
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
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;
|
||||
|
||||
@@ -62,7 +62,7 @@ TagLib::uint SynchData::toUInt(const ByteVector &data)
|
||||
return sum;
|
||||
}
|
||||
|
||||
ByteVector SynchData::fromUInt(uint value)
|
||||
ByteVector SynchData::fromUInt(unsigned int value)
|
||||
{
|
||||
ByteVector v(4, 0);
|
||||
|
||||
|
||||
@@ -51,12 +51,12 @@ namespace TagLib {
|
||||
* <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.
|
||||
|
||||
@@ -212,14 +212,14 @@ String ID3v2::Tag::genre() const
|
||||
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();
|
||||
@@ -283,7 +283,7 @@ void ID3v2::Tag::setGenre(const String &s)
|
||||
#endif
|
||||
}
|
||||
|
||||
void ID3v2::Tag::setYear(uint i)
|
||||
void ID3v2::Tag::setYear(unsigned int i)
|
||||
{
|
||||
if(i <= 0) {
|
||||
removeFrames("TDRC");
|
||||
@@ -292,7 +292,7 @@ void ID3v2::Tag::setYear(uint i)
|
||||
setTextFrame("TDRC", String::number(i));
|
||||
}
|
||||
|
||||
void ID3v2::Tag::setTrack(uint i)
|
||||
void ID3v2::Tag::setTrack(unsigned int i)
|
||||
{
|
||||
if(i <= 0) {
|
||||
removeFrames("TRCK");
|
||||
@@ -539,14 +539,14 @@ void ID3v2::Tag::downgradeFrames(FrameList *frames, FrameList *newFrames) const
|
||||
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]);
|
||||
}
|
||||
@@ -628,7 +628,7 @@ ByteVector ID3v2::Tag::render(int version) const
|
||||
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);
|
||||
@@ -686,7 +686,7 @@ void ID3v2::Tag::read(TagLib::File *file, long offset)
|
||||
// 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) {
|
||||
|
||||
@@ -712,8 +712,8 @@ void ID3v2::Tag::parse(const ByteVector &origData)
|
||||
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
|
||||
|
||||
|
||||
@@ -169,16 +169,16 @@ namespace TagLib {
|
||||
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;
|
||||
|
||||
|
||||
@@ -87,11 +87,11 @@ public:
|
||||
const ID3v2::FrameFactory *ID3v2FrameFactory;
|
||||
|
||||
long ID3v2Location;
|
||||
uint ID3v2OriginalSize;
|
||||
unsigned int ID3v2OriginalSize;
|
||||
|
||||
long APELocation;
|
||||
long APEFooterLocation;
|
||||
uint APEOriginalSize;
|
||||
unsigned int APEOriginalSize;
|
||||
|
||||
long ID3v1Location;
|
||||
|
||||
@@ -393,7 +393,7 @@ long MPEG::File::nextFrameOffset(long position)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
size(0),
|
||||
type(MPEG::XingHeader::Invalid) {}
|
||||
|
||||
uint frames;
|
||||
uint size;
|
||||
unsigned int frames;
|
||||
unsigned int size;
|
||||
|
||||
MPEG::XingHeader::HeaderType type;
|
||||
};
|
||||
@@ -66,12 +66,12 @@ bool MPEG::XingHeader::isValid() const
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -93,12 +93,12 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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.
|
||||
|
||||
Reference in New Issue
Block a user