Format taglib sources

This commit is contained in:
Jonas Kvinge
2020-06-13 19:02:42 +02:00
parent 72bff7fa35
commit 4ce099294c
224 changed files with 12905 additions and 15623 deletions

View File

@@ -33,64 +33,52 @@
using namespace Strawberry_TagLib::TagLib;
using namespace Mod;
class Mod::File::FilePrivate
{
public:
class Mod::File::FilePrivate {
public:
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
: properties(propertiesStyle)
{
: properties(propertiesStyle) {
}
Mod::Tag tag;
Mod::Tag tag;
Mod::Properties properties;
};
Mod::File::File(FileName file, bool readProperties,
AudioProperties::ReadStyle propertiesStyle) :
Mod::FileBase(file),
d(new FilePrivate(propertiesStyle))
{
if(isOpen())
AudioProperties::ReadStyle propertiesStyle) : Mod::FileBase(file),
d(new FilePrivate(propertiesStyle)) {
if (isOpen())
read(readProperties);
}
Mod::File::File(IOStream *stream, bool readProperties,
AudioProperties::ReadStyle propertiesStyle) :
Mod::FileBase(stream),
d(new FilePrivate(propertiesStyle))
{
if(isOpen())
AudioProperties::ReadStyle propertiesStyle) : Mod::FileBase(stream),
d(new FilePrivate(propertiesStyle)) {
if (isOpen())
read(readProperties);
}
Mod::File::~File()
{
Mod::File::~File() {
delete d;
}
Mod::Tag *Mod::File::tag() const
{
Mod::Tag *Mod::File::tag() const {
return &d->tag;
}
Mod::Properties *Mod::File::audioProperties() const
{
Mod::Properties *Mod::File::audioProperties() const {
return &d->properties;
}
PropertyMap Mod::File::properties() const
{
PropertyMap Mod::File::properties() const {
return d->tag.properties();
}
PropertyMap Mod::File::setProperties(const PropertyMap &properties)
{
PropertyMap Mod::File::setProperties(const PropertyMap &properties) {
return d->tag.setProperties(properties);
}
bool Mod::File::save()
{
if(readOnly()) {
bool Mod::File::save() {
if (readOnly()) {
debug("Mod::File::save() - Cannot save to a read only file.");
return false;
}
@@ -98,50 +86,49 @@ bool Mod::File::save()
writeString(d->tag.title(), 20);
StringList lines = d->tag.comment().split("\n");
unsigned int n = std::min(lines.size(), d->properties.instrumentCount());
for(unsigned int i = 0; i < n; ++ i) {
for (unsigned int i = 0; i < n; ++i) {
writeString(lines[i], 22);
seek(8, Current);
}
for(unsigned int i = n; i < d->properties.instrumentCount(); ++ i) {
for (unsigned int i = n; i < d->properties.instrumentCount(); ++i) {
writeString(String(), 22);
seek(8, Current);
}
return true;
}
void Mod::File::read(bool)
{
if(!isOpen())
void Mod::File::read(bool) {
if (!isOpen())
return;
seek(1080);
ByteVector modId = readBlock(4);
READ_ASSERT(modId.size() == 4);
int channels = 4;
int channels = 4;
unsigned int instruments = 31;
if(modId == "M.K." || modId == "M!K!" || modId == "M&K!" || modId == "N.T.") {
if (modId == "M.K." || modId == "M!K!" || modId == "M&K!" || modId == "N.T.") {
d->tag.setTrackerName("ProTracker");
channels = 4;
}
else if(modId.startsWith("FLT") || modId.startsWith("TDZ")) {
else if (modId.startsWith("FLT") || modId.startsWith("TDZ")) {
d->tag.setTrackerName("StarTrekker");
char digit = modId[3];
READ_ASSERT(digit >= '0' && digit <= '9');
channels = digit - '0';
}
else if(modId.endsWith("CHN")) {
else if (modId.endsWith("CHN")) {
d->tag.setTrackerName("StarTrekker");
char digit = modId[0];
READ_ASSERT(digit >= '0' && digit <= '9');
channels = digit - '0';
}
else if(modId == "CD81" || modId == "OKTA") {
else if (modId == "CD81" || modId == "OKTA") {
d->tag.setTrackerName("Atari Oktalyzer");
channels = 8;
}
else if(modId.endsWith("CH") || modId.endsWith("CN")) {
else if (modId.endsWith("CH") || modId.endsWith("CN")) {
d->tag.setTrackerName("TakeTracker");
char digit = modId[0];
READ_ASSERT(digit >= '0' && digit <= '9');
@@ -153,8 +140,8 @@ void Mod::File::read(bool)
else {
// Not sure if this is correct. I'd need a file
// created with NoiseTracker to check this.
d->tag.setTrackerName("NoiseTracker"); // probably
channels = 4;
d->tag.setTrackerName("NoiseTracker"); // probably
channels = 4;
instruments = 15;
}
d->properties.setChannels(channels);
@@ -164,7 +151,7 @@ void Mod::File::read(bool)
READ_STRING(d->tag.setTitle, 20);
StringList comment;
for(unsigned int 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);
@@ -172,10 +159,10 @@ void Mod::File::read(bool)
READ_BYTE_AS(fineTuneByte);
int fineTune = fineTuneByte & 0xF;
// > 7 means negative value
if(fineTune > 7) fineTune -= 16;
if (fineTune > 7) fineTune -= 16;
READ_BYTE_AS(volume);
if(volume > 64) volume = 64;
if (volume > 64) volume = 64;
// volume in decibels: 20 * log10(volume / 64)
// value in words, * 2 (<< 1) for bytes:

View File

@@ -36,23 +36,22 @@
namespace Strawberry_TagLib {
namespace TagLib {
namespace Mod {
namespace Mod {
class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::Mod::FileBase
{
public:
/*!
class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::Mod::FileBase {
public:
/*!
* Constructs a Protracker file from \a file.
*
* \note In the current implementation, both \a readProperties and
* \a propertiesStyle are ignored. The audio properties are always
* read.
*/
File(FileName file, bool readProperties = true,
AudioProperties::ReadStyle propertiesStyle =
AudioProperties::Average);
File(FileName file, bool readProperties = true,
AudioProperties::ReadStyle propertiesStyle =
AudioProperties::Average);
/*!
/*!
* Constructs a Protracker file from \a stream.
*
* \note In the current implementation, both \a readProperties and
@@ -62,55 +61,55 @@ namespace TagLib {
* \note TagLib will *not* take ownership of the stream, the caller is
* responsible for deleting it after the File object.
*/
File(IOStream *stream, bool readProperties = true,
AudioProperties::ReadStyle propertiesStyle =
AudioProperties::Average);
File(IOStream *stream, bool readProperties = true,
AudioProperties::ReadStyle propertiesStyle =
AudioProperties::Average);
/*!
/*!
* Destroys this instance of the File.
*/
virtual ~File();
virtual ~File();
Mod::Tag *tag() const;
Mod::Tag *tag() const;
/*!
/*!
* Implements the unified property interface -- export function.
* Forwards to Mod::Tag::properties().
*/
PropertyMap properties() const;
PropertyMap properties() const;
/*!
/*!
* Implements the unified property interface -- import function.
* Forwards to Mod::Tag::setProperties().
*/
PropertyMap setProperties(const PropertyMap &);
/*!
PropertyMap setProperties(const PropertyMap &);
/*!
* Returns the Mod::Properties for this file. If no audio properties
* were read then this will return a null pointer.
*/
Mod::Properties *audioProperties() const;
Mod::Properties *audioProperties() const;
/*!
/*!
* Save the file.
* This is the same as calling save(AllTags);
*
* \note Saving Protracker tags is not supported.
*/
bool save();
bool save();
private:
File(const File &);
File &operator=(const File &);
private:
File(const File &);
File &operator=(const File &);
void read(bool readProperties);
void read(bool readProperties);
class FilePrivate;
FilePrivate *d;
};
class FilePrivate;
FilePrivate *d;
};
}
} // namespace Mod
}
}
} // namespace TagLib
} // namespace Strawberry_TagLib
#endif

View File

@@ -30,28 +30,23 @@
using namespace Strawberry_TagLib::TagLib;
using namespace Mod;
Mod::FileBase::FileBase(FileName file) : Strawberry_TagLib::TagLib::File(file)
{
Mod::FileBase::FileBase(FileName file) : Strawberry_TagLib::TagLib::File(file) {
}
Mod::FileBase::FileBase(IOStream *stream) : Strawberry_TagLib::TagLib::File(stream)
{
Mod::FileBase::FileBase(IOStream *stream) : Strawberry_TagLib::TagLib::File(stream) {
}
void Mod::FileBase::writeString(const String &s, unsigned long size, char padding)
{
void Mod::FileBase::writeString(const String &s, unsigned long size, char padding) {
ByteVector data(s.data(String::Latin1));
data.resize(size, padding);
writeBlock(data);
}
bool Mod::FileBase::readString(String &s, unsigned long size)
{
bool Mod::FileBase::readString(String &s, unsigned long size) {
ByteVector data(readBlock(size));
if(data.size() < size) return false;
int index = data.find((char) 0);
if(index > -1)
{
if (data.size() < size) return false;
int index = data.find((char)0);
if (index > -1) {
data.resize(index);
}
data.replace('\xff', ' ');
@@ -60,66 +55,58 @@ bool Mod::FileBase::readString(String &s, unsigned long size)
return true;
}
void Mod::FileBase::writeByte(unsigned char _byte)
{
void Mod::FileBase::writeByte(unsigned char _byte) {
ByteVector data(1, _byte);
writeBlock(data);
}
void Mod::FileBase::writeU16L(unsigned short number)
{
void Mod::FileBase::writeU16L(unsigned short number) {
writeBlock(ByteVector::fromShort(number, false));
}
void Mod::FileBase::writeU32L(unsigned long number)
{
void Mod::FileBase::writeU32L(unsigned long number) {
writeBlock(ByteVector::fromUInt(number, false));
}
void Mod::FileBase::writeU16B(unsigned short number)
{
void Mod::FileBase::writeU16B(unsigned short number) {
writeBlock(ByteVector::fromShort(number, true));
}
void Mod::FileBase::writeU32B(unsigned long number)
{
void Mod::FileBase::writeU32B(unsigned long number) {
writeBlock(ByteVector::fromUInt(number, true));
}
bool Mod::FileBase::readByte(unsigned char &_byte)
{
bool Mod::FileBase::readByte(unsigned char &_byte) {
ByteVector data(readBlock(1));
if(data.size() < 1) return false;
if (data.size() < 1) return false;
_byte = data[0];
return true;
}
bool Mod::FileBase::readU16L(unsigned short &number)
{
bool Mod::FileBase::readU16L(unsigned short &number) {
ByteVector data(readBlock(2));
if(data.size() < 2) return false;
if (data.size() < 2) return false;
number = data.toUShort(false);
return true;
}
bool Mod::FileBase::readU32L(unsigned long &number) {
ByteVector data(readBlock(4));
if(data.size() < 4) return false;
if (data.size() < 4) return false;
number = data.toUInt(false);
return true;
}
bool Mod::FileBase::readU16B(unsigned short &number)
{
bool Mod::FileBase::readU16B(unsigned short &number) {
ByteVector data(readBlock(2));
if(data.size() < 2) return false;
if (data.size() < 2) return false;
number = data.toUShort(true);
return true;
}
bool Mod::FileBase::readU32B(unsigned long &number) {
ByteVector data(readBlock(4));
if(data.size() < 4) return false;
if (data.size() < 4) return false;
number = data.toUInt(true);
return true;
}

View File

@@ -37,32 +37,31 @@
namespace Strawberry_TagLib {
namespace TagLib {
namespace Mod {
namespace Mod {
class TAGLIB_EXPORT FileBase : public Strawberry_TagLib::TagLib::File
{
protected:
FileBase(FileName file);
FileBase(IOStream *stream);
class TAGLIB_EXPORT FileBase : public Strawberry_TagLib::TagLib::File {
protected:
FileBase(FileName file);
FileBase(IOStream *stream);
void writeString(const String &s, unsigned long size, char padding = 0);
void writeByte(unsigned char byte);
void writeU16L(unsigned short number);
void writeU32L(unsigned long number);
void writeU16B(unsigned short number);
void writeU32B(unsigned long number);
void writeString(const String &s, unsigned long size, char padding = 0);
void writeByte(unsigned char byte);
void writeU16L(unsigned short number);
void writeU32L(unsigned long number);
void writeU16B(unsigned short number);
void writeU32B(unsigned long number);
bool readString(String &s, unsigned long size);
bool readByte(unsigned char &byte);
bool readU16L(unsigned short &number);
bool readU32L(unsigned long &number);
bool readU16B(unsigned short &number);
bool readU32B(unsigned long &number);
};
bool readString(String &s, unsigned long size);
bool readByte(unsigned char &byte);
bool readU16L(unsigned short &number);
bool readU32L(unsigned long &number);
bool readU16B(unsigned short &number);
bool readU32B(unsigned long &number);
};
}
} // namespace Mod
}
}
} // namespace TagLib
} // namespace Strawberry_TagLib
#endif

View File

@@ -24,44 +24,43 @@
// some helper-macros only used internally by (s3m|it|xm)file.cpp
#define READ_ASSERT(cond) \
if(!(cond)) \
{ \
setValid(false); \
return; \
if (!(cond)) { \
setValid(false); \
return; \
}
#define READ(setter,type,read) \
{ \
type number; \
READ_ASSERT(read(number)); \
setter(number); \
#define READ(setter, type, read) \
{ \
type number; \
READ_ASSERT(read(number)); \
setter(number); \
}
#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 long,readU32L)
#define READ_U16B(setter) READ(setter,unsigned short,readU16B)
#define READ_U32B(setter) READ(setter,unsigned long,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 long, readU32L)
#define READ_U16B(setter) READ(setter, unsigned short, readU16B)
#define READ_U32B(setter) READ(setter, unsigned long, readU32B)
#define READ_STRING(setter,size) \
{ \
String s; \
#define READ_STRING(setter, size) \
{ \
String s; \
READ_ASSERT(readString(s, size)); \
setter(s); \
setter(s); \
}
#define READ_AS(type,name,read) \
type name = 0; \
#define READ_AS(type, name, read) \
type name = 0; \
READ_ASSERT(read(name));
#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 long,name,readU32L)
#define READ_U16B_AS(name) READ_AS(unsigned short,name,readU16B)
#define READ_U32B_AS(name) READ_AS(unsigned long,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 long, name, readU32L)
#define READ_U16B_AS(name) READ_AS(unsigned short, name, readU16B)
#define READ_U32B_AS(name) READ_AS(unsigned long, name, readU32B)
#define READ_STRING_AS(name,size) \
String name; \
#define READ_STRING_AS(name, size) \
String name; \
READ_ASSERT(readString(name, size));
#endif

View File

@@ -29,83 +29,66 @@
using namespace Strawberry_TagLib::TagLib;
using namespace Mod;
class Mod::Properties::PropertiesPrivate
{
public:
PropertiesPrivate() :
channels(0),
instrumentCount(0),
lengthInPatterns(0)
{
class Mod::Properties::PropertiesPrivate {
public:
PropertiesPrivate() : channels(0),
instrumentCount(0),
lengthInPatterns(0) {
}
int channels;
unsigned int instrumentCount;
int channels;
unsigned int instrumentCount;
unsigned char lengthInPatterns;
};
Mod::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
AudioProperties(propertiesStyle),
d(new PropertiesPrivate())
{
Mod::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle),
d(new PropertiesPrivate()) {
}
Mod::Properties::~Properties()
{
Mod::Properties::~Properties() {
delete d;
}
int Mod::Properties::length() const
{
int Mod::Properties::length() const {
return 0;
}
int Mod::Properties::lengthInSeconds() const
{
int Mod::Properties::lengthInSeconds() const {
return 0;
}
int Mod::Properties::lengthInMilliseconds() const
{
int Mod::Properties::lengthInMilliseconds() const {
return 0;
}
int Mod::Properties::bitrate() const
{
int Mod::Properties::bitrate() const {
return 0;
}
int Mod::Properties::sampleRate() const
{
int Mod::Properties::sampleRate() const {
return 0;
}
int Mod::Properties::channels() const
{
int Mod::Properties::channels() const {
return d->channels;
}
unsigned int Mod::Properties::instrumentCount() const
{
unsigned int Mod::Properties::instrumentCount() const {
return d->instrumentCount;
}
unsigned char Mod::Properties::lengthInPatterns() const
{
unsigned char Mod::Properties::lengthInPatterns() const {
return d->lengthInPatterns;
}
void Mod::Properties::setChannels(int channels)
{
void Mod::Properties::setChannels(int channels) {
d->channels = channels;
}
void Mod::Properties::setInstrumentCount(unsigned int instrumentCount)
{
void Mod::Properties::setInstrumentCount(unsigned int instrumentCount) {
d->instrumentCount = instrumentCount;
}
void Mod::Properties::setLengthInPatterns(unsigned char lengthInPatterns)
{
void Mod::Properties::setLengthInPatterns(unsigned char lengthInPatterns) {
d->lengthInPatterns = lengthInPatterns;
}

View File

@@ -32,42 +32,41 @@
namespace Strawberry_TagLib {
namespace TagLib {
namespace Mod {
namespace Mod {
class TAGLIB_EXPORT Properties : public AudioProperties
{
public:
Properties(AudioProperties::ReadStyle propertiesStyle);
virtual ~Properties();
class TAGLIB_EXPORT Properties : public AudioProperties {
public:
Properties(AudioProperties::ReadStyle propertiesStyle);
virtual ~Properties();
int length() const;
int lengthInSeconds() const;
int lengthInMilliseconds() const;
int bitrate() const;
int sampleRate() const;
int channels() const;
int length() const;
int lengthInSeconds() const;
int lengthInMilliseconds() const;
int bitrate() const;
int sampleRate() const;
int channels() const;
unsigned int instrumentCount() const;
unsigned char lengthInPatterns() const;
unsigned int instrumentCount() const;
unsigned char lengthInPatterns() const;
void setChannels(int channels);
void setChannels(int channels);
void setInstrumentCount(unsigned int sampleCount);
void setLengthInPatterns(unsigned char lengthInPatterns);
void setInstrumentCount(unsigned int sampleCount);
void setLengthInPatterns(unsigned char lengthInPatterns);
private:
friend class File;
private:
friend class File;
Properties(const Properties&);
Properties &operator=(const Properties&);
Properties(const Properties &);
Properties &operator=(const Properties &);
class PropertiesPrivate;
PropertiesPrivate *d;
};
class PropertiesPrivate;
PropertiesPrivate *d;
};
}
} // namespace Mod
}
}
} // namespace TagLib
} // namespace Strawberry_TagLib
#endif

View File

@@ -31,11 +31,9 @@
using namespace Strawberry_TagLib::TagLib;
using namespace Mod;
class Mod::Tag::TagPrivate
{
public:
TagPrivate()
{
class Mod::Tag::TagPrivate {
public:
TagPrivate() {
}
String title;
@@ -43,132 +41,114 @@ public:
String trackerName;
};
Mod::Tag::Tag() :
Strawberry_TagLib::TagLib::Tag(),
d(new TagPrivate())
{
Mod::Tag::Tag() : Strawberry_TagLib::TagLib::Tag(),
d(new TagPrivate()) {
}
Mod::Tag::~Tag()
{
Mod::Tag::~Tag() {
delete d;
}
String Mod::Tag::title() const
{
String Mod::Tag::title() const {
return d->title;
}
String Mod::Tag::artist() const
{
String Mod::Tag::artist() const {
return String();
}
String Mod::Tag::album() const
{
String Mod::Tag::album() const {
return String();
}
String Mod::Tag::comment() const
{
String Mod::Tag::comment() const {
return d->comment;
}
String Mod::Tag::genre() const
{
String Mod::Tag::genre() const {
return String();
}
unsigned int Mod::Tag::year() const
{
unsigned int Mod::Tag::year() const {
return 0;
}
unsigned int Mod::Tag::track() const
{
unsigned int Mod::Tag::track() const {
return 0;
}
String Mod::Tag::trackerName() const
{
String Mod::Tag::trackerName() const {
return d->trackerName;
}
void Mod::Tag::setTitle(const String &title)
{
void Mod::Tag::setTitle(const String &title) {
d->title = title;
}
void Mod::Tag::setArtist(const String &)
{
void Mod::Tag::setArtist(const String &) {
}
void Mod::Tag::setAlbum(const String &)
{
void Mod::Tag::setAlbum(const String &) {
}
void Mod::Tag::setComment(const String &comment)
{
void Mod::Tag::setComment(const String &comment) {
d->comment = comment;
}
void Mod::Tag::setGenre(const String &)
{
void Mod::Tag::setGenre(const String &) {
}
void Mod::Tag::setYear(unsigned int)
{
void Mod::Tag::setYear(unsigned int) {
}
void Mod::Tag::setTrack(unsigned int)
{
void Mod::Tag::setTrack(unsigned int) {
}
void Mod::Tag::setTrackerName(const String &trackerName)
{
void Mod::Tag::setTrackerName(const String &trackerName) {
d->trackerName = trackerName;
}
PropertyMap Mod::Tag::properties() const
{
PropertyMap Mod::Tag::properties() const {
PropertyMap properties;
properties["TITLE"] = d->title;
properties["COMMENT"] = d->comment;
if(!(d->trackerName.isEmpty()))
if (!(d->trackerName.isEmpty()))
properties["TRACKERNAME"] = d->trackerName;
return properties;
}
PropertyMap Mod::Tag::setProperties(const PropertyMap &origProps)
{
PropertyMap Mod::Tag::setProperties(const PropertyMap &origProps) {
PropertyMap properties(origProps);
properties.removeEmpty();
StringList oneValueSet;
if(properties.contains("TITLE")) {
if (properties.contains("TITLE")) {
d->title = properties["TITLE"].front();
oneValueSet.append("TITLE");
} else
}
else
d->title.clear();
if(properties.contains("COMMENT")) {
if (properties.contains("COMMENT")) {
d->comment = properties["COMMENT"].front();
oneValueSet.append("COMMENT");
} else
}
else
d->comment.clear();
if(properties.contains("TRACKERNAME")) {
if (properties.contains("TRACKERNAME")) {
d->trackerName = properties["TRACKERNAME"].front();
oneValueSet.append("TRACKERNAME");
} else
}
else
d->trackerName.clear();
// for each tag that has been set above, remove the first entry in the corresponding
// value list. The others will be returned as unsupported by this format.
for(StringList::ConstIterator it = oneValueSet.begin(); it != oneValueSet.end(); ++it) {
if(properties[*it].size() == 1)
for (StringList::ConstIterator it = oneValueSet.begin(); it != oneValueSet.end(); ++it) {
if (properties[*it].size() == 1)
properties.erase(*it);
else
properties[*it].erase( properties[*it].begin() );
properties[*it].erase(properties[*it].begin());
}
return properties;
}

View File

@@ -31,9 +31,9 @@
namespace Strawberry_TagLib {
namespace TagLib {
namespace Mod {
namespace Mod {
/*!
/*!
* Tags for module files (Mod, S3M, IT, XM).
*
* Note that only the \a title is supported as such by most
@@ -45,60 +45,59 @@ namespace TagLib {
* but it is common practice to abuse instrument/sample/pattern
* names as multiline comments. TagLib does so as well.
*/
class TAGLIB_EXPORT Tag : public Strawberry_TagLib::TagLib::Tag
{
public:
Tag();
virtual ~Tag();
class TAGLIB_EXPORT Tag : public Strawberry_TagLib::TagLib::Tag {
public:
Tag();
virtual ~Tag();
/*!
/*!
* Returns the track name; if no track name is present in the tag
* String::null will be returned.
*/
virtual String title() const;
virtual String title() const;
/*!
/*!
* Not supported by module files. Therefore always returns String::null.
*/
virtual String artist() const;
virtual String artist() const;
/*!
/*!
* Not supported by module files. Therefore always returns String::null.
*/
virtual String album() const;
virtual String album() const;
/*!
/*!
* Returns the track comment derived from the instrument/sample/pattern
* names; if no comment is present in the tag String::null will be
* returned.
*/
virtual String comment() const;
virtual String comment() const;
/*!
/*!
* Not supported by module files. Therefore always returns String::null.
*/
virtual String genre() const;
virtual String genre() const;
/*!
/*!
* Not supported by module files. Therefore always returns 0.
*/
virtual unsigned int year() const;
virtual unsigned int year() const;
/*!
/*!
* Not supported by module files. Therefore always returns 0.
*/
virtual unsigned int track() const;
virtual unsigned int track() const;
/*!
/*!
* Returns the name of the tracker used to create/edit the module file.
* Only XM files store this tag to the file as such, for other formats
* (Mod, S3M, IT) this is derived from the file type or the flavour of
* the file type. Therefore only XM files might have an empty
* (String::null) tracker name.
*/
String trackerName() const;
String trackerName() const;
/*!
/*!
* Sets the title to \a title. If \a title is String::null then this
* value will be cleared.
*
@@ -106,19 +105,19 @@ namespace TagLib {
* Mod 20 characters, S3M 27 characters, IT 25 characters and XM 20
* characters.
*/
virtual void setTitle(const String &title);
virtual void setTitle(const String &title);
/*!
/*!
* Not supported by module files and therefore ignored.
*/
virtual void setArtist(const String &artist);
virtual void setArtist(const String &artist);
/*!
/*!
* Not supported by module files and therefore ignored.
*/
virtual void setAlbum(const String &album);
virtual void setAlbum(const String &album);
/*!
/*!
* Sets the comment to \a comment. If \a comment is String::null then
* this value will be cleared.
*
@@ -135,24 +134,24 @@ namespace TagLib {
* Mod 22 characters, S3M 27 characters, IT 25 characters and XM 22
* characters.
*/
virtual void setComment(const String &comment);
virtual void setComment(const String &comment);
/*!
/*!
* Not supported by module files and therefore ignored.
*/
virtual void setGenre(const String &genre);
virtual void setGenre(const String &genre);
/*!
/*!
* Not supported by module files and therefore ignored.
*/
virtual void setYear(unsigned int year);
virtual void setYear(unsigned int year);
/*!
/*!
* Not supported by module files and therefore ignored.
*/
virtual void setTrack(unsigned int track);
virtual void setTrack(unsigned int track);
/*!
/*!
* Sets the tracker name to \a trackerName. If \a trackerName is
* String::null then this value will be cleared.
*
@@ -162,15 +161,15 @@ namespace TagLib {
* The length of this tag is limited to 20 characters (1 character
* = 1 byte).
*/
void setTrackerName(const String &trackerName);
void setTrackerName(const String &trackerName);
/*!
/*!
* Implements the unified property interface -- export function.
* Since the module tag is very limited, the exported map is as well.
*/
PropertyMap properties() const;
PropertyMap properties() const;
/*!
/*!
* Implements the unified property interface -- import function.
* Because of the limitations of the module file tag, any tags besides
* COMMENT, TITLE and, if it is an XM file, TRACKERNAME, will be
@@ -178,19 +177,19 @@ namespace TagLib {
* all but the first will be contained in the returned map of unsupported
* properties.
*/
PropertyMap setProperties(const PropertyMap &);
PropertyMap setProperties(const PropertyMap &);
private:
Tag(const Tag &);
Tag &operator=(const Tag &);
private:
Tag(const Tag &);
Tag &operator=(const Tag &);
class TagPrivate;
TagPrivate *d;
};
class TagPrivate;
TagPrivate *d;
};
}
} // namespace Mod
}
}
} // namespace TagLib
} // namespace Strawberry_TagLib
#endif