/*!
* Creates a TagLib file based on \a filename. TagLib will try to guess the file
* type.
- *
+ *
* \returns NULL if the file type cannot be determined or the file cannot
* be opened.
*/
d->value = value;
}
else
- d->text.append(value);
+ d->text.append(value);
}
APE::Item::Item(const Item &item)
case Text:
if(d->text.size()) {
StringList::ConstIterator it = d->text.begin();
-
+
result += it->data(String::UTF8).size();
it++;
for(; it != d->text.end(); ++it)
/*!
* Constructs an attribute with \a key and a BytesType \a value.
*/
- Attribute(const ByteVector &value);
+ Attribute(const ByteVector &value);
/*!
* Constructs an attribute with \a key and a Picture \a value.
// public members
////////////////////////////////////////////////////////////////////////////////
-ASF::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle)
+ASF::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle)
: TagLib::File(file)
{
d = new FilePrivate;
read(readProperties, propertiesStyle);
}
-ASF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle)
+ASF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle)
: TagLib::File(stream)
{
d = new FilePrivate;
ASF::Properties::~Properties()
{
if(d)
- delete d;
+ delete d;
}
int ASF::Properties::length() const
int ASF::Properties::channels() const
{
return d->channels;
-}
+}
bool ASF::Properties::isEncrypted() const
{
virtual void setComment(const String &s);
/*!
- * Sets the rating to \a s.
+ * Sets the rating to \a s.
*/
virtual void setRating(const String &s);
/*!
- * Sets the copyright to \a s.
+ * Sets the copyright to \a s.
*/
virtual void setCopyright(const String &s);
/*!
- * Sets the genre to \a s.
+ * Sets the genre to \a s.
*/
virtual void setGenre(const String &s);
/***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
-
+
copyright : (C) 2010 by Alex Novichkov
email : novichko@atnet.ru
(added APE file support)
* Returns a list of pictures attached to the FLAC file.
*/
List<Picture *> pictureList();
-
+
/*!
* Removes an attached picture. If \a del is true the picture's memory
* will be freed; if it is false, it must be deleted by the user.
using namespace TagLib;
-class FLAC::MetadataBlock::MetadataBlockPrivate
+class FLAC::MetadataBlock::MetadataBlockPrivate
{
public:
MetadataBlockPrivate() {}
using namespace TagLib;
-class FLAC::Picture::PicturePrivate
+class FLAC::Picture::PicturePrivate
{
public:
PicturePrivate() :
}
d->data = data.mid(pos, dataLength);
- return true;
+ return true;
}
ByteVector FLAC::Picture::render() const
using namespace TagLib;
-class FLAC::UnknownMetadataBlock::UnknownMetadataBlockPrivate
+class FLAC::UnknownMetadataBlock::UnknownMetadataBlockPrivate
{
public:
UnknownMetadataBlockPrivate() : code(0) {}
ulong sampleOffset = 0;
if(!readU32L(sampleOffset))
return false;
-
+
seek(sampleOffset + 20);
if((i + instrumentCount) < lines.size())
READ_U16L_AS(length);
READ_U16L_AS(instrumentCount);
READ_U16L_AS(sampleCount);
-
+
d->properties.setInstrumentCount(instrumentCount);
d->properties.setSampleCount(sampleCount);
READ_U16L(d->properties.setPatternCount);
++channels;
}
d->properties.setChannels(channels);
-
+
// real length might be shorter because of skips and terminator
ushort realLength = 0;
for(ushort i = 0; i < length; ++ i) {
READ_STRING_AS(instrumentName, 26);
comment.append(instrumentName);
}
-
+
for(ushort i = 0; i < sampleCount; ++ i) {
seek(192L + length + ((long)instrumentCount << 2) + ((long)i << 2));
READ_U32L_AS(sampleOffset);
-
+
seek(sampleOffset);
ByteVector sampleMagic = readBlock(4);
READ_BYTE_AS(vibratoRate);
READ_BYTE_AS(vibratoType);
*/
-
+
comment.append(sampleName);
}
Properties(AudioProperties::ReadStyle propertiesStyle);
virtual ~Properties();
-
+
int length() const;
int bitrate() const;
int sampleRate() const;
lengthInPatterns(0)
{
}
-
+
int channels;
uint instrumentCount;
uchar lengthInPatterns;
public:
Properties(AudioProperties::ReadStyle propertiesStyle);
virtual ~Properties();
-
+
int length() const;
int bitrate() const;
int sampleRate() const;
/*!
* Sets the tracker name to \a trackerName. If \a trackerName is
* String::null then this value will be cleared.
- *
+ *
* Note that only XM files support this tag. Setting the
* tracker name for other module file formats will be ignored.
- *
+ *
* The length of this tag is limited to 20 characters (1 character
* = 1 byte).
*/
}
// Owner identifier is assumed to be Latin1
-
+
const int byteAlign = 1;
const int endOfOwner = data.find(textDelimiter(String::Latin1), 0, byteAlign);
return;
- // pages in the pageGroup and packets must be equivalent
- // (originalSize and size of packets would not work together),
+ // pages in the pageGroup and packets must be equivalent
+ // (originalSize and size of packets would not work together),
// therefore we sometimes have to add pages to the group
List<int> pageGroup(thePageGroup);
while (!d->pages[pageGroup.back()]->header()->lastPacketCompleted()) {
if (pages.back()->header()->pageSequenceNumber() != pageGroup.back()) {
- // TODO: change the internal data structure so that we don't need to hold the
+ // TODO: change the internal data structure so that we don't need to hold the
// complete file in memory (is unavoidable at the moment)
// read the complete stream
flags = ContainsPacketFlags(flags | CompletePacket);
}
- // Or if there is more than one page and the page is
- // (a) the first page and it's complete or
- // (b) the last page and it's complete or
+ // Or if there is more than one page and the page is
+ // (a) the first page and it's complete or
+ // (b) the last page and it's complete or
// (c) a page in the middle.
else if(packetCount() > 1 &&
((flags & BeginsWithPacket && !d->header.firstPacketContinued()) ||
}
Page *p = new Page(packetList, streamSerialNumber, firstPage+pageIndex, continued,
- lastPacketInList ? lastPacketCompleted : true,
+ lastPacketInList ? lastPacketCompleted : true,
isVeryLastPacket);
pageIndex++;
*/
const PageHeader *header() const;
- /*!
+ /*!
* Returns a copy of the page with \a sequenceNumber set as sequence number.
- *
+ *
* \see header()
* \see PageHeader::setPageSequenceNumber()
*/
d->chunks[i].padding = 1;
offset++;
}
-
+
Chunk chunk;
chunk.name = name;
chunk.size = data.size();
}
seek(channels, Current);
-
+
StringList lines = d->tag.comment().split("\n");
// write comment as sample names:
for(ushort i = 0; i < sampleCount; ++ i) {
if(setting != 0xff) ++ channels;
}
d->properties.setChannels(channels);
-
+
seek(96);
ushort realLength = 0;
for(ushort i = 0; i < length; ++ i) {
bpmSpeed(0)
{
}
-
+
ushort lengthInPatterns;
int channels;
bool stereo;
Properties(AudioProperties::ReadStyle propertiesStyle);
virtual ~Properties();
-
+
int length() const;
int bitrate() const;
int sampleRate() const;
target += withSize;
offset += chunkSize + patternSize;
}
-
+
// replace private data:
if(d->deref())
delete d;
unsigned int samples = d->data.mid(12, 4).toUInt(false);
if(samples == ~0u) {
if(d->file && d->style != Fast) {
- samples = seekFinalIndex();
+ samples = seekFinalIndex();
}
else {
samples = 0;
bpmSpeed(0)
{
}
-
+
ushort lengthInPatterns;
int channels;
ushort version;
AudioProperties(propertiesStyle),
d(new PropertiesPrivate)
{
-}
+}
XM::Properties::~Properties()
{
Properties(AudioProperties::ReadStyle propertiesStyle);
virtual ~Properties();
-
+
int length() const;
int bitrate() const;
int sampleRate() const;
f = new ASF::File(newname.c_str());
ASF::AttributeList values2 = f->tag()->attributeListMap()["WM/Picture"];
CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), values2.size());
- ASF::Attribute attr2 = values2.front();
+ ASF::Attribute attr2 = values2.front();
ASF::Picture picture2 = attr2.toPicture();
CPPUNIT_ASSERT(picture2.isValid());
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), picture2.mimeType());
IT::Properties *p = file.audioProperties();
Mod::Tag *t = file.tag();
-
+
CPPUNIT_ASSERT(0 != p);
CPPUNIT_ASSERT(0 != t);
Mod::Properties *p = file.audioProperties();
Mod::Tag *t = file.tag();
-
+
CPPUNIT_ASSERT(0 != p);
CPPUNIT_ASSERT(0 != t);
S3M::Properties *p = file.audioProperties();
Mod::Tag *t = file.tag();
-
+
CPPUNIT_ASSERT(0 != p);
CPPUNIT_ASSERT(0 != t);
XM::Properties *p = file.audioProperties();
Mod::Tag *t = file.tag();
-
+
CPPUNIT_ASSERT(0 != p);
CPPUNIT_ASSERT(0 != t);
XM::Properties *p = file.audioProperties();
Mod::Tag *t = file.tag();
-
+
CPPUNIT_ASSERT(0 != p);
CPPUNIT_ASSERT(0 != t);
CPPUNIT_ASSERT_EQUAL(0U, t->track());
CPPUNIT_ASSERT_EQUAL(trackerName, t->trackerName());
}
-
+
void testWriteTags(const String &comment)
{
ScopedFileCopy copy("test", ".xm");