diff options
author | Mathias Panzenböck <grosser.meister.morti@gmx.net> | 2011-06-24 01:11:10 +0200 |
---|---|---|
committer | Mathias Panzenböck <grosser.meister.morti@gmx.net> | 2011-06-24 01:11:10 +0200 |
commit | 9c27c45eb83453d8529bc139ed70647d6fffa624 (patch) | |
tree | c87864f04a63b495194e55c0a444da6cced536be /taglib/xm | |
parent | e71806b6dff3ce8ad6b6e09417793042bd170cab (diff) |
IT: strings require term. NUL. mod files: tableLength -> lengthInPatterns
Also added enums for S3M/IT/XM flags.
Diffstat (limited to 'taglib/xm')
-rw-r--r-- | taglib/xm/xmfile.cpp | 34 | ||||
-rw-r--r-- | taglib/xm/xmproperties.cpp | 12 | ||||
-rw-r--r-- | taglib/xm/xmproperties.h | 25 |
3 files changed, 38 insertions, 33 deletions
diff --git a/taglib/xm/xmfile.cpp b/taglib/xm/xmfile.cpp index 7b07d116..1ea9e027 100644 --- a/taglib/xm/xmfile.cpp +++ b/taglib/xm/xmfile.cpp @@ -465,10 +465,10 @@ bool XM::File::save() { if(sampleHeaderSize > 4U) { - ulong length = 0; - if(!readU32L(length)) + ulong sampleLength = 0; + if(!readU32L(sampleLength)) return false; - offset += length; + offset += sampleLength; seek(std::min(sampleHeaderSize, 14UL), Current); if(sampleHeaderSize > 18U) @@ -523,7 +523,7 @@ void XM::File::read(bool) READ_U32L_AS(headerSize); READ_ASSERT(headerSize >= 4); - ushort tableLength = 0; + ushort length = 0; ushort restartPosition = 0; ushort channels = 0; ushort patternCount = 0; @@ -533,7 +533,7 @@ void XM::File::read(bool) ushort bpmSpeed = 0; StructReader header; - header.u16L(tableLength) + header.u16L(length) .u16L(restartPosition) .u16L(channels) .u16L(patternCount) @@ -547,7 +547,7 @@ void XM::File::read(bool) READ_ASSERT(count == size); - d->properties.setTableLength(tableLength); + d->properties.setLengthInPatterns(length); d->properties.setRestartPosition(restartPosition); d->properties.setChannels(channels); d->properties.setPatternCount(patternCount); @@ -609,18 +609,18 @@ void XM::File::read(bool) for(ushort j = 0; j < sampleCount; ++ j) { - ulong length = 0; - ulong loopStart = 0; - ulong loopLength = 0; - uchar volume = 0; - uchar finetune = 0; - uchar sampleType = 0; - uchar panning = 0; - uchar noteNumber = 0; - uchar compression = 0; + ulong sampleLength = 0; + ulong loopStart = 0; + ulong loopLength = 0; + uchar volume = 0; + uchar finetune = 0; + uchar sampleType = 0; + uchar panning = 0; + uchar noteNumber = 0; + uchar compression = 0; String sampleName; StructReader sample; - sample.u32L(length) + sample.u32L(sampleLength) .u32L(loopStart) .u32L(loopLength) .byte(volume) @@ -636,7 +636,7 @@ void XM::File::read(bool) // skip unhandeled header proportion: seek(sampleHeaderSize - count, Current); - offset += length; + offset += sampleLength; sampleNames.append(sampleName); } } diff --git a/taglib/xm/xmproperties.cpp b/taglib/xm/xmproperties.cpp index c6b2b7f3..e0b489ac 100644 --- a/taglib/xm/xmproperties.cpp +++ b/taglib/xm/xmproperties.cpp @@ -28,7 +28,7 @@ class XM::Properties::PropertiesPrivate { public: PropertiesPrivate() : - tableLength(0), + lengthInPatterns(0), channels(0), version(0), restartPosition(0), @@ -41,7 +41,7 @@ public: { } - ushort tableLength; + ushort lengthInPatterns; int channels; ushort version; ushort restartPosition; @@ -84,9 +84,9 @@ int XM::Properties::channels() const return d->channels; } -ushort XM::Properties::tableLength() const +ushort XM::Properties::lengthInPatterns() const { - return d->tableLength; + return d->lengthInPatterns; } ushort XM::Properties::version() const @@ -129,9 +129,9 @@ ushort XM::Properties::bpmSpeed() const return d->bpmSpeed; } -void XM::Properties::setTableLength(ushort tableLength) +void XM::Properties::setLengthInPatterns(ushort lengthInPatterns) { - d->tableLength = tableLength; + d->lengthInPatterns = lengthInPatterns; } void XM::Properties::setChannels(int channels) diff --git a/taglib/xm/xmproperties.h b/taglib/xm/xmproperties.h index fb8397aa..f1aba404 100644 --- a/taglib/xm/xmproperties.h +++ b/taglib/xm/xmproperties.h @@ -31,6 +31,11 @@ namespace TagLib { class Properties : public AudioProperties { friend class File; public: + /*! Flag bits. */ + enum { + F_AMIGA_FREQ = 1 + }; + Properties(AudioProperties::ReadStyle propertiesStyle); virtual ~Properties(); @@ -39,20 +44,20 @@ namespace TagLib { int sampleRate() const; int channels() const; - ushort tableLength() const; - ushort version() const; - ushort restartPosition() const; - ushort patternCount() const; - ushort instrumentCount() const; - uint sampleCount() const; - ushort flags() const; - ushort tempo() const; - ushort bpmSpeed() const; + ushort lengthInPatterns() const; + ushort version() const; + ushort restartPosition() const; + ushort patternCount() const; + ushort instrumentCount() const; + uint sampleCount() const; + ushort flags() const; + ushort tempo() const; + ushort bpmSpeed() const; protected: void setChannels(int channels); - void setTableLength(ushort tableLength); + void setLengthInPatterns(ushort lengthInPatterns); void setVersion(ushort version); void setRestartPosition(ushort restartPosition); void setPatternCount(ushort patternCount); |