mirror of
https://github.com/taglib/taglib.git
synced 2025-07-17 12:34:23 -04:00
XM: forgot smaple count
This commit is contained in:
@ -445,10 +445,10 @@ bool XM::File::save()
|
||||
else
|
||||
writeString(lines[i], len);
|
||||
|
||||
ushort sampleCount = 0;
|
||||
long offset = 0;
|
||||
if(instrumentHeaderSize >= 29U)
|
||||
{
|
||||
ushort sampleCount = 0;
|
||||
seek(1, Current);
|
||||
if(!readU16L(sampleCount))
|
||||
return false;
|
||||
@ -578,6 +578,7 @@ void XM::File::read(bool)
|
||||
|
||||
StringList intrumentNames;
|
||||
StringList sampleNames;
|
||||
uint sumSampleCount = 0;
|
||||
|
||||
// read instruments:
|
||||
for(ushort i = 0; i < instrumentCount; ++ i)
|
||||
@ -600,6 +601,7 @@ void XM::File::read(bool)
|
||||
long offset = 0;
|
||||
if(sampleCount > 0)
|
||||
{
|
||||
sumSampleCount += sampleCount;
|
||||
// wouldn't know which header size to assume otherwise:
|
||||
READ_ASSERT(instrumentHeaderSize >= count + 4 && readU32L(sampleHeaderSize));
|
||||
// skip unhandeled header proportion:
|
||||
@ -646,6 +648,7 @@ void XM::File::read(bool)
|
||||
seek(offset, Current);
|
||||
}
|
||||
|
||||
d->properties.setSampleCount(sumSampleCount);
|
||||
String comment(intrumentNames.toString("\n"));
|
||||
if(sampleNames.size() > 0)
|
||||
{
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
restartPosition(0),
|
||||
patternCount(0),
|
||||
instrumentCount(0),
|
||||
sampleCount(0),
|
||||
flags(0),
|
||||
tempo(0),
|
||||
bpmSpeed(0)
|
||||
@ -46,6 +47,7 @@ public:
|
||||
ushort restartPosition;
|
||||
ushort patternCount;
|
||||
ushort instrumentCount;
|
||||
uint sampleCount;
|
||||
ushort flags;
|
||||
ushort tempo;
|
||||
ushort bpmSpeed;
|
||||
@ -107,6 +109,11 @@ ushort XM::Properties::instrumentCount() const
|
||||
return d->instrumentCount;
|
||||
}
|
||||
|
||||
uint XM::Properties::sampleCount() const
|
||||
{
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
ushort XM::Properties::flags() const
|
||||
{
|
||||
return d->flags;
|
||||
@ -152,6 +159,11 @@ void XM::Properties::setInstrumentCount(ushort instrumentCount)
|
||||
d->instrumentCount = instrumentCount;
|
||||
}
|
||||
|
||||
void XM::Properties::setSampleCount(uint sampleCount)
|
||||
{
|
||||
d->sampleCount = sampleCount;
|
||||
}
|
||||
|
||||
void XM::Properties::setFlags(ushort flags)
|
||||
{
|
||||
d->flags = flags;
|
||||
|
@ -44,6 +44,7 @@ namespace TagLib {
|
||||
ushort restartPosition() const;
|
||||
ushort patternCount() const;
|
||||
ushort instrumentCount() const;
|
||||
uint sampleCount() const;
|
||||
ushort flags() const;
|
||||
ushort tempo() const;
|
||||
ushort bpmSpeed() const;
|
||||
@ -56,6 +57,7 @@ namespace TagLib {
|
||||
void setRestartPosition(ushort restartPosition);
|
||||
void setPatternCount(ushort patternCount);
|
||||
void setInstrumentCount(ushort instrumentCount);
|
||||
void setSampleCount(uint sampleCount);
|
||||
void setFlags(ushort flags);
|
||||
void setTempo(ushort tempo);
|
||||
void setBpmSpeed(ushort bpmSpeed);
|
||||
|
Reference in New Issue
Block a user