mirror of
https://github.com/taglib/taglib.git
synced 2025-07-21 14:34:23 -04:00
IT: strings require term. NUL. mod files: tableLength -> lengthInPatterns
Also added enums for S3M/IT/XM flags.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user