mirror of
https://github.com/taglib/taglib.git
synced 2026-06-13 01:39:17 -04:00
Merge branch 'master' into merge-master-to-taglib2
# Conflicts: # taglib/ape/apefile.cpp # taglib/ape/apeitem.cpp # taglib/ape/apeproperties.cpp # taglib/ape/apetag.cpp # taglib/ape/apetag.h # taglib/asf/asffile.cpp # taglib/asf/asfpicture.cpp # taglib/flac/flacfile.cpp # taglib/flac/flacpicture.cpp # taglib/flac/flacproperties.cpp # taglib/it/itfile.cpp # taglib/it/itproperties.cpp # taglib/mod/modfile.cpp # taglib/mod/modfilebase.cpp # taglib/mod/modfilebase.h # taglib/mod/modfileprivate.h # taglib/mod/modproperties.cpp # taglib/mp4/mp4item.cpp # taglib/mp4/mp4tag.cpp # taglib/mp4/mp4tag.h # taglib/mpc/mpcfile.cpp # taglib/mpc/mpcproperties.cpp # taglib/mpc/mpcproperties.h # taglib/mpeg/id3v1/id3v1tag.cpp # taglib/mpeg/id3v1/id3v1tag.h # taglib/mpeg/id3v2/frames/attachedpictureframe.cpp # taglib/mpeg/id3v2/frames/chapterframe.cpp # taglib/mpeg/id3v2/frames/eventtimingcodesframe.cpp # taglib/mpeg/id3v2/frames/popularimeterframe.cpp # taglib/mpeg/id3v2/frames/relativevolumeframe.cpp # taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp # taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp # taglib/mpeg/id3v2/frames/textidentificationframe.cpp # taglib/mpeg/id3v2/id3v2frame.cpp # taglib/mpeg/id3v2/id3v2framefactory.cpp # taglib/mpeg/id3v2/id3v2framefactory.h # taglib/mpeg/id3v2/id3v2tag.cpp # taglib/mpeg/id3v2/id3v2tag.h # taglib/mpeg/mpegfile.cpp # taglib/mpeg/mpegheader.cpp # taglib/ogg/flac/oggflacfile.cpp # taglib/ogg/opus/opusproperties.cpp # taglib/ogg/speex/speexproperties.cpp # taglib/ogg/vorbis/vorbisproperties.cpp # taglib/ogg/xiphcomment.cpp # taglib/ogg/xiphcomment.h # taglib/riff/aiff/aiffproperties.cpp # taglib/riff/rifffile.cpp # taglib/riff/rifffile.h # taglib/riff/wav/infotag.cpp # taglib/riff/wav/infotag.h # taglib/riff/wav/wavproperties.cpp # taglib/riff/wav/wavproperties.h # taglib/s3m/s3mproperties.cpp # taglib/tagunion.cpp # taglib/tagunion.h # taglib/toolkit/taglib.h # taglib/toolkit/tbytevector.cpp # taglib/toolkit/tbytevector.h # taglib/toolkit/tbytevectorlist.cpp # taglib/toolkit/tbytevectorstream.cpp # taglib/toolkit/tbytevectorstream.h # taglib/toolkit/tfile.cpp # taglib/toolkit/tfile.h # taglib/toolkit/tfilestream.cpp # taglib/toolkit/tfilestream.h # taglib/toolkit/tiostream.h # taglib/toolkit/tlist.h # taglib/toolkit/tlist.tcc # taglib/toolkit/tmap.h # taglib/toolkit/tmap.tcc # taglib/toolkit/tstring.cpp # taglib/toolkit/tstring.h # taglib/trueaudio/trueaudiofile.cpp # taglib/trueaudio/trueaudioproperties.cpp # taglib/trueaudio/trueaudioproperties.h # taglib/wavpack/wavpackfile.cpp # taglib/wavpack/wavpackproperties.cpp # taglib/wavpack/wavpackproperties.h # taglib/xm/xmfile.cpp # taglib/xm/xmproperties.cpp # tests/test_apetag.cpp # tests/test_asf.cpp # tests/test_bytevector.cpp # tests/test_bytevectorlist.cpp # tests/test_file.cpp # tests/test_flac.cpp # tests/test_flacpicture.cpp # tests/test_id3v2.cpp # tests/test_info.cpp # tests/test_mp4.cpp # tests/test_ogg.cpp # tests/test_riff.cpp # tests/test_string.cpp # tests/test_xiphcomment.cpp
This commit is contained in:
@@ -8,12 +8,12 @@ endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
||||
|
||||
option(ENABLE_STATIC "Make static version of libtag" OFF)
|
||||
if(ENABLE_STATIC)
|
||||
if(DEFINED ENABLE_STATIC)
|
||||
message(FATAL_ERROR "This option is no longer available, use BUILD_SHARED_LIBS instead")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
add_definitions(-DTAGLIB_STATIC)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
endif()
|
||||
option(ENABLE_STATIC_RUNTIME "Visual Studio, link with runtime statically" OFF)
|
||||
|
||||
|
||||
8
INSTALL
8
INSTALL
@@ -37,7 +37,7 @@ For a 10.6 Snow Leopard static library with both 32-bit and 64-bit code, use:
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \
|
||||
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
|
||||
-DENABLE_STATIC=ON \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX="<folder you want to build to>"
|
||||
|
||||
After 'make', and 'make install', add libtag.a to your XCode project, and add
|
||||
@@ -139,9 +139,9 @@ The easiest way is at the Command Prompt.
|
||||
4. Select: Project Only
|
||||
5. Select: Build Only INSTALL
|
||||
|
||||
To build a static library enable the following two options with CMake.
|
||||
-DENABLE_STATIC=ON -DENABLE_STATIC_RUNTIME=ON
|
||||
|
||||
To build a static library, set the following two options with CMake.
|
||||
-DBUILD_SHARED_LIBS=OFF -DENABLE_STATIC_RUNTIME=ON
|
||||
|
||||
Including ENABLE_STATIC_RUNTIME=ON indicates you want TagLib built using the
|
||||
static runtime library, rather than the DLL form of the runtime.
|
||||
|
||||
|
||||
6
NEWS
6
NEWS
@@ -2,16 +2,18 @@
|
||||
|
||||
* New API for creating FileRef from IOStream.
|
||||
* Added support for ID3v2 PCST and WFED frames.
|
||||
* Added support for pictures in XiphComment.
|
||||
* Added String::clear().
|
||||
* Added alternative functions to XiphComment::removeField().
|
||||
* Added BUILD_BINDINGS build option.
|
||||
* Added ENABLE_CCACHE build option.
|
||||
* Better handling of duplicate ID3v2 tags in all kinds of files.
|
||||
* Better handling of duplicate tag chunks in WAV files.
|
||||
* Better handling of duplicate tag chunks in AIFF files.
|
||||
* Fixed crash when calling File::properties() after strip().
|
||||
* Fixed possible file corruptions when saving ASF files.
|
||||
* Fixed updating the comment field of Vorbis comments.
|
||||
* Added BUILD_BINDINGS build option.
|
||||
* Added ENABLE_CCACHE build option.
|
||||
* Replaced ENABLE_STATIC build option with BUILD_SHARED_LIBS.
|
||||
* Marked ByteVector::null and ByteVector::isNull() deprecated.
|
||||
* Marked String::null and ByteVector::isNull() deprecated.
|
||||
* Marked XiphComment::removeField() deprecated.
|
||||
|
||||
@@ -121,8 +121,6 @@ TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type)
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void taglib_file_free(TagLib_File *file)
|
||||
|
||||
@@ -8,9 +8,9 @@ include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../bindings/c/
|
||||
)
|
||||
|
||||
if(ENABLE_STATIC)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
add_definitions(-DTAGLIB_STATIC)
|
||||
endif(ENABLE_STATIC)
|
||||
endif()
|
||||
|
||||
########### next target ###############
|
||||
|
||||
|
||||
@@ -72,14 +72,14 @@ public:
|
||||
delete properties;
|
||||
}
|
||||
|
||||
long long APELocation;
|
||||
uint APESize;
|
||||
long long APELocation;
|
||||
unsigned int APESize;
|
||||
|
||||
long long ID3v1Location;
|
||||
|
||||
ID3v2::Header *ID3v2Header;
|
||||
long long ID3v2Location;
|
||||
uint ID3v2Size;
|
||||
long long ID3v2Location;
|
||||
unsigned int ID3v2Size;
|
||||
|
||||
DoubleTagUnion tag;
|
||||
|
||||
|
||||
@@ -46,22 +46,22 @@ public:
|
||||
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;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ APE::Footer::~Footer()
|
||||
delete d;
|
||||
}
|
||||
|
||||
TagLib::uint APE::Footer::version() const
|
||||
unsigned int APE::Footer::version() const
|
||||
{
|
||||
return d->version;
|
||||
}
|
||||
@@ -116,22 +116,22 @@ void APE::Footer::setHeaderPresent(bool b) const
|
||||
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();
|
||||
@@ -139,7 +139,7 @@ TagLib::uint APE::Footer::completeTagSize() const
|
||||
return d->tagSize;
|
||||
}
|
||||
|
||||
void APE::Footer::setTagSize(uint s)
|
||||
void APE::Footer::setTagSize(unsigned int s)
|
||||
{
|
||||
d->tagSize = s;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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.
|
||||
@@ -89,13 +89,13 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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.
|
||||
@@ -103,7 +103,7 @@ namespace TagLib {
|
||||
*
|
||||
* \see completeTagSize()
|
||||
*/
|
||||
uint tagSize() const;
|
||||
unsigned int tagSize() const;
|
||||
|
||||
/*!
|
||||
* Returns the tag size, including if present, the header
|
||||
@@ -111,18 +111,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 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.
|
||||
|
||||
@@ -234,8 +234,8 @@ void APE::Item::parse(const ByteVector &data)
|
||||
return;
|
||||
}
|
||||
|
||||
const uint valueLength = data.toUInt32LE(0);
|
||||
const uint flags = data.toUInt32LE(4);
|
||||
const unsigned int valueLength = data.toUInt32LE(0);
|
||||
const unsigned int flags = data.toUInt32LE(4);
|
||||
|
||||
d->key = String(data.mid(8), String::UTF8);
|
||||
|
||||
@@ -253,7 +253,7 @@ void APE::Item::parse(const ByteVector &data)
|
||||
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())
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
int channels;
|
||||
int version;
|
||||
int bitsPerSample;
|
||||
uint sampleFrames;
|
||||
unsigned int sampleFrames;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -115,7 +115,7 @@ int APE::AudioProperties::bitsPerSample() const
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
TagLib::uint APE::AudioProperties::sampleFrames() const
|
||||
unsigned int APE::AudioProperties::sampleFrames() const
|
||||
{
|
||||
return d->sampleFrames;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ void APE::AudioProperties::analyzeCurrent(File *file)
|
||||
return;
|
||||
}
|
||||
|
||||
const uint descriptorBytes = descriptor.toUInt32LE(0);
|
||||
const unsigned int descriptorBytes = descriptor.toUInt32LE(0);
|
||||
|
||||
if((descriptorBytes - 52) > 0)
|
||||
file->seek(descriptorBytes - 52, File::Current);
|
||||
@@ -194,12 +194,12 @@ void APE::AudioProperties::analyzeCurrent(File *file)
|
||||
d->sampleRate = header.toUInt32LE(20);
|
||||
d->bitsPerSample = header.toUInt16LE(16);
|
||||
|
||||
const uint totalFrames = header.toUInt32LE(12);
|
||||
const unsigned int totalFrames = header.toUInt32LE(12);
|
||||
if(totalFrames == 0)
|
||||
return;
|
||||
|
||||
const uint blocksPerFrame = header.toUInt32LE(4);
|
||||
const uint finalFrameBlocks = header.toUInt32LE(8);
|
||||
const unsigned int blocksPerFrame = header.toUInt32LE(4);
|
||||
const unsigned int finalFrameBlocks = header.toUInt32LE(8);
|
||||
d->sampleFrames = (totalFrames - 1) * blocksPerFrame + finalFrameBlocks;
|
||||
}
|
||||
|
||||
@@ -211,14 +211,14 @@ void APE::AudioProperties::analyzeOld(File *file)
|
||||
return;
|
||||
}
|
||||
|
||||
const uint totalFrames = header.toUInt32LE(18);
|
||||
const unsigned int totalFrames = header.toUInt32LE(18);
|
||||
|
||||
// Fail on 0 length APE files (catches non-finalized APE files)
|
||||
if(totalFrames == 0)
|
||||
return;
|
||||
|
||||
const short compressionLevel = header.toUInt32LE(0);
|
||||
uint blocksPerFrame;
|
||||
unsigned int blocksPerFrame;
|
||||
if(d->version >= 3950)
|
||||
blocksPerFrame = 73728 * 4;
|
||||
else if(d->version >= 3900 || (d->version >= 3800 && compressionLevel == 4000))
|
||||
@@ -230,7 +230,7 @@ void APE::AudioProperties::analyzeOld(File *file)
|
||||
d->channels = header.toUInt16LE(4);
|
||||
d->sampleRate = header.toUInt32LE(6);
|
||||
|
||||
const uint finalFrameBlocks = header.toUInt32LE(22);
|
||||
const unsigned int finalFrameBlocks = header.toUInt32LE(22);
|
||||
d->sampleFrames = (totalFrames - 1) * blocksPerFrame + finalFrameBlocks;
|
||||
|
||||
// Get the bit depth from the RIFF-fmt chunk.
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Returns the total number of audio samples in file.
|
||||
*/
|
||||
uint sampleFrames() const;
|
||||
unsigned int sampleFrames() const;
|
||||
|
||||
/*!
|
||||
* Returns APE version.
|
||||
|
||||
@@ -47,6 +47,13 @@ using namespace APE;
|
||||
class APE::Tag::TagPrivate
|
||||
{
|
||||
public:
|
||||
TagPrivate() :
|
||||
file(0),
|
||||
footerLocation(0) {}
|
||||
|
||||
File *file;
|
||||
long long footerLocation;
|
||||
|
||||
Footer footer;
|
||||
ItemListMap itemListMap;
|
||||
};
|
||||
@@ -65,7 +72,10 @@ APE::Tag::Tag(TagLib::File *file, long long footerLocation) :
|
||||
TagLib::Tag(),
|
||||
d(new TagPrivate())
|
||||
{
|
||||
read(file, footerLocation);
|
||||
d->file = file;
|
||||
d->footerLocation = footerLocation;
|
||||
|
||||
read();
|
||||
}
|
||||
|
||||
APE::Tag::~Tag()
|
||||
@@ -113,14 +123,14 @@ String APE::Tag::genre() const
|
||||
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;
|
||||
@@ -188,7 +198,7 @@ void APE::Tag::setGenre(const String &s)
|
||||
addValue("GENRE", s, true);
|
||||
}
|
||||
|
||||
void APE::Tag::setYear(uint i)
|
||||
void APE::Tag::setYear(unsigned int i)
|
||||
{
|
||||
if(i <= 0)
|
||||
removeItem("YEAR");
|
||||
@@ -196,7 +206,7 @@ void APE::Tag::setYear(uint i)
|
||||
addValue("YEAR", String::number(i), true);
|
||||
}
|
||||
|
||||
void APE::Tag::setTrack(uint i)
|
||||
void APE::Tag::setTrack(unsigned int i)
|
||||
{
|
||||
if(i <= 0)
|
||||
removeItem("TRACK");
|
||||
@@ -261,14 +271,18 @@ void APE::Tag::setPictures(const PictureMap &l)
|
||||
|
||||
}
|
||||
|
||||
// conversions of tag keys between what we use in PropertyMap and what's usual
|
||||
// for APE tags
|
||||
static const TagLib::uint keyConversionsSize = 5; //usual, APE
|
||||
static const char *keyConversions[][2] = {{"TRACKNUMBER", "TRACK" },
|
||||
{"DATE", "YEAR" },
|
||||
{"ALBUMARTIST", "ALBUM ARTIST"},
|
||||
{"DISCNUMBER", "DISC" },
|
||||
{"REMIXER", "MIXARTIST" }};
|
||||
namespace
|
||||
{
|
||||
// conversions of tag keys between what we use in PropertyMap and what's usual
|
||||
// for APE tags
|
||||
// usual, APE
|
||||
const char *keyConversions[][2] = {{"TRACKNUMBER", "TRACK" },
|
||||
{"DATE", "YEAR" },
|
||||
{"ALBUMARTIST", "ALBUM ARTIST"},
|
||||
{"DISCNUMBER", "DISC" },
|
||||
{"REMIXER", "MIXARTIST" }};
|
||||
const size_t keyConversionsSize = sizeof(keyConversions) / sizeof(keyConversions[0]);
|
||||
}
|
||||
|
||||
PropertyMap APE::Tag::properties() const
|
||||
{
|
||||
@@ -278,14 +292,16 @@ PropertyMap APE::Tag::properties() const
|
||||
String tagName = it->first.upper();
|
||||
// if the item is Binary or Locator, or if the key is an invalid string,
|
||||
// add to unsupportedData
|
||||
if(it->second.type() != Item::Text || tagName.isEmpty())
|
||||
if(it->second.type() != Item::Text || tagName.isEmpty()) {
|
||||
properties.unsupportedData().append(it->first);
|
||||
}
|
||||
else {
|
||||
// Some tags need to be handled specially
|
||||
for(uint i = 0; i < keyConversionsSize; ++i)
|
||||
for(size_t i = 0; i < keyConversionsSize; ++i) {
|
||||
if(tagName == keyConversions[i][1])
|
||||
tagName = keyConversions[i][0];
|
||||
properties[tagName].append(it->second.values());
|
||||
}
|
||||
properties[tagName].append(it->second.values());
|
||||
}
|
||||
}
|
||||
return properties;
|
||||
@@ -303,7 +319,7 @@ PropertyMap APE::Tag::setProperties(const PropertyMap &origProps)
|
||||
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]);
|
||||
@@ -413,26 +429,26 @@ bool APE::Tag::isEmpty() const
|
||||
// protected methods
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void APE::Tag::read(TagLib::File *file, long long footerLocation)
|
||||
void APE::Tag::read()
|
||||
{
|
||||
if(file && file->isValid()) {
|
||||
if(d->file && d->file->isValid()) {
|
||||
|
||||
file->seek(footerLocation);
|
||||
d->footer.setData(file->readBlock(Footer::size()));
|
||||
d->file->seek(d->footerLocation);
|
||||
d->footer.setData(d->file->readBlock(Footer::size()));
|
||||
|
||||
if(d->footer.tagSize() <= Footer::size() ||
|
||||
d->footer.tagSize() > uint(file->length()))
|
||||
d->footer.tagSize() > static_cast<unsigned long>(d->file->length()))
|
||||
return;
|
||||
|
||||
file->seek(footerLocation + Footer::size() - d->footer.tagSize());
|
||||
parse(file->readBlock(d->footer.tagSize() - Footer::size()));
|
||||
d->file->seek(d->footerLocation + Footer::size() - d->footer.tagSize());
|
||||
parse(d->file->readBlock(d->footer.tagSize() - Footer::size()));
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -440,7 +456,7 @@ ByteVector APE::Tag::render() const
|
||||
}
|
||||
|
||||
d->footer.setItemCount(itemCount);
|
||||
d->footer.setTagSize(static_cast<uint>(data.size() + Footer::size()));
|
||||
d->footer.setTagSize(static_cast<unsigned int>(data.size() + Footer::size()));
|
||||
d->footer.setHeaderPresent(true);
|
||||
|
||||
return d->footer.renderHeader() + data + d->footer.renderFooter();
|
||||
@@ -453,9 +469,9 @@ void APE::Tag::parse(const ByteVector &data)
|
||||
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));
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ 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;
|
||||
|
||||
/**
|
||||
* @brief pictures
|
||||
@@ -112,8 +112,8 @@ namespace TagLib {
|
||||
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 void setPictures(const PictureMap &l);
|
||||
|
||||
/*!
|
||||
@@ -201,7 +201,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Reads from the file specified in the constructor.
|
||||
*/
|
||||
void read(TagLib::File *file, long long footerLocation);
|
||||
void read();
|
||||
|
||||
/*!
|
||||
* Parses the body of the tag in \a data.
|
||||
|
||||
@@ -193,7 +193,7 @@ ASF::Picture ASF::Attribute::toPicture() const
|
||||
|
||||
String ASF::Attribute::parse(ASF::File &f, int kind)
|
||||
{
|
||||
uint size, nameLength;
|
||||
unsigned int size, nameLength;
|
||||
String name;
|
||||
d->data->pictureValue = Picture::fromInvalid();
|
||||
// extended content descriptor
|
||||
|
||||
@@ -120,21 +120,21 @@ class ASF::File::FilePrivate::FilePropertiesObject : public ASF::File::FilePriva
|
||||
{
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -143,7 +143,7 @@ class ASF::File::FilePrivate::ExtendedContentDescriptionObject : public ASF::Fil
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -152,7 +152,7 @@ class ASF::File::FilePrivate::MetadataObject : public ASF::File::FilePrivate::Ba
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -161,7 +161,7 @@ class ASF::File::FilePrivate::MetadataLibraryObject : public ASF::File::FilePriv
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -179,7 +179,7 @@ class ASF::File::FilePrivate::CodecListObject : public ASF::File::FilePrivate::B
|
||||
{
|
||||
public:
|
||||
ByteVector guid() const;
|
||||
void parse(ASF::File *file, uint size);
|
||||
void parse(ASF::File *file, unsigned int size);
|
||||
|
||||
private:
|
||||
enum CodecType
|
||||
@@ -218,7 +218,7 @@ ByteVector ASF::File::FilePrivate::FilePropertiesObject::guid() const
|
||||
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) {
|
||||
@@ -236,7 +236,7 @@ ByteVector ASF::File::FilePrivate::StreamPropertiesObject::guid() const
|
||||
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) {
|
||||
@@ -256,7 +256,7 @@ ByteVector ASF::File::FilePrivate::ContentDescriptionObject::guid() const
|
||||
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);
|
||||
@@ -297,7 +297,7 @@ ByteVector ASF::File::FilePrivate::ExtendedContentDescriptionObject::guid() cons
|
||||
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);
|
||||
@@ -321,7 +321,7 @@ ByteVector ASF::File::FilePrivate::MetadataObject::guid() const
|
||||
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);
|
||||
@@ -345,7 +345,7 @@ ByteVector ASF::File::FilePrivate::MetadataLibraryObject::guid() const
|
||||
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);
|
||||
@@ -374,7 +374,7 @@ ByteVector ASF::File::FilePrivate::HeaderExtensionObject::guid() const
|
||||
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);
|
||||
@@ -423,7 +423,7 @@ ByteVector ASF::File::FilePrivate::CodecListObject::guid() const
|
||||
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) {
|
||||
@@ -431,7 +431,7 @@ void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, uint size)
|
||||
return;
|
||||
}
|
||||
|
||||
uint pos = 16;
|
||||
unsigned int pos = 16;
|
||||
|
||||
const int count = data.toUInt32LE(pos);
|
||||
pos += 4;
|
||||
@@ -447,13 +447,13 @@ void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, uint size)
|
||||
int nameLength = data.toUInt16LE(pos);
|
||||
pos += 2;
|
||||
|
||||
const uint namePos = pos;
|
||||
const unsigned int namePos = pos;
|
||||
pos += nameLength * 2;
|
||||
|
||||
const int descLength = data.toUInt16LE(pos);
|
||||
pos += 2;
|
||||
|
||||
const uint descPos = pos;
|
||||
const unsigned int descPos = pos;
|
||||
pos += descLength * 2;
|
||||
|
||||
const int infoLength = data.toUInt16LE(pos);
|
||||
|
||||
@@ -160,7 +160,7 @@ void ASF::Picture::parse(const ByteVector& bytes)
|
||||
return;
|
||||
size_t pos = 0;
|
||||
d->data->type = (Type)bytes[0]; ++pos;
|
||||
const uint dataLen = bytes.toUInt32LE(pos); pos+=4;
|
||||
const unsigned int dataLen = bytes.toUInt32LE(pos); pos+=4;
|
||||
|
||||
const ByteVector nullStringTerminator(2, 0);
|
||||
|
||||
|
||||
@@ -231,12 +231,12 @@ void ASF::Tag::setGenre(const String &value)
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -90,13 +90,13 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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;
|
||||
|
||||
virtual PictureMap pictures() const;
|
||||
|
||||
@@ -139,12 +139,12 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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);
|
||||
|
||||
virtual void setPictures(const PictureMap &l);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace TagLib
|
||||
namespace ASF
|
||||
{
|
||||
|
||||
inline ushort readWORD(File *file, bool *ok = 0)
|
||||
inline unsigned short readWORD(File *file, bool *ok = 0)
|
||||
{
|
||||
const ByteVector v = file->readBlock(2);
|
||||
if(v.size() != 2) {
|
||||
@@ -46,7 +46,7 @@ namespace TagLib
|
||||
return v.toUInt16LE(0);
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -78,8 +78,8 @@ public:
|
||||
}
|
||||
|
||||
const ID3v2::FrameFactory *ID3v2FrameFactory;
|
||||
long long ID3v2Location;
|
||||
uint ID3v2OriginalSize;
|
||||
long long ID3v2Location;
|
||||
unsigned int ID3v2OriginalSize;
|
||||
|
||||
long long ID3v1Location;
|
||||
|
||||
@@ -166,7 +166,7 @@ bool FLAC::File::save()
|
||||
|
||||
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
|
||||
@@ -189,7 +189,7 @@ bool FLAC::File::save()
|
||||
// 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::fromUInt32BE(blockData.size());
|
||||
@@ -268,7 +268,7 @@ void FLAC::File::setID3v2FrameFactory(const ID3v2::FrameFactory *factory)
|
||||
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);
|
||||
@@ -296,7 +296,7 @@ void FLAC::File::removePicture(Picture *picture, bool del)
|
||||
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;
|
||||
@@ -425,7 +425,7 @@ void FLAC::File::scan()
|
||||
|
||||
char blockType = header[0] & 0x7f;
|
||||
bool isLastBlock = (header[0] & 0x80) != 0;
|
||||
uint length = header.toUInt24BE(1);
|
||||
size_t length = header.toUInt24BE(1);
|
||||
|
||||
// First block should be the stream_info metadata
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ bool FLAC::Picture::parse(const ByteVector &data)
|
||||
size_t pos = 0;
|
||||
d->type = FLAC::Picture::Type(data.toUInt32BE(pos));
|
||||
pos += 4;
|
||||
const uint mimeTypeLength = data.toUInt32BE(pos);
|
||||
const unsigned int mimeTypeLength = data.toUInt32BE(pos);
|
||||
pos += 4;
|
||||
if(pos + mimeTypeLength + 24 > data.size()) {
|
||||
debug("Invalid picture block.");
|
||||
@@ -89,7 +89,7 @@ bool FLAC::Picture::parse(const ByteVector &data)
|
||||
}
|
||||
d->mimeType = String(data.mid(pos, mimeTypeLength), String::UTF8);
|
||||
pos += mimeTypeLength;
|
||||
const uint descriptionLength = data.toUInt32BE(pos);
|
||||
const unsigned int descriptionLength = data.toUInt32BE(pos);
|
||||
pos += 4;
|
||||
if(pos + descriptionLength + 20 > data.size()) {
|
||||
debug("Invalid picture block.");
|
||||
@@ -105,7 +105,7 @@ bool FLAC::Picture::parse(const ByteVector &data)
|
||||
pos += 4;
|
||||
d->numColors = data.toUInt32BE(pos);
|
||||
pos += 4;
|
||||
const uint dataLength = data.toUInt32BE(pos);
|
||||
const unsigned int dataLength = data.toUInt32BE(pos);
|
||||
pos += 4;
|
||||
if(pos + dataLength > data.size()) {
|
||||
debug("Invalid picture block.");
|
||||
|
||||
@@ -142,7 +142,7 @@ void FLAC::AudioProperties::read(const ByteVector &data, long long streamLength)
|
||||
// Maximum frame size (in bytes)
|
||||
pos += 3;
|
||||
|
||||
const uint flags = data.toUInt32BE(pos);
|
||||
const unsigned int flags = data.toUInt32BE(pos);
|
||||
pos += 4;
|
||||
|
||||
d->sampleRate = flags >> 12;
|
||||
|
||||
@@ -86,9 +86,9 @@ bool IT::File::save()
|
||||
|
||||
seek(2, Current);
|
||||
|
||||
ushort length = 0;
|
||||
ushort instrumentCount = 0;
|
||||
ushort sampleCount = 0;
|
||||
unsigned short length = 0;
|
||||
unsigned short instrumentCount = 0;
|
||||
unsigned short sampleCount = 0;
|
||||
|
||||
if(!readU16L(length) || !readU16L(instrumentCount) || !readU16L(sampleCount))
|
||||
return false;
|
||||
@@ -97,9 +97,9 @@ bool IT::File::save()
|
||||
|
||||
// write comment as instrument and sample names:
|
||||
StringList lines = d->tag.comment().split("\n");
|
||||
for(ushort i = 0; i < instrumentCount; ++ i) {
|
||||
for(unsigned short i = 0; i < instrumentCount; ++ i) {
|
||||
seek(192L + length + ((long)i << 2));
|
||||
uint instrumentOffset = 0;
|
||||
unsigned int instrumentOffset = 0;
|
||||
if(!readU32L(instrumentOffset))
|
||||
return false;
|
||||
|
||||
@@ -112,15 +112,15 @@ bool IT::File::save()
|
||||
writeByte(0);
|
||||
}
|
||||
|
||||
for(ushort i = 0; i < sampleCount; ++ i) {
|
||||
for(unsigned short i = 0; i < sampleCount; ++ i) {
|
||||
seek(192L + length + ((long)instrumentCount << 2) + ((long)i << 2));
|
||||
uint sampleOffset = 0;
|
||||
unsigned int sampleOffset = 0;
|
||||
if(!readU32L(sampleOffset))
|
||||
return false;
|
||||
|
||||
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);
|
||||
@@ -129,7 +129,7 @@ bool IT::File::save()
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -139,15 +139,15 @@ bool IT::File::save()
|
||||
message.resize(7999);
|
||||
message.append((char)0);
|
||||
|
||||
ushort special = 0;
|
||||
ushort messageLength = 0;
|
||||
uint messageOffset = 0;
|
||||
unsigned short special = 0;
|
||||
unsigned short messageLength = 0;
|
||||
unsigned int messageOffset = 0;
|
||||
|
||||
seek(46);
|
||||
if(!readU16L(special))
|
||||
return false;
|
||||
|
||||
uint fileSize = static_cast<uint>(File::length());
|
||||
unsigned int fileSize = static_cast<unsigned int>(File::length());
|
||||
if(special & AudioProperties::MessageAttached) {
|
||||
seek(54);
|
||||
if(!readU16L(messageLength) || !readU32L(messageOffset))
|
||||
@@ -249,8 +249,8 @@ void IT::File::read(bool)
|
||||
d->properties.setChannels(channels);
|
||||
|
||||
// real length might be shorter because of skips and terminator
|
||||
ushort realLength = 0;
|
||||
for(ushort i = 0; i < length; ++ i) {
|
||||
unsigned short realLength = 0;
|
||||
for(unsigned short i = 0; i < length; ++ i) {
|
||||
READ_BYTE_AS(order);
|
||||
if(order == 255) break;
|
||||
if(order != 254) ++ realLength;
|
||||
@@ -264,7 +264,7 @@ void IT::File::read(bool)
|
||||
// Currently I just discard anything after a nil, but
|
||||
// e.g. VLC seems to interprete a nil as a space. I
|
||||
// don't know what is the proper behaviour.
|
||||
for(ushort i = 0; i < instrumentCount; ++ i) {
|
||||
for(unsigned short i = 0; i < instrumentCount; ++ i) {
|
||||
seek(192L + length + ((long)i << 2));
|
||||
READ_U32L_AS(instrumentOffset);
|
||||
seek(instrumentOffset);
|
||||
@@ -280,7 +280,7 @@ void IT::File::read(bool)
|
||||
comment.append(instrumentName);
|
||||
}
|
||||
|
||||
for(ushort i = 0; i < sampleCount; ++ i) {
|
||||
for(unsigned short i = 0; i < sampleCount; ++ i) {
|
||||
seek(192L + length + ((long)instrumentCount << 2) + ((long)i << 2));
|
||||
READ_U32L_AS(sampleOffset);
|
||||
|
||||
|
||||
@@ -44,21 +44,21 @@ public:
|
||||
panningSeparation(0),
|
||||
pitchWheelDepth(0) {}
|
||||
|
||||
int channels;
|
||||
ushort lengthInPatterns;
|
||||
ushort instrumentCount;
|
||||
ushort sampleCount;
|
||||
ushort patternCount;
|
||||
ushort version;
|
||||
ushort compatibleVersion;
|
||||
ushort flags;
|
||||
ushort special;
|
||||
uchar globalVolume;
|
||||
uchar mixVolume;
|
||||
uchar tempo;
|
||||
uchar bpmSpeed;
|
||||
uchar panningSeparation;
|
||||
uchar pitchWheelDepth;
|
||||
int channels;
|
||||
unsigned short lengthInPatterns;
|
||||
unsigned short instrumentCount;
|
||||
unsigned short sampleCount;
|
||||
unsigned short patternCount;
|
||||
unsigned short version;
|
||||
unsigned short compatibleVersion;
|
||||
unsigned short flags;
|
||||
unsigned short special;
|
||||
unsigned char globalVolume;
|
||||
unsigned char mixVolume;
|
||||
unsigned char tempo;
|
||||
unsigned char bpmSpeed;
|
||||
unsigned char panningSeparation;
|
||||
unsigned char pitchWheelDepth;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -106,7 +106,7 @@ int IT::AudioProperties::channels() const
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::lengthInPatterns() const
|
||||
unsigned short IT::AudioProperties::lengthInPatterns() const
|
||||
{
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
@@ -116,67 +116,67 @@ bool IT::AudioProperties::stereo() const
|
||||
return d->flags & Stereo;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::instrumentCount() const
|
||||
unsigned short IT::AudioProperties::instrumentCount() const
|
||||
{
|
||||
return d->instrumentCount;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::sampleCount() const
|
||||
unsigned short IT::AudioProperties::sampleCount() const
|
||||
{
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::patternCount() const
|
||||
unsigned short IT::AudioProperties::patternCount() const
|
||||
{
|
||||
return d->patternCount;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::version() const
|
||||
unsigned short IT::AudioProperties::version() const
|
||||
{
|
||||
return d->version;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::compatibleVersion() const
|
||||
unsigned short IT::AudioProperties::compatibleVersion() const
|
||||
{
|
||||
return d->compatibleVersion;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::flags() const
|
||||
unsigned short IT::AudioProperties::flags() const
|
||||
{
|
||||
return d->flags;
|
||||
}
|
||||
|
||||
TagLib::ushort IT::AudioProperties::special() const
|
||||
unsigned short IT::AudioProperties::special() const
|
||||
{
|
||||
return d->special;
|
||||
}
|
||||
|
||||
uchar IT::AudioProperties::globalVolume() const
|
||||
unsigned char IT::AudioProperties::globalVolume() const
|
||||
{
|
||||
return d->globalVolume;
|
||||
}
|
||||
|
||||
uchar IT::AudioProperties::mixVolume() const
|
||||
unsigned char IT::AudioProperties::mixVolume() const
|
||||
{
|
||||
return d->mixVolume;
|
||||
}
|
||||
|
||||
uchar IT::AudioProperties::tempo() const
|
||||
unsigned char IT::AudioProperties::tempo() const
|
||||
{
|
||||
return d->tempo;
|
||||
}
|
||||
|
||||
uchar IT::AudioProperties::bpmSpeed() const
|
||||
unsigned char IT::AudioProperties::bpmSpeed() const
|
||||
{
|
||||
return d->bpmSpeed;
|
||||
}
|
||||
|
||||
uchar IT::AudioProperties::panningSeparation() const
|
||||
unsigned char IT::AudioProperties::panningSeparation() const
|
||||
{
|
||||
return d->panningSeparation;
|
||||
}
|
||||
|
||||
uchar IT::AudioProperties::pitchWheelDepth() const
|
||||
unsigned char IT::AudioProperties::pitchWheelDepth() const
|
||||
{
|
||||
return d->pitchWheelDepth;
|
||||
}
|
||||
@@ -190,72 +190,72 @@ void IT::AudioProperties::setChannels(int channels)
|
||||
d->channels = channels;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setLengthInPatterns(ushort lengthInPatterns)
|
||||
void IT::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns)
|
||||
{
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setInstrumentCount(ushort instrumentCount)
|
||||
void IT::AudioProperties::setInstrumentCount(unsigned short instrumentCount)
|
||||
{
|
||||
d->instrumentCount = instrumentCount;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setSampleCount(ushort sampleCount)
|
||||
void IT::AudioProperties::setSampleCount(unsigned short sampleCount)
|
||||
{
|
||||
d->sampleCount = sampleCount;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setPatternCount(ushort patternCount)
|
||||
void IT::AudioProperties::setPatternCount(unsigned short patternCount)
|
||||
{
|
||||
d->patternCount = patternCount;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setFlags(ushort flags)
|
||||
void IT::AudioProperties::setFlags(unsigned short flags)
|
||||
{
|
||||
d->flags = flags;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setSpecial(ushort special)
|
||||
void IT::AudioProperties::setSpecial(unsigned short special)
|
||||
{
|
||||
d->special = special;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setCompatibleVersion(ushort compatibleVersion)
|
||||
void IT::AudioProperties::setCompatibleVersion(unsigned short compatibleVersion)
|
||||
{
|
||||
d->compatibleVersion = compatibleVersion;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setVersion(ushort version)
|
||||
void IT::AudioProperties::setVersion(unsigned short version)
|
||||
{
|
||||
d->version = version;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setGlobalVolume(uchar globalVolume)
|
||||
void IT::AudioProperties::setGlobalVolume(unsigned char globalVolume)
|
||||
{
|
||||
d->globalVolume = globalVolume;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setMixVolume(uchar mixVolume)
|
||||
void IT::AudioProperties::setMixVolume(unsigned char mixVolume)
|
||||
{
|
||||
d->mixVolume = mixVolume;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setTempo(uchar tempo)
|
||||
void IT::AudioProperties::setTempo(unsigned char tempo)
|
||||
{
|
||||
d->tempo = tempo;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setBpmSpeed(uchar bpmSpeed)
|
||||
void IT::AudioProperties::setBpmSpeed(unsigned char bpmSpeed)
|
||||
{
|
||||
d->bpmSpeed = bpmSpeed;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setPanningSeparation(uchar panningSeparation)
|
||||
void IT::AudioProperties::setPanningSeparation(unsigned char panningSeparation)
|
||||
{
|
||||
d->panningSeparation = panningSeparation;
|
||||
}
|
||||
|
||||
void IT::AudioProperties::setPitchWheelDepth(uchar pitchWheelDepth)
|
||||
void IT::AudioProperties::setPitchWheelDepth(unsigned char pitchWheelDepth)
|
||||
{
|
||||
d->pitchWheelDepth = pitchWheelDepth;
|
||||
}
|
||||
|
||||
@@ -64,38 +64,38 @@ namespace TagLib {
|
||||
int sampleRate() const;
|
||||
int channels() const;
|
||||
|
||||
ushort lengthInPatterns() const;
|
||||
bool stereo() const;
|
||||
ushort instrumentCount() const;
|
||||
ushort sampleCount() const;
|
||||
ushort patternCount() const;
|
||||
ushort version() const;
|
||||
ushort compatibleVersion() const;
|
||||
ushort flags() const;
|
||||
ushort special() const;
|
||||
uchar globalVolume() const;
|
||||
uchar mixVolume() const;
|
||||
uchar tempo() const;
|
||||
uchar bpmSpeed() const;
|
||||
uchar panningSeparation() const;
|
||||
uchar pitchWheelDepth() const;
|
||||
unsigned short lengthInPatterns() const;
|
||||
bool stereo() const;
|
||||
unsigned short instrumentCount() const;
|
||||
unsigned short sampleCount() const;
|
||||
unsigned short patternCount() const;
|
||||
unsigned short version() const;
|
||||
unsigned short compatibleVersion() const;
|
||||
unsigned short flags() const;
|
||||
unsigned short special() const;
|
||||
unsigned char globalVolume() const;
|
||||
unsigned char mixVolume() const;
|
||||
unsigned char tempo() const;
|
||||
unsigned char bpmSpeed() const;
|
||||
unsigned char panningSeparation() const;
|
||||
unsigned char pitchWheelDepth() const;
|
||||
|
||||
private:
|
||||
void setChannels(int channels);
|
||||
void setLengthInPatterns(ushort lengthInPatterns);
|
||||
void setInstrumentCount(ushort instrumentCount);
|
||||
void setSampleCount (ushort sampleCount);
|
||||
void setPatternCount(ushort patternCount);
|
||||
void setVersion (ushort version);
|
||||
void setCompatibleVersion(ushort compatibleVersion);
|
||||
void setFlags (ushort flags);
|
||||
void setSpecial (ushort special);
|
||||
void setGlobalVolume(uchar globalVolume);
|
||||
void setMixVolume (uchar mixVolume);
|
||||
void setTempo (uchar tempo);
|
||||
void setBpmSpeed (uchar bpmSpeed);
|
||||
void setPanningSeparation(uchar panningSeparation);
|
||||
void setPitchWheelDepth (uchar pitchWheelDepth);
|
||||
void setLengthInPatterns(unsigned short lengthInPatterns);
|
||||
void setInstrumentCount(unsigned short instrumentCount);
|
||||
void setSampleCount (unsigned short sampleCount);
|
||||
void setPatternCount(unsigned short patternCount);
|
||||
void setVersion (unsigned short version);
|
||||
void setCompatibleVersion(unsigned short compatibleVersion);
|
||||
void setFlags (unsigned short flags);
|
||||
void setSpecial (unsigned short special);
|
||||
void setGlobalVolume(unsigned char globalVolume);
|
||||
void setMixVolume (unsigned char mixVolume);
|
||||
void setTempo (unsigned char tempo);
|
||||
void setBpmSpeed (unsigned char bpmSpeed);
|
||||
void setPanningSeparation(unsigned char panningSeparation);
|
||||
void setPitchWheelDepth (unsigned char pitchWheelDepth);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
|
||||
@@ -82,13 +82,13 @@ bool Mod::File::save()
|
||||
seek(0);
|
||||
writeString(d->tag.title(), 20);
|
||||
StringList lines = d->tag.comment().split("\n");
|
||||
uint n = std::min(static_cast<uint>(lines.size()), d->properties.instrumentCount());
|
||||
for(uint i = 0; i < n; ++ i) {
|
||||
unsigned int n = std::min<unsigned int>(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);
|
||||
}
|
||||
@@ -104,8 +104,8 @@ void Mod::File::read(bool)
|
||||
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;
|
||||
@@ -149,7 +149,7 @@ void Mod::File::read(bool)
|
||||
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);
|
||||
|
||||
@@ -33,14 +33,14 @@ Mod::FileBase::FileBase(IOStream *stream) : TagLib::File(stream)
|
||||
{
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeString(const String &s, uint size, char padding)
|
||||
void Mod::FileBase::writeString(const String &s, unsigned int size, char padding)
|
||||
{
|
||||
ByteVector data(s.data(String::Latin1));
|
||||
data.resize(size, padding);
|
||||
writeBlock(data);
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readString(String &s, uint size)
|
||||
bool Mod::FileBase::readString(String &s, unsigned int size)
|
||||
{
|
||||
ByteVector data(readBlock(size));
|
||||
if(data.size() < size) return false;
|
||||
@@ -54,33 +54,33 @@ bool Mod::FileBase::readString(String &s, uint size)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeByte(uchar byte)
|
||||
void Mod::FileBase::writeByte(unsigned char byte)
|
||||
{
|
||||
ByteVector data(1, byte);
|
||||
writeBlock(data);
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU16L(ushort number)
|
||||
void Mod::FileBase::writeU16L(unsigned short number)
|
||||
{
|
||||
writeBlock(ByteVector::fromUInt16LE(number));
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU32L(uint number)
|
||||
void Mod::FileBase::writeU32L(unsigned int number)
|
||||
{
|
||||
writeBlock(ByteVector::fromUInt32LE(number));
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU16B(ushort number)
|
||||
void Mod::FileBase::writeU16B(unsigned short number)
|
||||
{
|
||||
writeBlock(ByteVector::fromUInt16BE(number));
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU32B(uint number)
|
||||
void Mod::FileBase::writeU32B(unsigned int number)
|
||||
{
|
||||
writeBlock(ByteVector::fromUInt32BE(number));
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readByte(uchar &byte)
|
||||
bool Mod::FileBase::readByte(unsigned char &byte)
|
||||
{
|
||||
ByteVector data(readBlock(1));
|
||||
if(data.size() < 1) return false;
|
||||
@@ -88,7 +88,7 @@ bool Mod::FileBase::readByte(uchar &byte)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readU16L(ushort &number)
|
||||
bool Mod::FileBase::readU16L(unsigned short &number)
|
||||
{
|
||||
ByteVector data(readBlock(2));
|
||||
if(data.size() < 2) return false;
|
||||
@@ -96,14 +96,14 @@ bool Mod::FileBase::readU16L(ushort &number)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readU32L(uint &number) {
|
||||
bool Mod::FileBase::readU32L(unsigned int &number) {
|
||||
ByteVector data(readBlock(4));
|
||||
if(data.size() < 4) return false;
|
||||
number = data.toUInt32LE(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readU16B(ushort &number)
|
||||
bool Mod::FileBase::readU16B(unsigned short &number)
|
||||
{
|
||||
ByteVector data(readBlock(2));
|
||||
if(data.size() < 2) return false;
|
||||
@@ -111,7 +111,7 @@ bool Mod::FileBase::readU16B(ushort &number)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readU32B(uint &number) {
|
||||
bool Mod::FileBase::readU32B(unsigned int &number) {
|
||||
ByteVector data(readBlock(4));
|
||||
if(data.size() < 4) return false;
|
||||
number = data.toUInt32BE(0);
|
||||
|
||||
@@ -40,19 +40,19 @@ namespace TagLib {
|
||||
FileBase(FileName file);
|
||||
FileBase(IOStream *stream);
|
||||
|
||||
void writeString(const String &s, uint size, char padding = 0);
|
||||
void writeByte(uchar byte);
|
||||
void writeU16L(ushort number);
|
||||
void writeU32L(uint number);
|
||||
void writeU16B(ushort number);
|
||||
void writeU32B(uint number);
|
||||
void writeString(const String &s, unsigned int size, char padding = 0);
|
||||
void writeByte(unsigned char byte);
|
||||
void writeU16L(unsigned short number);
|
||||
void writeU32L(unsigned int number);
|
||||
void writeU16B(unsigned short number);
|
||||
void writeU32B(unsigned int number);
|
||||
|
||||
bool readString(String &s, uint size);
|
||||
bool readByte(uchar &byte);
|
||||
bool readU16L(ushort &number);
|
||||
bool readU32L(uint &number);
|
||||
bool readU16B(ushort &number);
|
||||
bool readU32B(uint &number);
|
||||
bool readString(String &s, unsigned int size);
|
||||
bool readByte(unsigned char &byte);
|
||||
bool readU16L(unsigned short &number);
|
||||
bool readU32L(unsigned int &number);
|
||||
bool readU16B(unsigned short &number);
|
||||
bool readU32B(unsigned int &number);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
setter(number); \
|
||||
}
|
||||
|
||||
#define READ_BYTE(setter) READ(setter,uchar, readByte)
|
||||
#define READ_U16L(setter) READ(setter,ushort,readU16L)
|
||||
#define READ_U32L(setter) READ(setter,uint, readU32L)
|
||||
#define READ_U16B(setter) READ(setter,ushort,readU16B)
|
||||
#define READ_U32B(setter) READ(setter,uint, readU32B)
|
||||
#define READ_BYTE(setter) READ(setter,unsigned char,readByte)
|
||||
#define READ_U16L(setter) READ(setter,unsigned short,readU16L)
|
||||
#define READ_U32L(setter) READ(setter,unsigned int,readU32L)
|
||||
#define READ_U16B(setter) READ(setter,unsigned short,readU16B)
|
||||
#define READ_U32B(setter) READ(setter,unsigned int,readU32B)
|
||||
|
||||
#define READ_STRING(setter,size) \
|
||||
{ \
|
||||
@@ -54,11 +54,11 @@
|
||||
type name = 0; \
|
||||
READ_ASSERT(read(name));
|
||||
|
||||
#define READ_BYTE_AS(name) READ_AS(uchar, name,readByte)
|
||||
#define READ_U16L_AS(name) READ_AS(ushort,name,readU16L)
|
||||
#define READ_U32L_AS(name) READ_AS(uint, name,readU32L)
|
||||
#define READ_U16B_AS(name) READ_AS(ushort,name,readU16B)
|
||||
#define READ_U32B_AS(name) READ_AS(uint, name,readU32B)
|
||||
#define READ_BYTE_AS(name) READ_AS(unsigned char,name,readByte)
|
||||
#define READ_U16L_AS(name) READ_AS(unsigned short,name,readU16L)
|
||||
#define READ_U32L_AS(name) READ_AS(unsigned int,name,readU32L)
|
||||
#define READ_U16B_AS(name) READ_AS(unsigned short,name,readU16B)
|
||||
#define READ_U32B_AS(name) READ_AS(unsigned int,name,readU32B)
|
||||
|
||||
#define READ_STRING_AS(name,size) \
|
||||
String name; \
|
||||
|
||||
@@ -32,9 +32,9 @@ public:
|
||||
instrumentCount(0),
|
||||
lengthInPatterns(0) {}
|
||||
|
||||
int channels;
|
||||
uint instrumentCount;
|
||||
uchar lengthInPatterns;
|
||||
int channels;
|
||||
unsigned int instrumentCount;
|
||||
unsigned char lengthInPatterns;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -82,12 +82,12 @@ int Mod::AudioProperties::channels() const
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
TagLib::uint Mod::AudioProperties::instrumentCount() const
|
||||
unsigned int Mod::AudioProperties::instrumentCount() const
|
||||
{
|
||||
return d->instrumentCount;
|
||||
}
|
||||
|
||||
uchar Mod::AudioProperties::lengthInPatterns() const
|
||||
unsigned char Mod::AudioProperties::lengthInPatterns() const
|
||||
{
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
@@ -101,12 +101,12 @@ void Mod::AudioProperties::setChannels(int channels)
|
||||
d->channels = channels;
|
||||
}
|
||||
|
||||
void Mod::AudioProperties::setInstrumentCount(uint instrumentCount)
|
||||
void Mod::AudioProperties::setInstrumentCount(unsigned int instrumentCount)
|
||||
{
|
||||
d->instrumentCount = instrumentCount;
|
||||
}
|
||||
|
||||
void Mod::AudioProperties::setLengthInPatterns(uchar lengthInPatterns)
|
||||
void Mod::AudioProperties::setLengthInPatterns(unsigned char lengthInPatterns)
|
||||
{
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@ namespace TagLib {
|
||||
int sampleRate() const;
|
||||
int channels() const;
|
||||
|
||||
uint instrumentCount() const;
|
||||
uchar lengthInPatterns() const;
|
||||
unsigned int instrumentCount() const;
|
||||
unsigned char lengthInPatterns() const;
|
||||
|
||||
private:
|
||||
void setChannels(int channels);
|
||||
|
||||
void setInstrumentCount(uint sampleCount);
|
||||
void setLengthInPatterns(uchar lengthInPatterns);
|
||||
void setInstrumentCount(unsigned int sampleCount);
|
||||
void setLengthInPatterns(unsigned char lengthInPatterns);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
|
||||
@@ -74,12 +74,12 @@ String Mod::Tag::genre() const
|
||||
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;
|
||||
}
|
||||
@@ -116,11 +116,11 @@ void Mod::Tag::setGenre(const String &)
|
||||
{
|
||||
}
|
||||
|
||||
void Mod::Tag::setYear(uint)
|
||||
void Mod::Tag::setYear(unsigned int)
|
||||
{
|
||||
}
|
||||
|
||||
void Mod::Tag::setTrack(uint)
|
||||
void Mod::Tag::setTrack(unsigned int)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -77,12 +77,12 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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;
|
||||
|
||||
PictureMap pictures() const;
|
||||
|
||||
@@ -142,12 +142,12 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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);
|
||||
|
||||
void setPictures(const PictureMap &l);
|
||||
|
||||
|
||||
@@ -113,14 +113,14 @@ MP4::Item::Item(int value) :
|
||||
d->data->type = TypeInt;
|
||||
}
|
||||
|
||||
MP4::Item::Item(uchar value) :
|
||||
MP4::Item::Item(unsigned char value) :
|
||||
d(new ItemPrivate())
|
||||
{
|
||||
d->data->m_byte = value;
|
||||
d->data->type = TypeByte;
|
||||
}
|
||||
|
||||
MP4::Item::Item(uint value) :
|
||||
MP4::Item::Item(unsigned int value) :
|
||||
d(new ItemPrivate())
|
||||
{
|
||||
d->data->m_uint = value;
|
||||
@@ -185,13 +185,13 @@ MP4::Item::toInt() const
|
||||
return d->data->m_int;
|
||||
}
|
||||
|
||||
uchar
|
||||
unsigned char
|
||||
MP4::Item::toByte() const
|
||||
{
|
||||
return d->data->m_byte;
|
||||
}
|
||||
|
||||
TagLib::uint
|
||||
unsigned int
|
||||
MP4::Item::toUInt() const
|
||||
{
|
||||
return d->data->m_uint;
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace TagLib {
|
||||
~Item();
|
||||
|
||||
Item(int value);
|
||||
Item(uchar value);
|
||||
Item(uint value);
|
||||
Item(unsigned char value);
|
||||
Item(unsigned int value);
|
||||
Item(long long value);
|
||||
Item(bool value);
|
||||
Item(int first, int second);
|
||||
@@ -83,8 +83,8 @@ namespace TagLib {
|
||||
AtomDataType atomDataType() const;
|
||||
|
||||
int toInt() const;
|
||||
uchar toByte() const;
|
||||
uint toUInt() const;
|
||||
unsigned char toByte() const;
|
||||
unsigned int toUInt() const;
|
||||
long long toLongLong() const;
|
||||
bool toBool() const;
|
||||
IntPair toIntPair() const;
|
||||
|
||||
@@ -187,7 +187,7 @@ MP4::AudioProperties::read(File *file, Atoms *atoms)
|
||||
file->seek(mdhd->offset);
|
||||
data = file->readBlock(static_cast<size_t>(mdhd->length));
|
||||
|
||||
const uint version = data[8];
|
||||
const unsigned int version = data[8];
|
||||
long long unit;
|
||||
long long length;
|
||||
if(version == 1) {
|
||||
@@ -222,7 +222,7 @@ MP4::AudioProperties::read(File *file, Atoms *atoms)
|
||||
d->bitsPerSample = data.toUInt16BE(42);
|
||||
d->sampleRate = data.toUInt32BE(46);
|
||||
if(data.containsAt("esds", 56) && data[64] == 0x03) {
|
||||
uint pos = 65;
|
||||
unsigned int pos = 65;
|
||||
if(data.containsAt("\x80\x80\x80", pos)) {
|
||||
pos += 3;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ MP4::Tag::parseByte(const MP4::Atom *atom)
|
||||
{
|
||||
ByteVectorList data = parseData(atom);
|
||||
if(!data.isEmpty()) {
|
||||
addItem(atom->name, (uchar)data[0].at(0));
|
||||
addItem(atom->name, static_cast<unsigned char>(data[0].at(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,13 +805,13 @@ MP4::Tag::setGenre(const String &value)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace TagLib {
|
||||
String album() const;
|
||||
String comment() const;
|
||||
String genre() const;
|
||||
uint year() const;
|
||||
uint track() const;
|
||||
unsigned int year() const;
|
||||
unsigned int track() const;
|
||||
PictureMap pictures() const;
|
||||
|
||||
void setTitle(const String &value);
|
||||
@@ -67,8 +67,8 @@ namespace TagLib {
|
||||
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);
|
||||
void setPictures(const PictureMap &l);
|
||||
|
||||
virtual bool isEmpty() const;
|
||||
|
||||
@@ -64,14 +64,14 @@ public:
|
||||
delete properties;
|
||||
}
|
||||
|
||||
long long APELocation;
|
||||
uint APESize;
|
||||
long long APELocation;
|
||||
unsigned int APESize;
|
||||
|
||||
long long ID3v1Location;
|
||||
|
||||
ID3v2::Header *ID3v2Header;
|
||||
long long ID3v2Location;
|
||||
uint ID3v2Size;
|
||||
long long ID3v2Location;
|
||||
unsigned int ID3v2Size;
|
||||
|
||||
DoubleTagUnion tag;
|
||||
|
||||
|
||||
@@ -54,18 +54,18 @@ public:
|
||||
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;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -127,12 +127,12 @@ int MPC::AudioProperties::mpcVersion() const
|
||||
return d->version;
|
||||
}
|
||||
|
||||
TagLib::uint MPC::AudioProperties::totalFrames() const
|
||||
unsigned int MPC::AudioProperties::totalFrames() const
|
||||
{
|
||||
return d->totalFrames;
|
||||
}
|
||||
|
||||
TagLib::uint MPC::AudioProperties::sampleFrames() const
|
||||
unsigned int MPC::AudioProperties::sampleFrames() const
|
||||
{
|
||||
return d->sampleFrames;
|
||||
}
|
||||
@@ -246,19 +246,19 @@ void MPC::AudioProperties::readSV8(File *file, long long streamLength)
|
||||
break;
|
||||
}
|
||||
|
||||
const ulong begSilence = readSize(data, pos);
|
||||
const unsigned long begSilence = readSize(data, pos);
|
||||
if(pos > dataSize - 2) {
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt.");
|
||||
break;
|
||||
}
|
||||
|
||||
const ushort flags = data.toUInt16BE(pos);
|
||||
const unsigned short flags = data.toUInt16BE(pos);
|
||||
pos += 2;
|
||||
|
||||
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);
|
||||
@@ -304,11 +304,11 @@ void MPC::AudioProperties::readSV7(const ByteVector &data, long long streamLengt
|
||||
|
||||
d->totalFrames = data.toUInt32LE(4);
|
||||
|
||||
const uint flags = data.toUInt32LE(8);
|
||||
const unsigned int flags = data.toUInt32LE(8);
|
||||
d->sampleRate = sftable[(flags >> 16) & 0x03];
|
||||
d->channels = 2;
|
||||
|
||||
const uint gapless = data.toUInt32LE(5);
|
||||
const unsigned int gapless = data.toUInt32LE(5);
|
||||
|
||||
d->trackGain = data.toUInt16LE(14);
|
||||
d->trackPeak = data.toUInt16LE(12);
|
||||
@@ -336,14 +336,14 @@ void MPC::AudioProperties::readSV7(const ByteVector &data, long long streamLengt
|
||||
|
||||
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.toUInt32LE(0);
|
||||
const unsigned int headerData = data.toUInt32LE(0);
|
||||
|
||||
d->bitrate = (headerData >> 23) & 0x01ff;
|
||||
d->version = (headerData >> 11) & 0x03ff;
|
||||
|
||||
@@ -101,8 +101,8 @@ namespace TagLib {
|
||||
*/
|
||||
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,
|
||||
|
||||
@@ -29,7 +29,7 @@ using namespace TagLib;
|
||||
|
||||
namespace
|
||||
{
|
||||
const wchar *genres[] = {
|
||||
const wchar_t *genres[] = {
|
||||
L"Blues",
|
||||
L"Classic Rock",
|
||||
L"Country",
|
||||
|
||||
@@ -63,16 +63,21 @@ class ID3v1::Tag::TagPrivate
|
||||
{
|
||||
public:
|
||||
TagPrivate() :
|
||||
file(0),
|
||||
tagOffset(0),
|
||||
track(0),
|
||||
genre(255) {}
|
||||
|
||||
File *file;
|
||||
long long tagOffset;
|
||||
|
||||
String title;
|
||||
String artist;
|
||||
String album;
|
||||
String year;
|
||||
String comment;
|
||||
uchar track;
|
||||
uchar genre;
|
||||
unsigned char track;
|
||||
unsigned char genre;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -89,7 +94,10 @@ ID3v1::Tag::Tag(File *file, long long tagOffset) :
|
||||
TagLib::Tag(),
|
||||
d(new TagPrivate())
|
||||
{
|
||||
read(file, tagOffset);
|
||||
d->file = file;
|
||||
d->tagOffset = tagOffset;
|
||||
|
||||
read();
|
||||
}
|
||||
|
||||
ID3v1::Tag::~Tag()
|
||||
@@ -144,12 +152,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;
|
||||
}
|
||||
@@ -184,12 +192,12 @@ 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;
|
||||
}
|
||||
@@ -198,12 +206,12 @@ void ID3v1::Tag::setPictures(const PictureMap &l)
|
||||
{
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -220,12 +228,12 @@ void ID3v1::Tag::setStringHandler(const TagLib::StringHandler *handler)
|
||||
// protected methods
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ID3v1::Tag::read(File *file, long long tagOffset)
|
||||
void ID3v1::Tag::read()
|
||||
{
|
||||
if(file && file->isValid()) {
|
||||
file->seek(tagOffset);
|
||||
if(d->file && d->file->isValid()) {
|
||||
d->file->seek(d->tagOffset);
|
||||
// read the tag -- always 128 bytes
|
||||
const ByteVector data = file->readBlock(128);
|
||||
const ByteVector data = d->file->readBlock(128);
|
||||
|
||||
// some initial sanity checking
|
||||
if(data.size() == 128 && data.startsWith("TAG"))
|
||||
@@ -260,12 +268,12 @@ void ID3v1::Tag::parse(const ByteVector &data)
|
||||
// ID3v1.1 detected
|
||||
|
||||
d->comment = stringHandler->parse(data.mid(offset, 28));
|
||||
d->track = uchar(data[offset + 29]);
|
||||
d->track = static_cast<unsigned char>(data[offset + 29]);
|
||||
}
|
||||
else
|
||||
d->comment = data.mid(offset, 30);
|
||||
|
||||
offset += 30;
|
||||
|
||||
d->genre = uchar(data[offset]);
|
||||
d->genre = static_cast<unsigned char>(data[offset]);
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ 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 PictureMap pictures() const;
|
||||
|
||||
virtual void setTitle(const String &s);
|
||||
@@ -106,8 +106,8 @@ namespace TagLib {
|
||||
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);
|
||||
virtual void setPictures(const PictureMap &l);
|
||||
|
||||
/*!
|
||||
@@ -115,7 +115,7 @@ namespace TagLib {
|
||||
*
|
||||
* \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.
|
||||
@@ -123,7 +123,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
|
||||
@@ -140,7 +140,8 @@ namespace TagLib {
|
||||
/*!
|
||||
* Reads from the file specified in the constructor.
|
||||
*/
|
||||
void read(File *file, long long tagOffset);
|
||||
void read();
|
||||
|
||||
/*!
|
||||
* Pareses the body of the tag in \a data.
|
||||
*/
|
||||
|
||||
@@ -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 (pos + 1 >= data.size()) {
|
||||
if(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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -109,8 +109,8 @@ void EventTimingCodesFrame::parseFields(const ByteVector &data)
|
||||
size_t pos = 1;
|
||||
d->synchedEvents.clear();
|
||||
while(pos + 4 < end) {
|
||||
EventType type = EventType(uchar(data[pos++]));
|
||||
uint time = data.toUInt32BE(pos);
|
||||
EventType type = static_cast<EventType>(static_cast<unsigned char>(data[pos++]));
|
||||
unsigned int time = data.toUInt32BE(pos);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -33,11 +33,6 @@ using namespace ID3v2;
|
||||
|
||||
namespace
|
||||
{
|
||||
static inline int bitsToBytes(int i)
|
||||
{
|
||||
return i % 8 == 0 ? i / 8 : (i - i % 8) / 8 + 1;
|
||||
}
|
||||
|
||||
struct ChannelData
|
||||
{
|
||||
ChannelData() : channelType(RelativeVolumeFrame::Other), volumeAdjustment(0) {}
|
||||
@@ -158,7 +153,6 @@ void RelativeVolumeFrame::parseFields(const ByteVector &data)
|
||||
|
||||
while(pos + 4 <= data.size()) {
|
||||
|
||||
|
||||
ChannelType type = ChannelType(data[pos]);
|
||||
pos += 1;
|
||||
|
||||
@@ -170,7 +164,7 @@ void RelativeVolumeFrame::parseFields(const ByteVector &data)
|
||||
channel.peakVolume.bitsRepresentingPeak = data[pos];
|
||||
pos += 1;
|
||||
|
||||
int bytes = bitsToBytes(channel.peakVolume.bitsRepresentingPeak);
|
||||
const int bytes = (channel.peakVolume.bitsRepresentingPeak + 7) / 8;
|
||||
channel.peakVolume.peakVolume = data.mid(pos, bytes);
|
||||
pos += bytes;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -171,7 +170,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
|
||||
*/
|
||||
String::Type encWithEndianness = d->textEncoding;
|
||||
if(d->textEncoding == String::UTF16) {
|
||||
ushort bom = data.toUInt16BE(6);
|
||||
unsigned short bom = data.toUInt16BE(6);
|
||||
if(bom == 0xfffe) {
|
||||
encWithEndianness = String::UTF16LE;
|
||||
} else if(bom == 0xfeff) {
|
||||
@@ -184,7 +183,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
|
||||
String::Type enc = d->textEncoding;
|
||||
// If a UTF16 string has no BOM, use the encoding found above.
|
||||
if(enc == String::UTF16 && pos + 1 < end) {
|
||||
ushort bom = data.toUInt16BE(pos);
|
||||
unsigned short bom = data.toUInt16BE(pos);
|
||||
if(bom != 0xfffe && bom != 0xfeff) {
|
||||
enc = encWithEndianness;
|
||||
}
|
||||
@@ -193,7 +192,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
|
||||
if(text.isEmpty() || pos + 4 > end)
|
||||
return;
|
||||
|
||||
uint time = data.toUInt32BE(pos);
|
||||
unsigned int time = data.toUInt32BE(pos);
|
||||
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 "
|
||||
@@ -274,8 +274,8 @@ void TableOfContentsFrame::parseFields(const ByteVector &data)
|
||||
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.
|
||||
|
||||
@@ -122,22 +122,23 @@ void TextIdentificationFrame::setTextEncoding(String::Type encoding)
|
||||
namespace
|
||||
{
|
||||
// array of allowed TIPL prefixes and their corresponding key value
|
||||
static const TagLib::uint involvedPeopleSize = 5;
|
||||
static const char* involvedPeople[][2] = {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -268,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();
|
||||
@@ -329,7 +329,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;
|
||||
@@ -566,8 +566,8 @@ public:
|
||||
{}
|
||||
|
||||
ByteVector frameID;
|
||||
uint frameSize;
|
||||
uint version;
|
||||
unsigned int frameSize;
|
||||
unsigned int version;
|
||||
|
||||
// flags
|
||||
|
||||
@@ -585,12 +585,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:
|
||||
@@ -614,7 +614,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);
|
||||
@@ -627,10 +627,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;
|
||||
|
||||
@@ -771,22 +771,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
|
||||
@@ -241,7 +241,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
|
||||
@@ -342,7 +342,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.
|
||||
@@ -361,7 +361,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>)
|
||||
@@ -383,24 +383,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.
|
||||
@@ -410,7 +410,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
|
||||
@@ -418,7 +418,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.
|
||||
|
||||
@@ -118,7 +118,7 @@ FrameFactory *FrameFactory::instance()
|
||||
Frame *FrameFactory::createFrame(const ByteVector &origData, const 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();
|
||||
|
||||
@@ -126,7 +126,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, const Header *tagHe
|
||||
// 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;
|
||||
@@ -324,18 +324,27 @@ void FrameFactory::rebuildAggregateFrames(ID3v2::Tag *tag) const
|
||||
tag->frameList("TDRC").size() == 1 &&
|
||||
tag->frameList("TDAT").size() == 1)
|
||||
{
|
||||
TextIdentificationFrame *trdc =
|
||||
TextIdentificationFrame *tdrc =
|
||||
static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
|
||||
UnknownFrame *tdat =
|
||||
static_cast<UnknownFrame *>(tag->frameList("TDAT").front());
|
||||
UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front());
|
||||
|
||||
if(trdc->fieldList().size() == 1 &&
|
||||
trdc->fieldList().front().size() == 4 &&
|
||||
if(tdrc->fieldList().size() == 1 &&
|
||||
tdrc->fieldList().front().size() == 4 &&
|
||||
tdat->data().size() >= 5)
|
||||
{
|
||||
String date(tdat->data().mid(1), String::Type(tdat->data()[0]));
|
||||
if(date.length() == 4)
|
||||
trdc->setText(trdc->toString() + '-' + date.substr(2, 2) + '-' + date.substr(0, 2));
|
||||
if(date.length() == 4) {
|
||||
tdrc->setText(tdrc->toString() + '-' + date.substr(2, 2) + '-' + date.substr(0, 2));
|
||||
if(tag->frameList("TIME").size() == 1) {
|
||||
UnknownFrame *timeframe = static_cast<UnknownFrame *>(tag->frameList("TIME").front());
|
||||
if(timeframe->data().size() >= 5) {
|
||||
String time(timeframe->data().mid(1), String::Type(timeframe->data()[0]));
|
||||
if(time.length() == 4) {
|
||||
tdrc->setText(tdrc->toString() + 'T' + time.substr(0, 2) + ':' + time.substr(2, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,3 +530,4 @@ bool FrameFactory::updateFrame(Frame::Header *header) const
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ void Header::parse(const ByteVector &data)
|
||||
}
|
||||
|
||||
for(ByteVector::ConstIterator it = sizeData.begin(); it != sizeData.end(); it++) {
|
||||
if(uchar(*it) >= 128) {
|
||||
if(static_cast<unsigned char>(*it) >= 128) {
|
||||
d->tagSize = 0;
|
||||
debug("TagLib::ID3v2::Header::parse() - One of the size bytes in the id3v2 header was greater than the allowed 128.");
|
||||
return;
|
||||
|
||||
@@ -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;
|
||||
const int last = data.size() > 4 ? 3 : static_cast<int>(data.size()) - 1;
|
||||
|
||||
@@ -62,12 +62,12 @@ TagLib::uint SynchData::toUInt(const ByteVector &data)
|
||||
return sum;
|
||||
}
|
||||
|
||||
ByteVector SynchData::fromUInt(uint value)
|
||||
ByteVector SynchData::fromUInt(unsigned int value)
|
||||
{
|
||||
ByteVector v(4, 0);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
v[i] = uchar(value >> ((3 - i) * 7) & 0x7f);
|
||||
v[i] = static_cast<unsigned char>(value >> ((3 - i) * 7) & 0x7f);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -84,7 +84,8 @@ class ID3v2::Tag::TagPrivate
|
||||
{
|
||||
public:
|
||||
TagPrivate() :
|
||||
fileLength(0),
|
||||
file(0),
|
||||
tagOffset(0),
|
||||
extendedHeader(0),
|
||||
footer(0)
|
||||
{
|
||||
@@ -97,9 +98,11 @@ public:
|
||||
delete footer;
|
||||
}
|
||||
|
||||
long long fileLength;
|
||||
const FrameFactory *factory;
|
||||
|
||||
File *file;
|
||||
long long tagOffset;
|
||||
|
||||
Header header;
|
||||
ExtendedHeader *extendedHeader;
|
||||
Footer *footer;
|
||||
@@ -124,8 +127,10 @@ ID3v2::Tag::Tag(File *file, long long tagOffset, const FrameFactory *factory) :
|
||||
d(new TagPrivate())
|
||||
{
|
||||
d->factory = factory;
|
||||
d->file = file;
|
||||
d->tagOffset = tagOffset;
|
||||
|
||||
read(file, tagOffset);
|
||||
read();
|
||||
}
|
||||
|
||||
ID3v2::Tag::~Tag()
|
||||
@@ -215,14 +220,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();
|
||||
@@ -372,7 +377,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");
|
||||
@@ -381,7 +386,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");
|
||||
@@ -719,14 +724,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]);
|
||||
}
|
||||
@@ -799,7 +804,7 @@ ByteVector ID3v2::Tag::render(int version) const
|
||||
else {
|
||||
// Padding won't increase beyond 1% of the file size or 1MB.
|
||||
|
||||
long long threshold = d->fileLength / 100;
|
||||
long long threshold = d->file ? d->file->length() / 100 : 0;
|
||||
threshold = std::max(threshold, MinPaddingSize);
|
||||
threshold = std::min(threshold, MaxPaddingSize);
|
||||
|
||||
@@ -807,14 +812,11 @@ 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);
|
||||
d->header.setTagSize(static_cast<TagLib::uint>(tagData.size() - Header::size()));
|
||||
|
||||
if(d->fileLength > 0)
|
||||
d->fileLength += (d->header.tagSize() - originalSize);
|
||||
d->header.setTagSize(static_cast<unsigned int>(tagData.size() - Header::size()));
|
||||
|
||||
// TODO: This should eventually include d->footer->render().
|
||||
const ByteVector headerData = d->header.render();
|
||||
@@ -840,24 +842,22 @@ void ID3v2::Tag::setLatin1StringHandler(const TagLib::StringHandler *handler)
|
||||
// protected members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ID3v2::Tag::read(TagLib::File *file, long long offset)
|
||||
void ID3v2::Tag::read()
|
||||
{
|
||||
if(!file)
|
||||
if(!d->file)
|
||||
return;
|
||||
|
||||
if(!file->isOpen())
|
||||
if(!d->file->isOpen())
|
||||
return;
|
||||
|
||||
d->fileLength = file->length();
|
||||
|
||||
file->seek(offset);
|
||||
d->header.setData(file->readBlock(Header::size()));
|
||||
d->file->seek(d->tagOffset);
|
||||
d->header.setData(d->file->readBlock(Header::size()));
|
||||
|
||||
// If the tag size is 0, then this is an invalid tag (tags must contain at
|
||||
// least one frame)
|
||||
|
||||
if(d->header.tagSize() != 0)
|
||||
parse(file->readBlock(d->header.tagSize()));
|
||||
parse(d->file->readBlock(d->header.tagSize()));
|
||||
|
||||
// Look for duplicate ID3v2 tags and treat them as an extra blank of this one.
|
||||
// It leads to overwriting them with zero when saving the tag.
|
||||
@@ -865,13 +865,13 @@ void ID3v2::Tag::read(TagLib::File *file, long 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) {
|
||||
|
||||
file->seek(offset + d->header.completeTagSize() + extraSize);
|
||||
d->file->seek(d->tagOffset + d->header.completeTagSize() + extraSize);
|
||||
|
||||
const ByteVector data = file->readBlock(Header::size());
|
||||
const ByteVector data = d->file->readBlock(Header::size());
|
||||
if(data.size() < Header::size() || !data.startsWith(Header::fileIdentifier()))
|
||||
break;
|
||||
|
||||
|
||||
@@ -140,8 +140,8 @@ 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 PictureMap pictures() const;
|
||||
|
||||
virtual void setTitle(const String &s);
|
||||
@@ -149,8 +149,8 @@ namespace TagLib {
|
||||
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 void setPictures(const PictureMap &l);
|
||||
|
||||
virtual bool isEmpty() const;
|
||||
@@ -356,7 +356,7 @@ namespace TagLib {
|
||||
* the Header, the body of the tag (which contains the ExtendedHeader and
|
||||
* frames) and Footer.
|
||||
*/
|
||||
void read(TagLib::File *file, long long offset);
|
||||
void read();
|
||||
|
||||
/*!
|
||||
* This is called by read to parse the body of the tag. It determines if an
|
||||
|
||||
@@ -45,12 +45,12 @@ namespace
|
||||
* starts with \e 111 is a bit more tricky, hence these functions.
|
||||
*/
|
||||
|
||||
inline bool firstSyncByte(uchar byte)
|
||||
inline bool firstSyncByte(unsigned char byte)
|
||||
{
|
||||
return (byte == 0xFF);
|
||||
}
|
||||
|
||||
inline bool secondSynchByte(uchar byte)
|
||||
inline bool secondSynchByte(unsigned char byte)
|
||||
{
|
||||
return ((byte & 0xE0) == 0xE0);
|
||||
}
|
||||
@@ -86,12 +86,12 @@ public:
|
||||
|
||||
const ID3v2::FrameFactory *ID3v2FrameFactory;
|
||||
|
||||
long long ID3v2Location;
|
||||
uint ID3v2OriginalSize;
|
||||
long long ID3v2Location;
|
||||
unsigned int ID3v2OriginalSize;
|
||||
|
||||
long long APELocation;
|
||||
long long APEFooterLocation;
|
||||
uint APEOriginalSize;
|
||||
long long APELocation;
|
||||
long long APEFooterLocation;
|
||||
unsigned int APEOriginalSize;
|
||||
|
||||
long long ID3v1Location;
|
||||
|
||||
@@ -368,7 +368,7 @@ long long MPEG::File::nextFrameOffset(long 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;
|
||||
}
|
||||
@@ -383,9 +383,8 @@ long long MPEG::File::previousFrameOffset(long long position)
|
||||
bool foundFirstSyncPattern = false;
|
||||
ByteVector buffer;
|
||||
|
||||
while (position > 0) {
|
||||
size_t size = position < static_cast<long long>(bufferSize())
|
||||
? static_cast<size_t>(position) : bufferSize();
|
||||
while(position > 0) {
|
||||
size_t size = static_cast<size_t>(std::min<long long>(position, bufferSize()));
|
||||
position -= size;
|
||||
|
||||
seek(position);
|
||||
|
||||
@@ -164,7 +164,7 @@ MPEG::Header &MPEG::Header::operator=(const Header &h)
|
||||
|
||||
void MPEG::Header::parse(const ByteVector &data)
|
||||
{
|
||||
if(data.size() < 4 || uchar(data[0]) != 0xff) {
|
||||
if(data.size() < 4 || static_cast<unsigned char>(data[0]) != 0xff) {
|
||||
debug("MPEG::Header::parse() -- First byte did not match MPEG synch.");
|
||||
return;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ void MPEG::Header::parse(const ByteVector &data)
|
||||
// The bitrate index is encoded as the first 4 bits of the 3rd byte,
|
||||
// i.e. 1111xxxx
|
||||
|
||||
int i = uchar(data[2]) >> 4;
|
||||
int i = static_cast<unsigned char>(data[2]) >> 4;
|
||||
|
||||
d->data->bitrate = bitrates[versionIndex][layerIndex][i];
|
||||
|
||||
@@ -233,7 +233,7 @@ void MPEG::Header::parse(const ByteVector &data)
|
||||
|
||||
// The sample rate index is encoded as two bits in the 3nd byte, i.e. xxxx11xx
|
||||
|
||||
i = uchar(data[2]) >> 2 & 0x03;
|
||||
i = static_cast<unsigned char>(data[2]) >> 2 & 0x03;
|
||||
|
||||
d->data->sampleRate = sampleRates[d->data->version][i];
|
||||
|
||||
@@ -245,7 +245,7 @@ void MPEG::Header::parse(const ByteVector &data)
|
||||
// The channel mode is encoded as a 2 bit value at the end of the 3nd byte,
|
||||
// i.e. xxxxxx11
|
||||
|
||||
d->data->channelMode = ChannelMode((uchar(data[3]) & 0xC0) >> 6);
|
||||
d->data->channelMode = static_cast<ChannelMode>((static_cast<unsigned char>(data[3]) & 0xC0) >> 6);
|
||||
|
||||
// TODO: Add mode extension for completeness
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ void MPEG::XingHeader::parse(const ByteVector &data)
|
||||
|
||||
// Xing header found.
|
||||
|
||||
if(data.size() < static_cast<ulong>(offset + 16)) {
|
||||
if(data.size() < static_cast<unsigned long>(offset + 16)) {
|
||||
debug("MPEG::XingHeader::parse() -- Xing header found but too short.");
|
||||
return;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ void MPEG::XingHeader::parse(const ByteVector &data)
|
||||
|
||||
// VBRI header found.
|
||||
|
||||
if(data.size() < static_cast<ulong>(offset + 32)) {
|
||||
if(data.size() < static_cast<unsigned long>(offset + 32)) {
|
||||
debug("MPEG::XingHeader::parse() -- VBRI header found but too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -236,7 +236,8 @@ void Ogg::FLAC::File::scan()
|
||||
|
||||
char blockType = header[0] & 0x7f;
|
||||
bool lastBlock = (header[0] & 0x80) != 0;
|
||||
uint length = header.toUInt24BE(1);
|
||||
unsigned int length = header.toUInt24BE(1);
|
||||
|
||||
overhead += length;
|
||||
|
||||
// Sanity: First block should be the stream_info metadata
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
delete lastPageHeader;
|
||||
}
|
||||
|
||||
uint streamSerialNumber;
|
||||
unsigned int streamSerialNumber;
|
||||
List<Page *> pages;
|
||||
PageHeader *firstPageHeader;
|
||||
PageHeader *lastPageHeader;
|
||||
@@ -78,7 +78,7 @@ Ogg::File::~File()
|
||||
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:
|
||||
@@ -100,7 +100,7 @@ ByteVector Ogg::File::packet(uint i)
|
||||
// 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();
|
||||
@@ -136,7 +136,7 @@ ByteVector Ogg::File::packet(uint i)
|
||||
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()) {
|
||||
@@ -265,8 +265,8 @@ bool Ogg::File::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(static_cast<int>(d->pages.size()) - 1);
|
||||
@@ -308,12 +308,12 @@ void Ogg::File::writePageGroup(const List<int> &thePageGroup)
|
||||
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());
|
||||
|
||||
@@ -59,12 +59,12 @@ namespace TagLib {
|
||||
* \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
|
||||
|
||||
@@ -131,7 +131,7 @@ Ogg::Page::ContainsPacketFlags Ogg::Page::containsPacket(int index) const
|
||||
return flags;
|
||||
}
|
||||
|
||||
TagLib::uint Ogg::Page::packetCount() const
|
||||
unsigned int Ogg::Page::packetCount() const
|
||||
{
|
||||
return static_cast<uint>(d->header.packetSizes().size());
|
||||
}
|
||||
@@ -197,7 +197,7 @@ ByteVector Ogg::Page::render() const
|
||||
|
||||
List<Ogg::Page *> Ogg::Page::paginate(const ByteVectorList &packets,
|
||||
PaginationStrategy strategy,
|
||||
uint streamSerialNumber,
|
||||
unsigned int streamSerialNumber,
|
||||
int firstPage,
|
||||
bool firstPacketContinued,
|
||||
bool lastPacketCompleted,
|
||||
@@ -310,7 +310,7 @@ Ogg::Page* Ogg::Page::getCopyWithNewPageSequenceNumber(int sequenceNumber)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Ogg::Page::Page(const ByteVectorList &packets,
|
||||
uint streamSerialNumber,
|
||||
unsigned int streamSerialNumber,
|
||||
int pageNumber,
|
||||
bool firstPacketContinued,
|
||||
bool lastPacketCompleted,
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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.
|
||||
@@ -181,7 +181,7 @@ namespace TagLib {
|
||||
*/
|
||||
static List<Page *> paginate(const ByteVectorList &packets,
|
||||
PaginationStrategy strategy,
|
||||
uint streamSerialNumber,
|
||||
unsigned int streamSerialNumber,
|
||||
int firstPage,
|
||||
bool firstPacketContinued = false,
|
||||
bool lastPacketCompleted = true,
|
||||
@@ -193,7 +193,7 @@ namespace TagLib {
|
||||
* 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,
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
bool firstPageOfStream;
|
||||
bool lastPageOfStream;
|
||||
long long absoluteGranularPosition;
|
||||
uint streamSerialNumber;
|
||||
unsigned int streamSerialNumber;
|
||||
int pageSequenceNumber;
|
||||
int size;
|
||||
int dataSize;
|
||||
@@ -160,12 +160,12 @@ void Ogg::PageHeader::setPageSequenceNumber(int sequenceNumber)
|
||||
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;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ ByteVector Ogg::PageHeader::render() const
|
||||
|
||||
ByteVector pageSegments = lacingValues();
|
||||
|
||||
data.append(char(uchar(pageSegments.size())));
|
||||
data.append(static_cast<unsigned char>(pageSegments.size()));
|
||||
data.append(pageSegments);
|
||||
|
||||
return data;
|
||||
@@ -263,7 +263,7 @@ void Ogg::PageHeader::read()
|
||||
// length portion of the page header. After reading the number of page
|
||||
// segments we'll then read in the corresponding data for this count.
|
||||
|
||||
int pageSegmentCount = uchar(data[26]);
|
||||
int pageSegmentCount = static_cast<unsigned char>(data[26]);
|
||||
|
||||
ByteVector pageSegments = d->file->readBlock(pageSegmentCount);
|
||||
|
||||
@@ -279,10 +279,10 @@ void Ogg::PageHeader::read()
|
||||
int packetSize = 0;
|
||||
|
||||
for(int i = 0; i < pageSegmentCount; i++) {
|
||||
d->dataSize += uchar(pageSegments[i]);
|
||||
packetSize += uchar(pageSegments[i]);
|
||||
d->dataSize += static_cast<unsigned char>(pageSegments[i]);
|
||||
packetSize += static_cast<unsigned char>(pageSegments[i]);
|
||||
|
||||
if(uchar(pageSegments[i]) < 255) {
|
||||
if(static_cast<unsigned char>(pageSegments[i]) < 255) {
|
||||
d->packetSizes.append(packetSize);
|
||||
packetSize = 0;
|
||||
}
|
||||
@@ -313,10 +313,10 @@ ByteVector Ogg::PageHeader::lacingValues() const
|
||||
div_t n = div(*it, 255);
|
||||
|
||||
for(int i = 0; i < n.quot; i++)
|
||||
data.append(char(uchar(255)));
|
||||
data.append(static_cast<unsigned char>(255));
|
||||
|
||||
if(it != --sizes.end() || d->lastPacketCompleted)
|
||||
data.append(char(uchar(n.rem)));
|
||||
data.append(static_cast<unsigned char>(n.rem));
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace TagLib {
|
||||
*
|
||||
* \see setStreamSerialNumber()
|
||||
*/
|
||||
uint streamSerialNumber() const;
|
||||
unsigned int streamSerialNumber() const;
|
||||
|
||||
/*!
|
||||
* Every Ogg logical stream is given a random serial number which is common
|
||||
@@ -179,7 +179,7 @@ namespace TagLib {
|
||||
*
|
||||
* \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
|
||||
|
||||
@@ -129,15 +129,15 @@ void Opus::AudioProperties::read(File *file)
|
||||
size_t pos = 8;
|
||||
|
||||
// *Version* (8 bits, unsigned)
|
||||
d->opusVersion = uchar(data.at(pos));
|
||||
d->opusVersion = static_cast<unsigned char>(data.at(pos));
|
||||
pos += 1;
|
||||
|
||||
// *Output Channel Count* 'C' (8 bits, unsigned)
|
||||
d->channels = uchar(data.at(pos));
|
||||
d->channels = static_cast<unsigned char>(data.at(pos));
|
||||
pos += 1;
|
||||
|
||||
// *Pre-skip* (16 bits, unsigned, little endian)
|
||||
const ushort preSkip = data.toUInt16LE(pos);
|
||||
const unsigned short preSkip = data.toUInt16LE(pos);
|
||||
pos += 2;
|
||||
|
||||
// *Input Sample Rate* (32 bits, unsigned, little endian)
|
||||
|
||||
@@ -165,7 +165,7 @@ void Ogg::Vorbis::AudioProperties::read(File *file)
|
||||
d->vorbisVersion = data.toUInt32LE(pos);
|
||||
pos += 4;
|
||||
|
||||
d->channels = uchar(data[pos]);
|
||||
d->channels = static_cast<unsigned char>(data[pos]);
|
||||
pos += 1;
|
||||
|
||||
d->sampleRate = data.toUInt32LE(pos);
|
||||
|
||||
@@ -26,32 +26,51 @@
|
||||
#include <tbytevector.h>
|
||||
#include <tdebug.h>
|
||||
|
||||
#include <flacpicture.h>
|
||||
#include <xiphcomment.h>
|
||||
#include <tpicturemap.h>
|
||||
#include <tpropertymap.h>
|
||||
|
||||
using namespace TagLib;
|
||||
|
||||
namespace
|
||||
{
|
||||
typedef Ogg::FieldListMap::Iterator FieldIterator;
|
||||
typedef Ogg::FieldListMap::ConstIterator FieldConstIterator;
|
||||
|
||||
typedef List<FLAC::Picture *> XiphPictureList;
|
||||
typedef XiphPictureList::Iterator PictureIterator;
|
||||
typedef XiphPictureList::Iterator PictureConstIterator;
|
||||
}
|
||||
|
||||
class Ogg::XiphComment::XiphCommentPrivate
|
||||
{
|
||||
public:
|
||||
XiphCommentPrivate()
|
||||
{
|
||||
pictureList.setAutoDelete(true);
|
||||
}
|
||||
|
||||
FieldListMap fieldListMap;
|
||||
String vendorID;
|
||||
String commentField;
|
||||
XiphPictureList pictureList;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Ogg::XiphComment::XiphComment() : TagLib::Tag()
|
||||
Ogg::XiphComment::XiphComment() :
|
||||
TagLib::Tag(),
|
||||
d(new XiphCommentPrivate())
|
||||
{
|
||||
d = new XiphCommentPrivate;
|
||||
}
|
||||
|
||||
Ogg::XiphComment::XiphComment(const ByteVector &data) : TagLib::Tag()
|
||||
Ogg::XiphComment::XiphComment(const ByteVector &data) :
|
||||
TagLib::Tag(),
|
||||
d(new XiphCommentPrivate())
|
||||
{
|
||||
d = new XiphCommentPrivate;
|
||||
parse(data);
|
||||
}
|
||||
|
||||
@@ -103,7 +122,7 @@ String Ogg::XiphComment::genre() const
|
||||
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();
|
||||
@@ -112,7 +131,7 @@ TagLib::uint Ogg::XiphComment::year() const
|
||||
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();
|
||||
@@ -158,7 +177,7 @@ void Ogg::XiphComment::setGenre(const String &s)
|
||||
addField("GENRE", s);
|
||||
}
|
||||
|
||||
void Ogg::XiphComment::setYear(uint i)
|
||||
void Ogg::XiphComment::setYear(unsigned int i)
|
||||
{
|
||||
removeFields("YEAR");
|
||||
if(i == 0)
|
||||
@@ -167,7 +186,7 @@ void Ogg::XiphComment::setYear(uint i)
|
||||
addField("DATE", String::number(i));
|
||||
}
|
||||
|
||||
void Ogg::XiphComment::setTrack(uint i)
|
||||
void Ogg::XiphComment::setTrack(unsigned int i)
|
||||
{
|
||||
removeFields("TRACKNUM");
|
||||
if(i == 0)
|
||||
@@ -182,21 +201,22 @@ void Ogg::XiphComment::setPictures(const PictureMap &l)
|
||||
|
||||
bool Ogg::XiphComment::isEmpty() const
|
||||
{
|
||||
FieldListMap::ConstIterator it = d->fieldListMap.begin();
|
||||
for(; it != d->fieldListMap.end(); ++it)
|
||||
for(FieldConstIterator it = d->fieldListMap.begin(); it != d->fieldListMap.end(); ++it) {
|
||||
if(!(*it).second.isEmpty())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
TagLib::uint Ogg::XiphComment::fieldCount() const
|
||||
unsigned int Ogg::XiphComment::fieldCount() const
|
||||
{
|
||||
uint count = 0;
|
||||
unsigned int count = 0;
|
||||
|
||||
FieldListMap::ConstIterator it = d->fieldListMap.begin();
|
||||
for(; it != d->fieldListMap.end(); ++it)
|
||||
count += static_cast<uint>((*it).second.size());
|
||||
for(FieldConstIterator it = d->fieldListMap.begin(); it != d->fieldListMap.end(); ++it)
|
||||
count += (*it).second.size();
|
||||
|
||||
count += d->pictureList.size();
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -215,7 +235,7 @@ PropertyMap Ogg::XiphComment::setProperties(const PropertyMap &properties)
|
||||
{
|
||||
// check which keys are to be deleted
|
||||
StringList toRemove;
|
||||
for(FieldListMap::ConstIterator it = d->fieldListMap.begin(); it != d->fieldListMap.end(); ++it)
|
||||
for(FieldConstIterator it = d->fieldListMap.begin(); it != d->fieldListMap.end(); ++it)
|
||||
if (!properties.contains(it->first))
|
||||
toRemove.append(it->first);
|
||||
|
||||
@@ -298,6 +318,31 @@ bool Ogg::XiphComment::contains(const String &key) const
|
||||
return !d->fieldListMap[key.upper()].isEmpty();
|
||||
}
|
||||
|
||||
void Ogg::XiphComment::removePicture(FLAC::Picture *picture, bool del)
|
||||
{
|
||||
PictureIterator it = d->pictureList.find(picture);
|
||||
if(it != d->pictureList.end())
|
||||
d->pictureList.erase(it);
|
||||
|
||||
if(del)
|
||||
delete picture;
|
||||
}
|
||||
|
||||
void Ogg::XiphComment::removePictures()
|
||||
{
|
||||
d->pictureList.clear();
|
||||
}
|
||||
|
||||
void Ogg::XiphComment::addPicture(FLAC::Picture * picture)
|
||||
{
|
||||
d->pictureList.append(picture);
|
||||
}
|
||||
|
||||
List<FLAC::Picture *> Ogg::XiphComment::pictureList()
|
||||
{
|
||||
return d->pictureList;
|
||||
}
|
||||
|
||||
ByteVector Ogg::XiphComment::render(bool addFramingBit) const
|
||||
{
|
||||
ByteVector data;
|
||||
@@ -339,6 +384,13 @@ ByteVector Ogg::XiphComment::render(bool addFramingBit) const
|
||||
}
|
||||
}
|
||||
|
||||
for(PictureConstIterator it = d->pictureList.begin(); it != d->pictureList.end(); ++it) {
|
||||
ByteVector picture = (*it)->render().toBase64();
|
||||
data.append(ByteVector::fromUInt32LE(picture.size() + 23));
|
||||
data.append("METADATA_BLOCK_PICTURE=");
|
||||
data.append(picture);
|
||||
}
|
||||
|
||||
// Append the "framing bit".
|
||||
|
||||
if(addFramingBit)
|
||||
@@ -369,7 +421,7 @@ void Ogg::XiphComment::parse(const ByteVector &data)
|
||||
|
||||
size_t pos = 0;
|
||||
|
||||
const uint vendorLength = data.toUInt32LE(0);
|
||||
const unsigned int vendorLength = data.toUInt32LE(0);
|
||||
pos += 4;
|
||||
|
||||
d->vendorID = String(data.mid(pos, vendorLength), String::UTF8);
|
||||
@@ -377,35 +429,101 @@ void Ogg::XiphComment::parse(const ByteVector &data)
|
||||
|
||||
// Next the number of fields in the comment vector.
|
||||
|
||||
const uint commentFields = data.toUInt32LE(pos);
|
||||
const unsigned int commentFields = data.toUInt32LE(pos);
|
||||
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.toUInt32LE(pos);
|
||||
const unsigned int commentLength = data.toUInt32LE(pos);
|
||||
pos += 4;
|
||||
|
||||
String comment = String(data.mid(pos, commentLength), String::UTF8);
|
||||
ByteVector entry = data.mid(pos, commentLength);
|
||||
|
||||
pos += commentLength;
|
||||
if(pos > data.size()) {
|
||||
|
||||
// Don't go past data end
|
||||
if(pos > data.size())
|
||||
break;
|
||||
|
||||
// Handle Pictures separately
|
||||
if(entry.startsWith("METADATA_BLOCK_PICTURE=")) {
|
||||
|
||||
// We need base64 encoded data including padding
|
||||
if((entry.size() - 23) > 3 && ((entry.size() - 23) % 4) == 0) {
|
||||
|
||||
// Decode base64 picture data
|
||||
ByteVector picturedata = ByteVector::fromBase64(entry.mid(23));
|
||||
if(picturedata.size()) {
|
||||
|
||||
// Decode Flac Picture
|
||||
FLAC::Picture * picture = new FLAC::Picture();
|
||||
if(picture->parse(picturedata)) {
|
||||
|
||||
d->pictureList.append(picture);
|
||||
|
||||
// continue to next field
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
delete picture;
|
||||
debug("Failed to decode FlacPicture block");
|
||||
}
|
||||
}
|
||||
else {
|
||||
debug("Failed to decode base64 encoded data");
|
||||
}
|
||||
}
|
||||
else {
|
||||
debug("Invalid base64 encoded data");
|
||||
}
|
||||
}
|
||||
|
||||
const size_t commentSeparatorPosition = comment.find("=");
|
||||
if(commentSeparatorPosition == String::npos()) {
|
||||
break;
|
||||
|
||||
// Handle old picture standard
|
||||
if(entry.startsWith("COVERART=")) {
|
||||
|
||||
if((entry.size() - 9) > 3 && ((entry.size() - 9) % 4) == 0) {
|
||||
|
||||
// Decode base64 picture data
|
||||
ByteVector picturedata = ByteVector::fromBase64(entry.mid(9));
|
||||
if (picturedata.size()) {
|
||||
|
||||
// Assume it's some type of image file
|
||||
FLAC::Picture * picture = new FLAC::Picture();
|
||||
picture->setData(picturedata);
|
||||
picture->setMimeType("image/");
|
||||
picture->setType(FLAC::Picture::Other);
|
||||
d->pictureList.append(picture);
|
||||
|
||||
// continue to next field
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
debug("Failed to decode base64 encoded data");
|
||||
}
|
||||
}
|
||||
else {
|
||||
debug("Invalid base64 encoded data");
|
||||
}
|
||||
}
|
||||
|
||||
String key = comment.substr(0, commentSeparatorPosition);
|
||||
String value = comment.substr(commentSeparatorPosition + 1);
|
||||
// Check for field separator
|
||||
size_t sep = entry.find('=');
|
||||
if(sep == ByteVector::npos()) {
|
||||
debug("Discarding invalid comment field.");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse key and value
|
||||
String key = String(entry.mid(0, sep), String::UTF8);
|
||||
String value = String(entry.mid(sep + 1), String::UTF8);
|
||||
addField(key, value, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "tstring.h"
|
||||
#include "tstringlist.h"
|
||||
#include "tbytevector.h"
|
||||
#include "flacpicture.h"
|
||||
#include "taglib_export.h"
|
||||
|
||||
namespace TagLib {
|
||||
@@ -84,8 +85,8 @@ 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 PictureMap pictures() const;
|
||||
|
||||
virtual void setTitle(const String &s);
|
||||
@@ -93,8 +94,8 @@ namespace TagLib {
|
||||
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 void setPictures( const PictureMap &l );
|
||||
|
||||
virtual bool isEmpty() const;
|
||||
@@ -103,7 +104,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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
|
||||
@@ -218,6 +219,31 @@ namespace TagLib {
|
||||
*/
|
||||
ByteVector render(bool addFramingBit = true) const;
|
||||
|
||||
|
||||
/*!
|
||||
* Returns a list of pictures attached to the xiph comment.
|
||||
*/
|
||||
List<FLAC::Picture *> pictureList();
|
||||
|
||||
/*!
|
||||
* Removes an picture. If \a del is true the picture's memory
|
||||
* will be freed; if it is false, it must be deleted by the user.
|
||||
*/
|
||||
void removePicture(FLAC::Picture *picture, bool del = true);
|
||||
|
||||
/*!
|
||||
* Remove all pictures.
|
||||
*/
|
||||
void removePictures();
|
||||
|
||||
/*!
|
||||
* Add a new picture to the comment block. The comment block takes ownership of the
|
||||
* picture and will handle freeing its memory.
|
||||
*
|
||||
* \note The file will be saved only after calling save().
|
||||
*/
|
||||
void addPicture(FLAC::Picture *picture);
|
||||
|
||||
protected:
|
||||
/*!
|
||||
* Reads the tag from the file specified in the constructor and fills the
|
||||
|
||||
@@ -125,7 +125,7 @@ bool RIFF::AIFF::File::hasID3v2Tag() const
|
||||
|
||||
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) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
ByteVector compressionType;
|
||||
String compressionName;
|
||||
|
||||
uint sampleFrames;
|
||||
unsigned int sampleFrames;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -114,7 +114,7 @@ int RIFF::AIFF::AudioProperties::sampleWidth() const
|
||||
return bitsPerSample();
|
||||
}
|
||||
|
||||
TagLib::uint RIFF::AIFF::AudioProperties::sampleFrames() const
|
||||
unsigned int RIFF::AIFF::AudioProperties::sampleFrames() const
|
||||
{
|
||||
return d->sampleFrames;
|
||||
}
|
||||
@@ -141,8 +141,8 @@ String RIFF::AIFF::AudioProperties::compressionName() const
|
||||
void RIFF::AIFF::AudioProperties::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())
|
||||
@@ -184,6 +184,7 @@ void RIFF::AIFF::AudioProperties::read(File *file)
|
||||
|
||||
if(data.size() >= 23) {
|
||||
d->compressionType = data.mid(18, 4);
|
||||
d->compressionName = String(data.mid(23, static_cast<uchar>(data[22])), String::Latin1);
|
||||
d->compressionName
|
||||
= String(data.mid(23, static_cast<unsigned char>(data[22])), String::Latin1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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.
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace
|
||||
{
|
||||
struct Chunk
|
||||
{
|
||||
ByteVector name;
|
||||
long long offset;
|
||||
TagLib::uint size;
|
||||
char padding;
|
||||
ByteVector name;
|
||||
long long offset;
|
||||
unsigned int size;
|
||||
unsigned int padding;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
const ByteOrder endianness;
|
||||
ByteVector type;
|
||||
TagLib::uint size;
|
||||
unsigned int size;
|
||||
ByteVector format;
|
||||
|
||||
std::vector<Chunk> chunks;
|
||||
@@ -90,17 +90,17 @@ RIFF::File::File(IOStream *stream, ByteOrder endianness) :
|
||||
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 static_cast<TagLib::uint>(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;
|
||||
}
|
||||
@@ -110,12 +110,12 @@ long long RIFF::File::chunkOffset(uint 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();
|
||||
@@ -123,7 +123,7 @@ ByteVector RIFF::File::chunkName(uint i) const
|
||||
return d->chunks[i].name;
|
||||
}
|
||||
|
||||
ByteVector RIFF::File::chunkData(uint i)
|
||||
ByteVector RIFF::File::chunkData(unsigned int i)
|
||||
{
|
||||
if(i >= chunkCount())
|
||||
return ByteVector();
|
||||
@@ -132,7 +132,7 @@ ByteVector RIFF::File::chunkData(uint i)
|
||||
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
|
||||
|
||||
@@ -146,7 +146,7 @@ void RIFF::File::setChunkData(uint i, const ByteVector &data)
|
||||
|
||||
writeChunk(chunkName(i), data, d->chunks[i].offset - 8, d->chunks[i].size + d->chunks[i].padding + 8);
|
||||
|
||||
d->chunks[i].size = static_cast<uint>(data.size());
|
||||
d->chunks[i].size = static_cast<unsigned int>(data.size());
|
||||
d->chunks[i].padding = (data.size() & 0x01) ? 1 : 0;
|
||||
|
||||
// Now update the internal offsets
|
||||
@@ -173,7 +173,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -210,15 +210,15 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo
|
||||
}
|
||||
|
||||
Chunk chunk;
|
||||
chunk.name = name;
|
||||
chunk.size = static_cast<uint>(data.size());
|
||||
chunk.offset = offset + 8;
|
||||
chunk.name = name;
|
||||
chunk.size = static_cast<uint>(data.size());
|
||||
chunk.offset = offset + 8;
|
||||
chunk.padding = static_cast<char>(data.size() & 1);
|
||||
|
||||
d->chunks.push_back(chunk);
|
||||
}
|
||||
|
||||
void RIFF::File::removeChunk(uint i)
|
||||
void RIFF::File::removeChunk(unsigned int i)
|
||||
{
|
||||
if(i >= d->chunks.size())
|
||||
return;
|
||||
@@ -226,7 +226,7 @@ void RIFF::File::removeChunk(uint i)
|
||||
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);
|
||||
|
||||
@@ -260,7 +260,7 @@ void RIFF::File::read()
|
||||
// + 8: chunk header at least, fix for additional junk bytes
|
||||
while(tell() + 8 <= length()) {
|
||||
ByteVector chunkName = readBlock(4);
|
||||
uint chunkSize;
|
||||
unsigned int chunkSize;
|
||||
if(d->endianness == BigEndian)
|
||||
chunkSize = readBlock(4).toUInt32BE(0);
|
||||
else
|
||||
@@ -304,8 +304,8 @@ void RIFF::File::read()
|
||||
}
|
||||
|
||||
void RIFF::File::writeChunk(const ByteVector &name, const ByteVector &data,
|
||||
long long offset, TagLib::uint replace,
|
||||
TagLib::uint leadingPadding)
|
||||
long long offset, size_t replace,
|
||||
unsigned int leadingPadding)
|
||||
{
|
||||
ByteVector combined;
|
||||
if(leadingPadding) {
|
||||
|
||||
@@ -58,46 +58,46 @@ namespace TagLib {
|
||||
/*!
|
||||
* \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.
|
||||
*/
|
||||
long long chunkOffset(uint i) const;
|
||||
long long 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
|
||||
@@ -126,7 +126,7 @@ namespace TagLib {
|
||||
*
|
||||
* \warning This will update the file immediately.
|
||||
*/
|
||||
void removeChunk(uint i);
|
||||
void removeChunk(unsigned int i);
|
||||
|
||||
/*!
|
||||
* Removes the chunk \a name.
|
||||
@@ -142,8 +142,8 @@ namespace TagLib {
|
||||
|
||||
void read();
|
||||
void writeChunk(const ByteVector &name, const ByteVector &data,
|
||||
long long offset, uint replace = 0,
|
||||
uint leadingPadding = 0);
|
||||
long long offset, size_t replace = 0,
|
||||
unsigned int leadingPadding = 0);
|
||||
|
||||
class FilePrivate;
|
||||
FilePrivate *d;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace TagLib
|
||||
return false;
|
||||
|
||||
for(ByteVector::ConstIterator it = name.begin(); it != name.end(); ++it) {
|
||||
const uchar c = static_cast<uchar>(*it);
|
||||
const int c = static_cast<unsigned char>(*it);
|
||||
if(c < 32 || 127 < c)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,12 +110,12 @@ String RIFF::Info::Tag::genre() const
|
||||
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();
|
||||
}
|
||||
@@ -150,7 +150,7 @@ void RIFF::Info::Tag::setGenre(const String &s)
|
||||
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));
|
||||
@@ -158,7 +158,7 @@ void RIFF::Info::Tag::setYear(uint i)
|
||||
d->fieldMap.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));
|
||||
|
||||
@@ -77,8 +77,8 @@ 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 PictureMap pictures() const;
|
||||
|
||||
virtual void setTitle(const String &s);
|
||||
@@ -86,8 +86,8 @@ namespace TagLib {
|
||||
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 void setPictures(const PictureMap &l);
|
||||
|
||||
virtual bool isEmpty() const;
|
||||
|
||||
@@ -179,7 +179,7 @@ bool RIFF::WAV::File::hasInfoTag() 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]) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
int sampleRate;
|
||||
int channels;
|
||||
int bitsPerSample;
|
||||
uint sampleFrames;
|
||||
unsigned int sampleFrames;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -118,7 +118,7 @@ int RIFF::WAV::AudioProperties::sampleWidth() const
|
||||
return bitsPerSample();
|
||||
}
|
||||
|
||||
TagLib::uint RIFF::WAV::AudioProperties::sampleFrames() const
|
||||
unsigned int RIFF::WAV::AudioProperties::sampleFrames() const
|
||||
{
|
||||
return d->sampleFrames;
|
||||
}
|
||||
@@ -135,10 +135,10 @@ int RIFF::WAV::AudioProperties::format() const
|
||||
void RIFF::WAV::AudioProperties::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())
|
||||
@@ -191,7 +191,7 @@ void RIFF::WAV::AudioProperties::read(File *file)
|
||||
d->bitrate = static_cast<int>(streamLength * 8.0 / length + 0.5);
|
||||
}
|
||||
else {
|
||||
const uint byteRate = data.toUInt32LE(8);
|
||||
const unsigned int byteRate = data.toUInt32LE(8);
|
||||
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);
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace TagLib {
|
||||
*
|
||||
* \see format()
|
||||
*/
|
||||
uint sampleFrames() const;
|
||||
unsigned int sampleFrames() const;
|
||||
|
||||
/*!
|
||||
* Returns the format ID of the file.
|
||||
|
||||
@@ -90,8 +90,8 @@ bool S3M::File::save()
|
||||
|
||||
seek(32);
|
||||
|
||||
ushort length = 0;
|
||||
ushort sampleCount = 0;
|
||||
unsigned short length = 0;
|
||||
unsigned short sampleCount = 0;
|
||||
|
||||
if(!readU16L(length) || !readU16L(sampleCount))
|
||||
return false;
|
||||
@@ -100,7 +100,7 @@ bool S3M::File::save()
|
||||
|
||||
int channels = 0;
|
||||
for(int i = 0; i < 32; ++ i) {
|
||||
uchar setting = 0;
|
||||
unsigned char setting = 0;
|
||||
if(!readByte(setting))
|
||||
return false;
|
||||
// or if(setting >= 128)?
|
||||
@@ -113,10 +113,10 @@ bool S3M::File::save()
|
||||
|
||||
StringList lines = d->tag.comment().split("\n");
|
||||
// write comment as sample names:
|
||||
for(ushort i = 0; i < sampleCount; ++ i) {
|
||||
for(unsigned short i = 0; i < sampleCount; ++ i) {
|
||||
seek(96L + length + ((long)i << 1));
|
||||
|
||||
ushort instrumentOffset = 0;
|
||||
unsigned short instrumentOffset = 0;
|
||||
if(!readU16L(instrumentOffset))
|
||||
return false;
|
||||
seek(((long)instrumentOffset << 4) + 48);
|
||||
@@ -183,8 +183,8 @@ void S3M::File::read(bool)
|
||||
d->properties.setChannels(channels);
|
||||
|
||||
seek(96);
|
||||
ushort realLength = 0;
|
||||
for(ushort i = 0; i < length; ++ i) {
|
||||
unsigned short realLength = 0;
|
||||
for(unsigned short i = 0; i < length; ++ i) {
|
||||
READ_BYTE_AS(order);
|
||||
if(order == 255) break;
|
||||
if(order != 254) ++ realLength;
|
||||
@@ -198,7 +198,7 @@ void S3M::File::read(bool)
|
||||
// However, there I never found instruments (SCRI) but
|
||||
// instead samples (SCRS).
|
||||
StringList comment;
|
||||
for(ushort i = 0; i < sampleCount; ++ i) {
|
||||
for(unsigned short i = 0; i < sampleCount; ++ i) {
|
||||
seek(96L + length + ((long)i << 1));
|
||||
|
||||
READ_U16L_AS(sampleHeaderOffset);
|
||||
|
||||
@@ -41,18 +41,18 @@ public:
|
||||
tempo(0),
|
||||
bpmSpeed(0) {}
|
||||
|
||||
ushort lengthInPatterns;
|
||||
int channels;
|
||||
bool stereo;
|
||||
ushort sampleCount;
|
||||
ushort patternCount;
|
||||
ushort flags;
|
||||
ushort trackerVersion;
|
||||
ushort fileFormatVersion;
|
||||
uchar globalVolume;
|
||||
uchar masterVolume;
|
||||
uchar tempo;
|
||||
uchar bpmSpeed;
|
||||
unsigned short lengthInPatterns;
|
||||
int channels;
|
||||
bool stereo;
|
||||
unsigned short sampleCount;
|
||||
unsigned short patternCount;
|
||||
unsigned short flags;
|
||||
unsigned short trackerVersion;
|
||||
unsigned short fileFormatVersion;
|
||||
unsigned char globalVolume;
|
||||
unsigned char masterVolume;
|
||||
unsigned char tempo;
|
||||
unsigned char bpmSpeed;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -100,7 +100,7 @@ int S3M::AudioProperties::channels() const
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
TagLib::ushort S3M::AudioProperties::lengthInPatterns() const
|
||||
unsigned short S3M::AudioProperties::lengthInPatterns() const
|
||||
{
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
@@ -110,47 +110,47 @@ bool S3M::AudioProperties::stereo() const
|
||||
return d->stereo;
|
||||
}
|
||||
|
||||
TagLib::ushort S3M::AudioProperties::sampleCount() const
|
||||
unsigned short S3M::AudioProperties::sampleCount() const
|
||||
{
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
TagLib::ushort S3M::AudioProperties::patternCount() const
|
||||
unsigned short S3M::AudioProperties::patternCount() const
|
||||
{
|
||||
return d->patternCount;
|
||||
}
|
||||
|
||||
TagLib::ushort S3M::AudioProperties::flags() const
|
||||
unsigned short S3M::AudioProperties::flags() const
|
||||
{
|
||||
return d->flags;
|
||||
}
|
||||
|
||||
TagLib::ushort S3M::AudioProperties::trackerVersion() const
|
||||
unsigned short S3M::AudioProperties::trackerVersion() const
|
||||
{
|
||||
return d->trackerVersion;
|
||||
}
|
||||
|
||||
TagLib::ushort S3M::AudioProperties::fileFormatVersion() const
|
||||
unsigned short S3M::AudioProperties::fileFormatVersion() const
|
||||
{
|
||||
return d->fileFormatVersion;
|
||||
}
|
||||
|
||||
uchar S3M::AudioProperties::globalVolume() const
|
||||
unsigned char S3M::AudioProperties::globalVolume() const
|
||||
{
|
||||
return d->globalVolume;
|
||||
}
|
||||
|
||||
uchar S3M::AudioProperties::masterVolume() const
|
||||
unsigned char S3M::AudioProperties::masterVolume() const
|
||||
{
|
||||
return d->masterVolume;
|
||||
}
|
||||
|
||||
uchar S3M::AudioProperties::tempo() const
|
||||
unsigned char S3M::AudioProperties::tempo() const
|
||||
{
|
||||
return d->tempo;
|
||||
}
|
||||
|
||||
uchar S3M::AudioProperties::bpmSpeed() const
|
||||
unsigned char S3M::AudioProperties::bpmSpeed() const
|
||||
{
|
||||
return d->bpmSpeed;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ uchar S3M::AudioProperties::bpmSpeed() const
|
||||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void S3M::AudioProperties::setLengthInPatterns(ushort lengthInPatterns)
|
||||
void S3M::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns)
|
||||
{
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
@@ -174,47 +174,47 @@ void S3M::AudioProperties::setStereo(bool stereo)
|
||||
d->stereo = stereo;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setSampleCount(ushort sampleCount)
|
||||
void S3M::AudioProperties::setSampleCount(unsigned short sampleCount)
|
||||
{
|
||||
d->sampleCount = sampleCount;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setPatternCount(ushort patternCount)
|
||||
void S3M::AudioProperties::setPatternCount(unsigned short patternCount)
|
||||
{
|
||||
d->patternCount = patternCount;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setFlags(ushort flags)
|
||||
void S3M::AudioProperties::setFlags(unsigned short flags)
|
||||
{
|
||||
d->flags = flags;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setTrackerVersion(ushort trackerVersion)
|
||||
void S3M::AudioProperties::setTrackerVersion(unsigned short trackerVersion)
|
||||
{
|
||||
d->trackerVersion = trackerVersion;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setFileFormatVersion(ushort fileFormatVersion)
|
||||
void S3M::AudioProperties::setFileFormatVersion(unsigned short fileFormatVersion)
|
||||
{
|
||||
d->fileFormatVersion = fileFormatVersion;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setGlobalVolume(uchar globalVolume)
|
||||
void S3M::AudioProperties::setGlobalVolume(unsigned char globalVolume)
|
||||
{
|
||||
d->globalVolume = globalVolume;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setMasterVolume(uchar masterVolume)
|
||||
void S3M::AudioProperties::setMasterVolume(unsigned char masterVolume)
|
||||
{
|
||||
d->masterVolume = masterVolume;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setTempo(uchar tempo)
|
||||
void S3M::AudioProperties::setTempo(unsigned char tempo)
|
||||
{
|
||||
d->tempo = tempo;
|
||||
}
|
||||
|
||||
void S3M::AudioProperties::setBpmSpeed(uchar bpmSpeed)
|
||||
void S3M::AudioProperties::setBpmSpeed(unsigned char bpmSpeed)
|
||||
{
|
||||
d->bpmSpeed = bpmSpeed;
|
||||
}
|
||||
|
||||
@@ -57,32 +57,32 @@ namespace TagLib {
|
||||
int sampleRate() const;
|
||||
int channels() const;
|
||||
|
||||
ushort lengthInPatterns() const;
|
||||
bool stereo() const;
|
||||
ushort sampleCount() const;
|
||||
ushort patternCount() const;
|
||||
ushort flags() const;
|
||||
ushort trackerVersion() const;
|
||||
ushort fileFormatVersion() const;
|
||||
uchar globalVolume() const;
|
||||
uchar masterVolume() const;
|
||||
uchar tempo() const;
|
||||
uchar bpmSpeed() const;
|
||||
unsigned short lengthInPatterns() const;
|
||||
bool stereo() const;
|
||||
unsigned short sampleCount() const;
|
||||
unsigned short patternCount() const;
|
||||
unsigned short flags() const;
|
||||
unsigned short trackerVersion() const;
|
||||
unsigned short fileFormatVersion() const;
|
||||
unsigned char globalVolume() const;
|
||||
unsigned char masterVolume() const;
|
||||
unsigned char tempo() const;
|
||||
unsigned char bpmSpeed() const;
|
||||
|
||||
private:
|
||||
void setChannels(int channels);
|
||||
|
||||
void setLengthInPatterns (ushort lengthInPatterns);
|
||||
void setLengthInPatterns (unsigned short lengthInPatterns);
|
||||
void setStereo (bool stereo);
|
||||
void setSampleCount (ushort sampleCount);
|
||||
void setPatternCount (ushort patternCount);
|
||||
void setFlags (ushort flags);
|
||||
void setTrackerVersion (ushort trackerVersion);
|
||||
void setFileFormatVersion(ushort fileFormatVersion);
|
||||
void setGlobalVolume (uchar globalVolume);
|
||||
void setMasterVolume (uchar masterVolume);
|
||||
void setTempo (uchar tempo);
|
||||
void setBpmSpeed (uchar bpmSpeed);
|
||||
void setSampleCount (unsigned short sampleCount);
|
||||
void setPatternCount (unsigned short patternCount);
|
||||
void setFlags (unsigned short flags);
|
||||
void setTrackerVersion (unsigned short trackerVersion);
|
||||
void setFileFormatVersion(unsigned short fileFormatVersion);
|
||||
void setGlobalVolume (unsigned char globalVolume);
|
||||
void setMasterVolume (unsigned char masterVolume);
|
||||
void setTempo (unsigned char tempo);
|
||||
void setBpmSpeed (unsigned char bpmSpeed);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
|
||||
@@ -110,13 +110,13 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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;
|
||||
|
||||
/*!
|
||||
* Returns a list of pictures available; if there is no picture, the list
|
||||
@@ -160,12 +160,12 @@ namespace TagLib {
|
||||
/*!
|
||||
* 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;
|
||||
|
||||
/*!
|
||||
* Sets the list of pictures
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user