This won't break the ABI compatibility.
namespace ASF
{
- inline ushort readWORD(File *file, bool *ok = 0)
+ inline unsigned short readWORD(File *file, bool *ok = 0)
{
const ByteVector v = file->readBlock(2);
if(v.size() != 2) {
seek(2, Current);
- ushort length = 0;
- ushort instrumentCount = 0;
- ushort sampleCount = 0;
+ unsigned short length = 0;
+ unsigned short instrumentCount = 0;
+ unsigned short sampleCount = 0;
if(!readU16L(length) || !readU16L(instrumentCount) || !readU16L(sampleCount))
return false;
// write comment as instrument and sample names:
StringList lines = d->tag.comment().split("\n");
- for(ushort i = 0; i < instrumentCount; ++ i) {
+ for(unsigned short i = 0; i < instrumentCount; ++ i) {
seek(192L + length + ((long)i << 2));
ulong instrumentOffset = 0;
if(!readU32L(instrumentOffset))
writeByte(0);
}
- for(ushort i = 0; i < sampleCount; ++ i) {
+ for(unsigned short i = 0; i < sampleCount; ++ i) {
seek(192L + length + ((long)instrumentCount << 2) + ((long)i << 2));
ulong sampleOffset = 0;
if(!readU32L(sampleOffset))
message.resize(7999);
message.append((char)0);
- ushort special = 0;
- ushort messageLength = 0;
+ unsigned short special = 0;
+ unsigned short messageLength = 0;
ulong messageOffset = 0;
seek(46);
d->properties.setChannels(channels);
// real length might be shorter because of skips and terminator
- ushort realLength = 0;
- for(ushort i = 0; i < length; ++ i) {
+ unsigned short realLength = 0;
+ for(unsigned short i = 0; i < length; ++ i) {
READ_BYTE_AS(order);
if(order == 255) break;
if(order != 254) ++ realLength;
// Currently I just discard anything after a nil, but
// e.g. VLC seems to interprete a nil as a space. I
// don't know what is the proper behaviour.
- for(ushort i = 0; i < instrumentCount; ++ i) {
+ for(unsigned short i = 0; i < instrumentCount; ++ i) {
seek(192L + length + ((long)i << 2));
READ_U32L_AS(instrumentOffset);
seek(instrumentOffset);
comment.append(instrumentName);
}
- for(ushort i = 0; i < sampleCount; ++ i) {
+ for(unsigned short i = 0; i < sampleCount; ++ i) {
seek(192L + length + ((long)instrumentCount << 2) + ((long)i << 2));
READ_U32L_AS(sampleOffset);
{
}
- int channels;
- ushort lengthInPatterns;
- ushort instrumentCount;
- ushort sampleCount;
- ushort patternCount;
- ushort version;
- ushort compatibleVersion;
- ushort flags;
- ushort special;
+ int channels;
+ unsigned short lengthInPatterns;
+ unsigned short instrumentCount;
+ unsigned short sampleCount;
+ unsigned short patternCount;
+ unsigned short version;
+ unsigned short compatibleVersion;
+ unsigned short flags;
+ unsigned short special;
unsigned char globalVolume;
unsigned char mixVolume;
unsigned char tempo;
return d->channels;
}
-TagLib::ushort IT::Properties::lengthInPatterns() const
+unsigned short IT::Properties::lengthInPatterns() const
{
return d->lengthInPatterns;
}
return d->flags & Stereo;
}
-TagLib::ushort IT::Properties::instrumentCount() const
+unsigned short IT::Properties::instrumentCount() const
{
return d->instrumentCount;
}
-TagLib::ushort IT::Properties::sampleCount() const
+unsigned short IT::Properties::sampleCount() const
{
return d->sampleCount;
}
-TagLib::ushort IT::Properties::patternCount() const
+unsigned short IT::Properties::patternCount() const
{
return d->patternCount;
}
-TagLib::ushort IT::Properties::version() const
+unsigned short IT::Properties::version() const
{
return d->version;
}
-TagLib::ushort IT::Properties::compatibleVersion() const
+unsigned short IT::Properties::compatibleVersion() const
{
return d->compatibleVersion;
}
-TagLib::ushort IT::Properties::flags() const
+unsigned short IT::Properties::flags() const
{
return d->flags;
}
-TagLib::ushort IT::Properties::special() const
+unsigned short IT::Properties::special() const
{
return d->special;
}
d->channels = channels;
}
-void IT::Properties::setLengthInPatterns(ushort lengthInPatterns)
+void IT::Properties::setLengthInPatterns(unsigned short lengthInPatterns)
{
d->lengthInPatterns = lengthInPatterns;
}
-void IT::Properties::setInstrumentCount(ushort instrumentCount)
+void IT::Properties::setInstrumentCount(unsigned short instrumentCount)
{
d->instrumentCount = instrumentCount;
}
-void IT::Properties::setSampleCount(ushort sampleCount)
+void IT::Properties::setSampleCount(unsigned short sampleCount)
{
d->sampleCount = sampleCount;
}
-void IT::Properties::setPatternCount(ushort patternCount)
+void IT::Properties::setPatternCount(unsigned short patternCount)
{
d->patternCount = patternCount;
}
-void IT::Properties::setFlags(ushort flags)
+void IT::Properties::setFlags(unsigned short flags)
{
d->flags = flags;
}
-void IT::Properties::setSpecial(ushort special)
+void IT::Properties::setSpecial(unsigned short special)
{
d->special = special;
}
-void IT::Properties::setCompatibleVersion(ushort compatibleVersion)
+void IT::Properties::setCompatibleVersion(unsigned short compatibleVersion)
{
d->compatibleVersion = compatibleVersion;
}
-void IT::Properties::setVersion(ushort version)
+void IT::Properties::setVersion(unsigned short version)
{
d->version = version;
}
int sampleRate() const;
int channels() const;
- ushort lengthInPatterns() const;
- bool stereo() const;
- ushort instrumentCount() const;
- ushort sampleCount() const;
- ushort patternCount() const;
- ushort version() const;
- ushort compatibleVersion() const;
- ushort flags() const;
- ushort special() const;
+ unsigned short lengthInPatterns() const;
+ bool stereo() const;
+ unsigned short instrumentCount() const;
+ unsigned short sampleCount() const;
+ unsigned short patternCount() const;
+ unsigned short version() const;
+ unsigned short compatibleVersion() const;
+ unsigned short flags() const;
+ unsigned short special() const;
unsigned char globalVolume() const;
unsigned char mixVolume() const;
unsigned char tempo() const;
unsigned char pitchWheelDepth() const;
void setChannels(int channels);
- void setLengthInPatterns(ushort lengthInPatterns);
- void setInstrumentCount(ushort instrumentCount);
- void setSampleCount (ushort sampleCount);
- void setPatternCount(ushort patternCount);
- void setVersion (ushort version);
- void setCompatibleVersion(ushort compatibleVersion);
- void setFlags (ushort flags);
- void setSpecial (ushort special);
+ void setLengthInPatterns(unsigned short lengthInPatterns);
+ void setInstrumentCount(unsigned short instrumentCount);
+ void setSampleCount (unsigned short sampleCount);
+ void setPatternCount(unsigned short patternCount);
+ void setVersion (unsigned short version);
+ void setCompatibleVersion(unsigned short compatibleVersion);
+ void setFlags (unsigned short flags);
+ void setSpecial (unsigned short special);
void setGlobalVolume(unsigned char globalVolume);
void setMixVolume (unsigned char mixVolume);
void setTempo (unsigned char tempo);
writeBlock(data);
}
-void Mod::FileBase::writeU16L(ushort number)
+void Mod::FileBase::writeU16L(unsigned short number)
{
writeBlock(ByteVector::fromShort(number, false));
}
writeBlock(ByteVector::fromUInt(number, false));
}
-void Mod::FileBase::writeU16B(ushort number)
+void Mod::FileBase::writeU16B(unsigned short number)
{
writeBlock(ByteVector::fromShort(number, true));
}
return true;
}
-bool Mod::FileBase::readU16L(ushort &number)
+bool Mod::FileBase::readU16L(unsigned short &number)
{
ByteVector data(readBlock(2));
if(data.size() < 2) return false;
return true;
}
-bool Mod::FileBase::readU16B(ushort &number)
+bool Mod::FileBase::readU16B(unsigned short &number)
{
ByteVector data(readBlock(2));
if(data.size() < 2) return false;
void writeString(const String &s, ulong size, char padding = 0);
void writeByte(unsigned char byte);
- void writeU16L(ushort number);
+ void writeU16L(unsigned short number);
void writeU32L(ulong number);
- void writeU16B(ushort number);
+ void writeU16B(unsigned short number);
void writeU32B(ulong number);
bool readString(String &s, ulong size);
bool readByte(unsigned char &byte);
- bool readU16L(ushort &number);
+ bool readU16L(unsigned short &number);
bool readU32L(ulong &number);
- bool readU16B(ushort &number);
+ bool readU16B(unsigned short &number);
bool readU32B(ulong &number);
};
}
#define READ_BYTE(setter) READ(setter,unsigned char,readByte)
-#define READ_U16L(setter) READ(setter,ushort,readU16L)
+#define READ_U16L(setter) READ(setter,unsigned short,readU16L)
#define READ_U32L(setter) READ(setter,ulong,readU32L)
-#define READ_U16B(setter) READ(setter,ushort,readU16B)
+#define READ_U16B(setter) READ(setter,unsigned short,readU16B)
#define READ_U32B(setter) READ(setter,ulong,readU32B)
#define READ_STRING(setter,size) \
READ_ASSERT(read(name));
#define READ_BYTE_AS(name) READ_AS(unsigned char,name,readByte)
-#define READ_U16L_AS(name) READ_AS(ushort,name,readU16L)
+#define READ_U16L_AS(name) READ_AS(unsigned short,name,readU16L)
#define READ_U32L_AS(name) READ_AS(ulong,name,readU32L)
-#define READ_U16B_AS(name) READ_AS(ushort,name,readU16B)
+#define READ_U16B_AS(name) READ_AS(unsigned short,name,readU16B)
#define READ_U32B_AS(name) READ_AS(ulong,name,readU32B)
#define READ_STRING_AS(name,size) \
break;
}
- const ushort flags = data.toUShort(pos, true);
+ const unsigned short flags = data.toUShort(pos, true);
pos += 2;
d->sampleRate = sftable[(flags >> 13) & 0x07];
*/
String::Type encWithEndianness = d->textEncoding;
if(d->textEncoding == String::UTF16) {
- ushort bom = data.toUShort(6, true);
+ unsigned short bom = data.toUShort(6, true);
if(bom == 0xfffe) {
encWithEndianness = String::UTF16LE;
} else if(bom == 0xfeff) {
String::Type enc = d->textEncoding;
// If a UTF16 string has no BOM, use the encoding found above.
if(enc == String::UTF16 && pos + 1 < end) {
- ushort bom = data.toUShort(pos, true);
+ unsigned short bom = data.toUShort(pos, true);
if(bom != 0xfffe && bom != 0xfeff) {
enc = encWithEndianness;
}
pos += 1;
// *Pre-skip* (16 bits, unsigned, little endian)
- const ushort preSkip = data.toUShort(pos, false);
+ const unsigned short preSkip = data.toUShort(pos, false);
pos += 2;
// *Input Sample Rate* (32 bits, unsigned, little endian)
seek(32);
- ushort length = 0;
- ushort sampleCount = 0;
+ unsigned short length = 0;
+ unsigned short sampleCount = 0;
if(!readU16L(length) || !readU16L(sampleCount))
return false;
StringList lines = d->tag.comment().split("\n");
// write comment as sample names:
- for(ushort i = 0; i < sampleCount; ++ i) {
+ for(unsigned short i = 0; i < sampleCount; ++ i) {
seek(96L + length + ((long)i << 1));
- ushort instrumentOffset = 0;
+ unsigned short instrumentOffset = 0;
if(!readU16L(instrumentOffset))
return false;
seek(((long)instrumentOffset << 4) + 48);
d->properties.setChannels(channels);
seek(96);
- ushort realLength = 0;
- for(ushort i = 0; i < length; ++ i) {
+ unsigned short realLength = 0;
+ for(unsigned short i = 0; i < length; ++ i) {
READ_BYTE_AS(order);
if(order == 255) break;
if(order != 254) ++ realLength;
// However, there I never found instruments (SCRI) but
// instead samples (SCRS).
StringList comment;
- for(ushort i = 0; i < sampleCount; ++ i) {
+ for(unsigned short i = 0; i < sampleCount; ++ i) {
seek(96L + length + ((long)i << 1));
READ_U16L_AS(sampleHeaderOffset);
{
}
- ushort lengthInPatterns;
- int channels;
- bool stereo;
- ushort sampleCount;
- ushort patternCount;
- ushort flags;
- ushort trackerVersion;
- ushort fileFormatVersion;
+ unsigned short lengthInPatterns;
+ int channels;
+ bool stereo;
+ unsigned short sampleCount;
+ unsigned short patternCount;
+ unsigned short flags;
+ unsigned short trackerVersion;
+ unsigned short fileFormatVersion;
unsigned char globalVolume;
unsigned char masterVolume;
unsigned char tempo;
return d->channels;
}
-TagLib::ushort S3M::Properties::lengthInPatterns() const
+unsigned short S3M::Properties::lengthInPatterns() const
{
return d->lengthInPatterns;
}
return d->stereo;
}
-TagLib::ushort S3M::Properties::sampleCount() const
+unsigned short S3M::Properties::sampleCount() const
{
return d->sampleCount;
}
-TagLib::ushort S3M::Properties::patternCount() const
+unsigned short S3M::Properties::patternCount() const
{
return d->patternCount;
}
-TagLib::ushort S3M::Properties::flags() const
+unsigned short S3M::Properties::flags() const
{
return d->flags;
}
-TagLib::ushort S3M::Properties::trackerVersion() const
+unsigned short S3M::Properties::trackerVersion() const
{
return d->trackerVersion;
}
-TagLib::ushort S3M::Properties::fileFormatVersion() const
+unsigned short S3M::Properties::fileFormatVersion() const
{
return d->fileFormatVersion;
}
return d->bpmSpeed;
}
-void S3M::Properties::setLengthInPatterns(ushort lengthInPatterns)
+void S3M::Properties::setLengthInPatterns(unsigned short lengthInPatterns)
{
d->lengthInPatterns = lengthInPatterns;
}
d->stereo = stereo;
}
-void S3M::Properties::setSampleCount(ushort sampleCount)
+void S3M::Properties::setSampleCount(unsigned short sampleCount)
{
d->sampleCount = sampleCount;
}
-void S3M::Properties::setPatternCount(ushort patternCount)
+void S3M::Properties::setPatternCount(unsigned short patternCount)
{
d->patternCount = patternCount;
}
-void S3M::Properties::setFlags(ushort flags)
+void S3M::Properties::setFlags(unsigned short flags)
{
d->flags = flags;
}
-void S3M::Properties::setTrackerVersion(ushort trackerVersion)
+void S3M::Properties::setTrackerVersion(unsigned short trackerVersion)
{
d->trackerVersion = trackerVersion;
}
-void S3M::Properties::setFileFormatVersion(ushort fileFormatVersion)
+void S3M::Properties::setFileFormatVersion(unsigned short fileFormatVersion)
{
d->fileFormatVersion = fileFormatVersion;
}
int sampleRate() const;
int channels() const;
- ushort lengthInPatterns() const;
- bool stereo() const;
- ushort sampleCount() const;
- ushort patternCount() const;
- ushort flags() const;
- ushort trackerVersion() const;
- ushort fileFormatVersion() const;
+ unsigned short lengthInPatterns() const;
+ bool stereo() const;
+ unsigned short sampleCount() const;
+ unsigned short patternCount() const;
+ unsigned short flags() const;
+ unsigned short trackerVersion() const;
+ unsigned short fileFormatVersion() const;
unsigned char globalVolume() const;
unsigned char masterVolume() const;
unsigned char tempo() const;
void setChannels(int channels);
- void setLengthInPatterns (ushort lengthInPatterns);
+ void setLengthInPatterns (unsigned short lengthInPatterns);
void setStereo (bool stereo);
- void setSampleCount (ushort sampleCount);
- void setPatternCount (ushort patternCount);
- void setFlags (ushort flags);
- void setTrackerVersion (ushort trackerVersion);
- void setFileFormatVersion(ushort fileFormatVersion);
+ void setSampleCount (unsigned short sampleCount);
+ void setPatternCount (unsigned short patternCount);
+ void setFlags (unsigned short flags);
+ void setTrackerVersion (unsigned short trackerVersion);
+ void setFileFormatVersion(unsigned short fileFormatVersion);
void setGlobalVolume (unsigned char globalVolume);
void setMasterVolume (unsigned char masterVolume);
void setTempo (unsigned char tempo);
ByteVector ByteVector::fromShort(short value, bool mostSignificantByteFirst)
{
- return fromNumber<ushort>(value, mostSignificantByteFirst);
+ return fromNumber<unsigned short>(value, mostSignificantByteFirst);
}
ByteVector ByteVector::fromLongLong(long long value, bool mostSignificantByteFirst)
if(length > 0) {
if(swap) {
for(size_t i = 0; i < length; ++i)
- data[i] = Utils::byteSwap(static_cast<TagLib::ushort>(s[i]));
+ data[i] = Utils::byteSwap(static_cast<unsigned short>(s[i]));
}
else {
::wmemcpy(&data[0], s, length);
}
// Uses memcpy instead of reinterpret_cast to avoid an alignment exception.
- TagLib::ushort bom;
+ unsigned short bom;
::memcpy(&bom, s, 2);
if(bom == 0xfeff)
data.resize(length / 2);
for(size_t i = 0; i < length / 2; ++i) {
- TagLib::ushort c;
+ unsigned short c;
::memcpy(&c, s, 2);
if(swap)
c = Utils::byteSwap(c);
/*!
* Reverses the order of bytes in an 16-bit integer.
*/
- inline ushort byteSwap(ushort x)
+ inline unsigned short byteSwap(unsigned short x)
{
#if defined(HAVE_BOOST_BYTESWAP)
using namespace TagLib;
using namespace XM;
using TagLib::uint;
-using TagLib::ushort;
using TagLib::ulong;
/*!
bool bigEndian;
};
-class U16Reader : public NumberReader<ushort>
+class U16Reader : public NumberReader<unsigned short>
{
public:
- U16Reader(ushort &value, bool bigEndian)
- : NumberReader<ushort>(value, bigEndian) {}
+ U16Reader(unsigned short &value, bool bigEndian)
+ : NumberReader<unsigned short>(value, bigEndian) {}
uint read(TagLib::File &file, uint limit)
{
* Read a unsigned 16 Bit integer into \a number. The byte order
* is controlled by \a bigEndian.
*/
- StructReader &u16(ushort &number, bool bigEndian)
+ StructReader &u16(unsigned short &number, bool bigEndian)
{
m_readers.append(new U16Reader(number, bigEndian));
return *this;
/*!
* Read a unsigned 16 Bit little endian integer into \a number.
*/
- StructReader &u16L(ushort &number)
+ StructReader &u16L(unsigned short &number)
{
return u16(number, false);
}
/*!
* Read a unsigned 16 Bit big endian integer into \a number.
*/
- StructReader &u16B(ushort &number)
+ StructReader &u16B(unsigned short &number)
{
return u16(number, true);
}
return false;
seek(70);
- ushort patternCount = 0;
- ushort instrumentCount = 0;
+ unsigned short patternCount = 0;
+ unsigned short instrumentCount = 0;
if(!readU16L(patternCount) || !readU16L(instrumentCount))
return false;
long pos = 60 + headerSize; // should be long long in taglib2.
// need to read patterns again in order to seek to the instruments:
- for(ushort i = 0; i < patternCount; ++ i) {
+ for(unsigned short i = 0; i < patternCount; ++ i) {
seek(pos);
ulong patternHeaderLength = 0;
if(!readU32L(patternHeaderLength) || patternHeaderLength < 4)
return false;
seek(pos + 7);
- ushort dataSize = 0;
+ unsigned short dataSize = 0;
if (!readU16L(dataSize))
return false;
const StringList lines = d->tag.comment().split("\n");
uint sampleNameIndex = instrumentCount;
- for(ushort i = 0; i < instrumentCount; ++ i) {
+ for(unsigned short i = 0; i < instrumentCount; ++ i) {
seek(pos);
ulong instrumentHeaderSize = 0;
if(!readU32L(instrumentHeaderSize) || instrumentHeaderSize < 4)
else
writeString(lines[i], len);
- ushort sampleCount = 0;
+ unsigned short sampleCount = 0;
if(instrumentHeaderSize >= 29U) {
seek(pos + 27);
if(!readU16L(sampleCount))
pos += instrumentHeaderSize;
- for(ushort j = 0; j < sampleCount; ++ j) {
+ for(unsigned short j = 0; j < sampleCount; ++ j) {
if(sampleHeaderSize > 4U) {
seek(pos);
ulong sampleLength = 0;
READ_U32L_AS(headerSize);
READ_ASSERT(headerSize >= 4);
- ushort length = 0;
- ushort restartPosition = 0;
- ushort channels = 0;
- ushort patternCount = 0;
- ushort instrumentCount = 0;
- ushort flags = 0;
- ushort tempo = 0;
- ushort bpmSpeed = 0;
+ unsigned short length = 0;
+ unsigned short restartPosition = 0;
+ unsigned short channels = 0;
+ unsigned short patternCount = 0;
+ unsigned short instrumentCount = 0;
+ unsigned short flags = 0;
+ unsigned short tempo = 0;
+ unsigned short bpmSpeed = 0;
StructReader header;
header.u16L(length)
seek(60 + headerSize);
// read patterns:
- for(ushort i = 0; i < patternCount; ++ i) {
+ for(unsigned short i = 0; i < patternCount; ++ i) {
READ_U32L_AS(patternHeaderLength);
READ_ASSERT(patternHeaderLength >= 4);
unsigned char packingType = 0;
- ushort rowCount = 0;
- ushort dataSize = 0;
+ unsigned short rowCount = 0;
+ unsigned short dataSize = 0;
StructReader pattern;
pattern.byte(packingType).u16L(rowCount).u16L(dataSize);
uint sumSampleCount = 0;
// read instruments:
- for(ushort i = 0; i < instrumentCount; ++ i) {
+ for(unsigned short i = 0; i < instrumentCount; ++ i) {
READ_U32L_AS(instrumentHeaderSize);
READ_ASSERT(instrumentHeaderSize >= 4);
String instrumentName;
unsigned char instrumentType = 0;
- ushort sampleCount = 0;
+ unsigned short sampleCount = 0;
StructReader instrument;
instrument.string(instrumentName, 22).byte(instrumentType).u16L(sampleCount);
// skip unhandeled header proportion:
seek(instrumentHeaderSize - count - 4, Current);
- for(ushort j = 0; j < sampleCount; ++ j) {
+ for(unsigned short j = 0; j < sampleCount; ++ j) {
ulong sampleLength = 0;
ulong loopStart = 0;
ulong loopLength = 0;
{
}
- ushort lengthInPatterns;
- int channels;
- ushort version;
- ushort restartPosition;
- ushort patternCount;
- ushort instrumentCount;
+ unsigned short lengthInPatterns;
+ int channels;
+ unsigned short version;
+ unsigned short restartPosition;
+ unsigned short patternCount;
+ unsigned short instrumentCount;
uint sampleCount;
- ushort flags;
- ushort tempo;
- ushort bpmSpeed;
+ unsigned short flags;
+ unsigned short tempo;
+ unsigned short bpmSpeed;
};
XM::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
return d->channels;
}
-TagLib::ushort XM::Properties::lengthInPatterns() const
+unsigned short XM::Properties::lengthInPatterns() const
{
return d->lengthInPatterns;
}
-TagLib::ushort XM::Properties::version() const
+unsigned short XM::Properties::version() const
{
return d->version;
}
-TagLib::ushort XM::Properties::restartPosition() const
+unsigned short XM::Properties::restartPosition() const
{
return d->restartPosition;
}
-TagLib::ushort XM::Properties::patternCount() const
+unsigned short XM::Properties::patternCount() const
{
return d->patternCount;
}
-TagLib::ushort XM::Properties::instrumentCount() const
+unsigned short XM::Properties::instrumentCount() const
{
return d->instrumentCount;
}
return d->sampleCount;
}
-TagLib::ushort XM::Properties::flags() const
+unsigned short XM::Properties::flags() const
{
return d->flags;
}
-TagLib::ushort XM::Properties::tempo() const
+unsigned short XM::Properties::tempo() const
{
return d->tempo;
}
-TagLib::ushort XM::Properties::bpmSpeed() const
+unsigned short XM::Properties::bpmSpeed() const
{
return d->bpmSpeed;
}
-void XM::Properties::setLengthInPatterns(ushort lengthInPatterns)
+void XM::Properties::setLengthInPatterns(unsigned short lengthInPatterns)
{
d->lengthInPatterns = lengthInPatterns;
}
d->channels = channels;
}
-void XM::Properties::setVersion(ushort version)
+void XM::Properties::setVersion(unsigned short version)
{
d->version = version;
}
-void XM::Properties::setRestartPosition(ushort restartPosition)
+void XM::Properties::setRestartPosition(unsigned short restartPosition)
{
d->restartPosition = restartPosition;
}
-void XM::Properties::setPatternCount(ushort patternCount)
+void XM::Properties::setPatternCount(unsigned short patternCount)
{
d->patternCount = patternCount;
}
-void XM::Properties::setInstrumentCount(ushort instrumentCount)
+void XM::Properties::setInstrumentCount(unsigned short instrumentCount)
{
d->instrumentCount = instrumentCount;
}
d->sampleCount = sampleCount;
}
-void XM::Properties::setFlags(ushort flags)
+void XM::Properties::setFlags(unsigned short flags)
{
d->flags = flags;
}
-void XM::Properties::setTempo(ushort tempo)
+void XM::Properties::setTempo(unsigned short tempo)
{
d->tempo = tempo;
}
-void XM::Properties::setBpmSpeed(ushort bpmSpeed)
+void XM::Properties::setBpmSpeed(unsigned short bpmSpeed)
{
d->bpmSpeed = bpmSpeed;
}
int sampleRate() const;
int channels() const;
- ushort lengthInPatterns() const;
- ushort version() const;
- ushort restartPosition() const;
- ushort patternCount() const;
- ushort instrumentCount() const;
+ unsigned short lengthInPatterns() const;
+ unsigned short version() const;
+ unsigned short restartPosition() const;
+ unsigned short patternCount() const;
+ unsigned short instrumentCount() const;
uint sampleCount() const;
- ushort flags() const;
- ushort tempo() const;
- ushort bpmSpeed() const;
+ unsigned short flags() const;
+ unsigned short tempo() const;
+ unsigned short bpmSpeed() const;
void setChannels(int channels);
- void setLengthInPatterns(ushort lengthInPatterns);
- void setVersion(ushort version);
- void setRestartPosition(ushort restartPosition);
- void setPatternCount(ushort patternCount);
- void setInstrumentCount(ushort instrumentCount);
+ void setLengthInPatterns(unsigned short lengthInPatterns);
+ void setVersion(unsigned short version);
+ void setRestartPosition(unsigned short restartPosition);
+ void setPatternCount(unsigned short patternCount);
+ void setInstrumentCount(unsigned short instrumentCount);
void setSampleCount(uint sampleCount);
- void setFlags(ushort flags);
- void setTempo(ushort tempo);
- void setBpmSpeed(ushort bpmSpeed);
+ void setFlags(unsigned short flags);
+ void setTempo(unsigned short tempo);
+ void setBpmSpeed(unsigned short bpmSpeed);
private:
Properties(const Properties&);
CPPUNIT_ASSERT_EQUAL( 0, p->bitrate());
CPPUNIT_ASSERT_EQUAL( 0, p->sampleRate());
CPPUNIT_ASSERT_EQUAL(64, p->channels());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->lengthInPatterns());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->lengthInPatterns());
CPPUNIT_ASSERT_EQUAL(true, p->stereo());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->instrumentCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 5, p->sampleCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->patternCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)535, p->version());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)532, p->compatibleVersion());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 9, p->flags());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->instrumentCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 5, p->sampleCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)535, p->version());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)532, p->compatibleVersion());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 9, p->flags());
CPPUNIT_ASSERT_EQUAL((unsigned char)128, p->globalVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char) 48, p->mixVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char)125, p->tempo());
CPPUNIT_ASSERT_EQUAL( 0, p->bitrate());
CPPUNIT_ASSERT_EQUAL( 0, p->sampleRate());
CPPUNIT_ASSERT_EQUAL(16, p->channels());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->lengthInPatterns());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->lengthInPatterns());
CPPUNIT_ASSERT_EQUAL(false, p->stereo());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 5, p->sampleCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->patternCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->flags());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)4896, p->trackerVersion());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 2, p->fileFormatVersion());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 5, p->sampleCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->flags());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)4896, p->trackerVersion());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 2, p->fileFormatVersion());
CPPUNIT_ASSERT_EQUAL((unsigned char) 64, p->globalVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char) 48, p->masterVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char)125, p->tempo());
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
CPPUNIT_ASSERT_EQUAL(0, p->sampleRate());
CPPUNIT_ASSERT_EQUAL(8, p->channels());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->lengthInPatterns());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->version());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0 , p->restartPosition());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->patternCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->instrumentCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->flags());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 6, p->tempo());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)125, p->bpmSpeed());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->lengthInPatterns());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->version());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0 , p->restartPosition());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->instrumentCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->flags());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 6, p->tempo());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)125, p->bpmSpeed());
CPPUNIT_ASSERT_EQUAL(titleBefore, t->title());
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
CPPUNIT_ASSERT_EQUAL(String(), t->album());
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
CPPUNIT_ASSERT_EQUAL(0, p->sampleRate());
CPPUNIT_ASSERT_EQUAL(8, p->channels());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->lengthInPatterns());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)260, p->version());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->restartPosition());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->patternCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)128, p->instrumentCount());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 1, p->flags());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 6, p->tempo());
- CPPUNIT_ASSERT_EQUAL((TagLib::ushort)125, p->bpmSpeed());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->lengthInPatterns());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)260, p->version());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->restartPosition());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)128, p->instrumentCount());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->flags());
+ CPPUNIT_ASSERT_EQUAL((unsigned short) 6, p->tempo());
+ CPPUNIT_ASSERT_EQUAL((unsigned short)125, p->bpmSpeed());
CPPUNIT_ASSERT_EQUAL(title, t->title());
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
CPPUNIT_ASSERT_EQUAL(String(), t->album());