aboutsummaryrefslogtreecommitdiffstats
path: root/taglib/mod/modfilebase.cpp
diff options
context:
space:
mode:
authorMathias Panzenböck <grosser.meister.morti@gmx.net>2011-06-23 05:41:23 +0200
committerMathias Panzenböck <grosser.meister.morti@gmx.net>2011-06-23 05:41:23 +0200
commit7236ef4d0f978ca950b569cb5d5913a3e7b05a38 (patch)
treeea58bd09e58ff5d81ff90c8287b7cc3bd8c0ee57 /taglib/mod/modfilebase.cpp
parente202c658f059236a54f29f5c418056ec994b6adf (diff)
S3M+IT: fix reading, IT: untested support for message writing
IT: reading was off starting with global volume because of wrong read size. S3M+IT: correctly read the number of used patterns. IT: fixed reading of message tag and implemented writing of message tag (not tested yet). I also added S3M+IT test files. TODO: Unit tests using them.
Diffstat (limited to 'taglib/mod/modfilebase.cpp')
-rw-r--r--taglib/mod/modfilebase.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/taglib/mod/modfilebase.cpp b/taglib/mod/modfilebase.cpp
index 66df3857..e074dac8 100644
--- a/taglib/mod/modfilebase.cpp
+++ b/taglib/mod/modfilebase.cpp
@@ -55,6 +55,32 @@ bool Mod::FileBase::readString(String &s, ulong size)
return true;
}
+void Mod::FileBase::writeByte(uchar byte)
+{
+ ByteVector data(1, byte);
+ writeBlock(data);
+}
+
+void Mod::FileBase::writeU16L(ushort number)
+{
+ writeBlock(ByteVector::fromShort(number, false));
+}
+
+void Mod::FileBase::writeU32L(ulong number)
+{
+ writeBlock(ByteVector::fromUInt(number, false));
+}
+
+void Mod::FileBase::writeU16B(ushort number)
+{
+ writeBlock(ByteVector::fromShort(number, true));
+}
+
+void Mod::FileBase::writeU32B(ulong number)
+{
+ writeBlock(ByteVector::fromUInt(number, true));
+}
+
bool Mod::FileBase::readByte(uchar &byte)
{
ByteVector data(readBlock(1));