]> granicus.if.org Git - taglib/commitdiff
converted tabs to spaces
authorMathias Panzenböck <grosser.meister.morti@gmx.net>
Mon, 13 Jun 2011 23:09:55 +0000 (01:09 +0200)
committerMathias Panzenböck <grosser.meister.morti@gmx.net>
Mon, 13 Jun 2011 23:09:55 +0000 (01:09 +0200)
20 files changed:
.gitignore
taglib/it/itfile.cpp
taglib/it/itfile.h
taglib/it/itproperties.cpp
taglib/it/itproperties.h
taglib/mod/modfile.cpp
taglib/mod/modfile.h
taglib/mod/modfileprivate.h
taglib/mod/modtag.cpp
taglib/mod/modtag.h
taglib/s3m/s3mfile.cpp
taglib/s3m/s3mfile.h
taglib/s3m/s3mproperties.cpp
taglib/s3m/s3mproperties.h
taglib/xm/xmfile.cpp
taglib/xm/xmfile.h
taglib/xm/xmproperties.cpp
taglib/xm/xmproperties.h
taglib/xm/xmtag.cpp
taglib/xm/xmtag.h

index 3fda06b8184fc584ec62dc6e5a8b34c57f7bb564..5f49ed13991d226ebcdd69d5519693f490fef871 100644 (file)
@@ -9,6 +9,8 @@ CMakeFiles/
 *.sln
 *.suo
 *.user
+.*
+*~
 /CMakeCache.txt
 /Doxyfile
 /config.h
index dfe6e0afab6e93093ab26df62032a3e4da257676..0c07f433079d562845d1fd3ef5d90d1949737b32 100644 (file)
@@ -34,34 +34,34 @@ static const uchar AUTOVIB_IT_TO_XM[] = {0, 3, 1, 4, 2, 0, 0, 0};
 class IT::File::FilePrivate
 {
 public:
-       FilePrivate(AudioProperties::ReadStyle propertiesStyle)
-               : tag(), properties(propertiesStyle)
-       {
-       }
+  FilePrivate(AudioProperties::ReadStyle propertiesStyle)
+    : tag(), properties(propertiesStyle)
+  {
+  }
 
-       Mod::Tag       tag;
-       IT::Properties properties;
+  Mod::Tag       tag;
+  IT::Properties properties;
 };
 
 IT::File::File(FileName file, bool readProperties,
                AudioProperties::ReadStyle propertiesStyle) :
-               Mod::File(file),
-               d(new FilePrivate(propertiesStyle))
+    Mod::File(file),
+    d(new FilePrivate(propertiesStyle))
 {
-       read(readProperties);
+  read(readProperties);
 }
 
 IT::File::File(IOStream *stream, bool readProperties,
                AudioProperties::ReadStyle propertiesStyle) :
-               Mod::File(stream),
-               d(new FilePrivate(propertiesStyle))
+    Mod::File(stream),
+    d(new FilePrivate(propertiesStyle))
 {
-       read(readProperties);
+  read(readProperties);
 }
 
 IT::File::~File()
 {
-       delete d;
+  delete d;
 }
 
 Mod::Tag *IT::File::tag() const
@@ -76,110 +76,110 @@ IT::Properties *IT::File::audioProperties() const
 
 bool IT::File::save()
 {
-       seek(4);
-       writeString(d->tag.title(), 26);
-       // TODO: write comment as instrument and sample names
+  seek(4);
+  writeString(d->tag.title(), 26);
+  // TODO: write comment as instrument and sample names
     return true;
 }
 
 void IT::File::read(bool)
 {
-       if(!isOpen())
-               return;
-
-       seek(0);
-       READ_ASSERT(readBlock(4) == "IMPM");
-       READ_STRING(d->tag.setTitle, 26);
-
-       seek(2, Current);
-
-       READ_U16L_AS(length);
-       READ_U16L_AS(instrumentCount);
-       READ_U16L_AS(sampleCount);
-               
-       d->properties.setSampleLength(length);
-       d->properties.setInstrumentCount(instrumentCount);
-       d->properties.setSampleCount(sampleCount);
-       READ_U16L(d->properties.setPatternCount);
-       READ_U16L(d->properties.setVersion);
-       READ_U16L(d->properties.setCmwt);
-       READ_U16L(d->properties.setFlags);
-
-       READ_U16L_AS(special);
-
-       d->properties.setSpecial(special);
-       READ_U16L(d->properties.setBaseVolume);
-
-       seek(1, Current);
-
-       READ_BYTE(d->properties.setTempo);
-       READ_BYTE(d->properties.setBpmSpeed);
-
-       StringList comment;
-
-       for(ushort i = 0; i < instrumentCount; ++ i)
-       {
-               seek(192 + length + (i << 2));
-               READ_U32L_AS(instrumentOffset);
-               seek(instrumentOffset);
-
-               ByteVector instrumentMagic = readBlock(4);
-               // TODO: find out if it can really be both here and not just IMPI
-               READ_ASSERT(instrumentMagic == "IMPS" || instrumentMagic == "IMPI");
-
-               READ_STRING_AS(dosFileName, 13);
-
-               seek(15, Current);
-
-               READ_STRING_AS(instrumentName, 26);
-               comment.append(instrumentName);
-       }
-               
-       for(ushort i = 0; i < sampleCount; ++ i)
-       {
-               seek(192 + length + (instrumentCount << 2) + (i << 2));
-               READ_U32L_AS(sampleOffset);
-               
-               seek(sampleOffset);
-
-               ByteVector sampleMagic = readBlock(4);
-               // TODO: find out if it can really be both here and not just IMPS
-               READ_ASSERT(sampleMagic == "IMPS" || sampleMagic == "IMPI");
-
-               READ_STRING_AS(dosFileName, 13);
-               READ_BYTE_AS(globalVolume);
-               READ_BYTE_AS(sampleFlags);
-               READ_BYTE_AS(sampleValume);
-               READ_STRING_AS(sampleName, 26);
-               READ_BYTE_AS(sampleCvt);
-               READ_BYTE_AS(samplePanning);
-               READ_U32L_AS(sampleLength);
-               READ_U32L_AS(repeatStart);
-               READ_U32L_AS(repeatStop);
-               READ_U32L_AS(c4speed);
-               READ_U32L_AS(sustainLoopStart);
-               READ_U32L_AS(sustainLoopEnd);
-               READ_U32L_AS(sampleDataOffset);
-               READ_BYTE_AS(vibratoRate);
-               READ_BYTE_AS(vibratoDepth);
-               READ_BYTE_AS(vibratoSweep);
-               READ_BYTE_AS(vibratoType);
-
-               if(c4speed == 0)
-               {
-                       c4speed = 8363;
-               }
-               else if(c4speed < 256)
-               {
-                       c4speed = 256;
-               }
-                       
-               vibratoDepth = vibratoDepth & 0x7F;
-               vibratoSweep = (vibratoSweep + 3) >> 2;
-               vibratoType  = AUTOVIB_IT_TO_XM[vibratoType & 0x07];
-
-               comment.append(sampleName);
-       }
-
-       d->tag.setComment(comment.toString("\n"));
+  if(!isOpen())
+    return;
+
+  seek(0);
+  READ_ASSERT(readBlock(4) == "IMPM");
+  READ_STRING(d->tag.setTitle, 26);
+
+  seek(2, Current);
+
+  READ_U16L_AS(length);
+  READ_U16L_AS(instrumentCount);
+  READ_U16L_AS(sampleCount);
+    
+  d->properties.setSampleLength(length);
+  d->properties.setInstrumentCount(instrumentCount);
+  d->properties.setSampleCount(sampleCount);
+  READ_U16L(d->properties.setPatternCount);
+  READ_U16L(d->properties.setVersion);
+  READ_U16L(d->properties.setCmwt);
+  READ_U16L(d->properties.setFlags);
+
+  READ_U16L_AS(special);
+
+  d->properties.setSpecial(special);
+  READ_U16L(d->properties.setBaseVolume);
+
+  seek(1, Current);
+
+  READ_BYTE(d->properties.setTempo);
+  READ_BYTE(d->properties.setBpmSpeed);
+
+  StringList comment;
+
+  for(ushort i = 0; i < instrumentCount; ++ i)
+  {
+    seek(192 + length + (i << 2));
+    READ_U32L_AS(instrumentOffset);
+    seek(instrumentOffset);
+
+    ByteVector instrumentMagic = readBlock(4);
+    // TODO: find out if it can really be both here and not just IMPI
+    READ_ASSERT(instrumentMagic == "IMPS" || instrumentMagic == "IMPI");
+
+    READ_STRING_AS(dosFileName, 13);
+
+    seek(15, Current);
+
+    READ_STRING_AS(instrumentName, 26);
+    comment.append(instrumentName);
+  }
+    
+  for(ushort i = 0; i < sampleCount; ++ i)
+  {
+    seek(192 + length + (instrumentCount << 2) + (i << 2));
+    READ_U32L_AS(sampleOffset);
+    
+    seek(sampleOffset);
+
+    ByteVector sampleMagic = readBlock(4);
+    // TODO: find out if it can really be both here and not just IMPS
+    READ_ASSERT(sampleMagic == "IMPS" || sampleMagic == "IMPI");
+
+    READ_STRING_AS(dosFileName, 13);
+    READ_BYTE_AS(globalVolume);
+    READ_BYTE_AS(sampleFlags);
+    READ_BYTE_AS(sampleValume);
+    READ_STRING_AS(sampleName, 26);
+    READ_BYTE_AS(sampleCvt);
+    READ_BYTE_AS(samplePanning);
+    READ_U32L_AS(sampleLength);
+    READ_U32L_AS(repeatStart);
+    READ_U32L_AS(repeatStop);
+    READ_U32L_AS(c4speed);
+    READ_U32L_AS(sustainLoopStart);
+    READ_U32L_AS(sustainLoopEnd);
+    READ_U32L_AS(sampleDataOffset);
+    READ_BYTE_AS(vibratoRate);
+    READ_BYTE_AS(vibratoDepth);
+    READ_BYTE_AS(vibratoSweep);
+    READ_BYTE_AS(vibratoType);
+
+    if(c4speed == 0)
+    {
+      c4speed = 8363;
+    }
+    else if(c4speed < 256)
+    {
+      c4speed = 256;
+    }
+      
+    vibratoDepth = vibratoDepth & 0x7F;
+    vibratoSweep = (vibratoSweep + 3) >> 2;
+    vibratoType  = AUTOVIB_IT_TO_XM[vibratoType & 0x07];
+
+    comment.append(sampleName);
+  }
+
+  d->tag.setComment(comment.toString("\n"));
 }
index bc6ac3ef0811a9ddf4325a998d8dd117b6c6f68f..3a50b0629845d44af94c7c95aaf18b861047260a 100644 (file)
 
 namespace TagLib {
 
-       namespace IT {
-
-               class TAGLIB_EXPORT File : public Mod::File {
-                       public:
-                               /*!
-                                * Contructs a Impulse Tracker file from \a file. If \a readProperties
-                                * is true the file's audio properties will also be read using
-                                * \a propertiesStyle. If false, \a propertiesStyle is ignored.
-                                */
-                               File(FileName file, bool readProperties = true,
-                                    AudioProperties::ReadStyle propertiesStyle =
-                                    AudioProperties::Average);
-
-                               /*!
-                                * Contructs a Impulse Tracker file from \a stream. If \a readProperties
-                                * is true the file's audio properties will also be read using
-                                * \a propertiesStyle. If false, \a propertiesStyle is ignored.
-                                */
-                               File(IOStream *stram, bool readProperties = true,
-                                    AudioProperties::ReadStyle propertiesStyle =
-                                    AudioProperties::Average);
-
-                               /*!
-                                * Destroys this instance of the File.
-                                */
-                               virtual ~File();
-
-                               Mod::Tag *tag() const;
-
-                               /*!
-                                * Returns the IT::Properties for this file. If no audio properties
-                                * were read then this will return a null pointer.
-                                */
-                               IT::Properties *audioProperties() const;
-
-                               /*!
-                                * Save the file.
-                                * This is the same as calling save(AllTags);
-                                *
-                                * \note Saving Impulse Tracker tags is not supported.
-                                */
-                               bool save();
-
-                       private:
-                               File(const File &);
-                               File &operator=(const File &);
-
-                               void read(bool readProperties);
-
-                               class FilePrivate;
-                               FilePrivate *d;
-               };
-       }
+  namespace IT {
+
+    class TAGLIB_EXPORT File : public Mod::File {
+      public:
+        /*!
+         * Contructs a Impulse Tracker file from \a file. If \a readProperties
+         * is true the file's audio properties will also be read using
+         * \a propertiesStyle. If false, \a propertiesStyle is ignored.
+         */
+        File(FileName file, bool readProperties = true,
+             AudioProperties::ReadStyle propertiesStyle =
+             AudioProperties::Average);
+
+        /*!
+         * Contructs a Impulse Tracker file from \a stream. If \a readProperties
+         * is true the file's audio properties will also be read using
+         * \a propertiesStyle. If false, \a propertiesStyle is ignored.
+         */
+        File(IOStream *stram, bool readProperties = true,
+             AudioProperties::ReadStyle propertiesStyle =
+             AudioProperties::Average);
+
+        /*!
+         * Destroys this instance of the File.
+         */
+        virtual ~File();
+
+        Mod::Tag *tag() const;
+
+        /*!
+         * Returns the IT::Properties for this file. If no audio properties
+         * were read then this will return a null pointer.
+         */
+        IT::Properties *audioProperties() const;
+
+        /*!
+         * Save the file.
+         * This is the same as calling save(AllTags);
+         *
+         * \note Saving Impulse Tracker tags is not supported.
+         */
+        bool save();
+
+      private:
+        File(const File &);
+        File &operator=(const File &);
+
+        void read(bool readProperties);
+
+        class FilePrivate;
+        FilePrivate *d;
+    };
+  }
 }
 
 #endif
index 8cf04fd7ec34dc58b9dc9ddff0c5bfe163024b1d..61f9758c23d032c4b1d572bbd3fc104d613c53a0 100644 (file)
@@ -27,182 +27,182 @@ using namespace IT;
 class IT::Properties::PropertiesPrivate
 {
 public:
-       PropertiesPrivate() :
-               sampleLength(0),
-               stereo(false),
-               instrumentCount(0),
-               sampleCount(0),
-               patternCount(0),
-               version(0),
-               cmwt(0),
-               flags(0),
-               special(0),
-               baseVolume(0),
-               tempo(0),
-               bpmSpeed(0)
-       {
-       }
-
-       ushort sampleLength;
-       bool   stereo;
-       ushort instrumentCount;
-       ushort sampleCount;
-       ushort patternCount;
-       ushort version;
-       ushort cmwt;
-       ushort flags;
-       ushort special;
-       int    baseVolume;
-       uchar  tempo;
-       uchar  bpmSpeed;
+  PropertiesPrivate() :
+    sampleLength(0),
+    stereo(false),
+    instrumentCount(0),
+    sampleCount(0),
+    patternCount(0),
+    version(0),
+    cmwt(0),
+    flags(0),
+    special(0),
+    baseVolume(0),
+    tempo(0),
+    bpmSpeed(0)
+  {
+  }
+
+  ushort sampleLength;
+  bool   stereo;
+  ushort instrumentCount;
+  ushort sampleCount;
+  ushort patternCount;
+  ushort version;
+  ushort cmwt;
+  ushort flags;
+  ushort special;
+  int    baseVolume;
+  uchar  tempo;
+  uchar  bpmSpeed;
 };
 
 IT::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
-       AudioProperties(propertiesStyle),
-       d(new PropertiesPrivate)
+  AudioProperties(propertiesStyle),
+  d(new PropertiesPrivate)
 {
 }
 
 IT::Properties::~Properties()
 {
-       delete d;
+  delete d;
 }
 
 int IT::Properties::length() const
 {
-       return 0;
+  return 0;
 }
 
 int IT::Properties::bitrate() const
 {
-       return 0;
+  return 0;
 }
 
 int IT::Properties::sampleRate() const
 {
-       return 0;
+  return 0;
 }
 
 int IT::Properties::channels() const
 {
-       return d->stereo ? 2 : 1;
+  return d->stereo ? 2 : 1;
 }
 
 ushort IT::Properties::sampleLength() const
 {
-       return d->sampleLength;
+  return d->sampleLength;
 }
 
 bool IT::Properties::stereo() const
 {
-       return d->stereo;
+  return d->stereo;
 }
 
 ushort IT::Properties::instrumentCount() const
 {
-       return d->instrumentCount;
+  return d->instrumentCount;
 }
 
 ushort IT::Properties::sampleCount() const
 {
-       return d->sampleCount;
+  return d->sampleCount;
 }
 
 ushort IT::Properties::patternCount() const
 {
-       return d->patternCount;
+  return d->patternCount;
 }
 
 ushort IT::Properties::version() const
 {
-       return d->version;
+  return d->version;
 }
 
 ushort IT::Properties::cmwt() const
 {
-       return d->cmwt;
+  return d->cmwt;
 }
 
 ushort IT::Properties::flags() const
 {
-       return d->flags;
+  return d->flags;
 }
 
 ushort IT::Properties::special() const
 {
-       return d->special;
+  return d->special;
 }
 
 int IT::Properties::baseVolume() const
 {
-       return d->baseVolume;
+  return d->baseVolume;
 }
 
 uchar IT::Properties::tempo() const
 {
-       return d->tempo;
+  return d->tempo;
 }
 
 uchar IT::Properties::bpmSpeed() const
 {
-       return d->bpmSpeed;
+  return d->bpmSpeed;
 }
 
 void IT::Properties::setSampleLength(ushort sampleLength)
 {
-       d->sampleLength = sampleLength;
+  d->sampleLength = sampleLength;
 }
 
 void IT::Properties::setStereo(bool stereo)
 {
-       d->stereo = stereo;
+  d->stereo = stereo;
 }
 
 void IT::Properties::setInstrumentCount(ushort instrumentCount) {
-       d->instrumentCount = instrumentCount;
+  d->instrumentCount = instrumentCount;
 }
 
 void IT::Properties::setSampleCount(ushort sampleCount)
 {
-       d->sampleCount = sampleCount;
+  d->sampleCount = sampleCount;
 }
 
 void IT::Properties::setPatternCount(ushort patternCount)
 {
-       d->patternCount = patternCount;
+  d->patternCount = patternCount;
 }
 
 void IT::Properties::setFlags(ushort flags)
 {
-       d->flags = flags;
+  d->flags = flags;
 }
 
 void IT::Properties::setSpecial(ushort special)
 {
-       d->special = special;
+  d->special = special;
 }
 
 void IT::Properties::setCmwt(ushort cmwt)
 {
-       d->cmwt = cmwt;
+  d->cmwt = cmwt;
 }
 
 void IT::Properties::setVersion(ushort version)
 {
-       d->version = version;
+  d->version = version;
 }
 
 void IT::Properties::setBaseVolume(int baseVolume)
 {
-       d->baseVolume = baseVolume;
+  d->baseVolume = baseVolume;
 }
 
 void IT::Properties::setTempo(uchar tempo)
 {
-       d->tempo = tempo;
+  d->tempo = tempo;
 }
 
 void IT::Properties::setBpmSpeed(uchar bpmSpeed)
 {
-       d->bpmSpeed = bpmSpeed;
+  d->bpmSpeed = bpmSpeed;
 }
index cc53b82841f80a46bae935f7cc3518a44fd0ed6f..eed08d2737be23e86ac268176a8d85f036258041 100644 (file)
 #include "audioproperties.h"
 
 namespace TagLib {
-       namespace IT {
-               class TAGLIB_EXPORT Properties : public AudioProperties {
-                       friend class File;
-               public:
-                       Properties(AudioProperties::ReadStyle propertiesStyle);
-                       virtual ~Properties();
-                       
-                       int length()     const;
-                       int bitrate()    const;
-                       int sampleRate() const;
-                       int channels()   const;
+  namespace IT {
+    class TAGLIB_EXPORT Properties : public AudioProperties {
+      friend class File;
+    public:
+      Properties(AudioProperties::ReadStyle propertiesStyle);
+      virtual ~Properties();
+      
+      int length()     const;
+      int bitrate()    const;
+      int sampleRate() const;
+      int channels()   const;
 
-                       ushort sampleLength()    const;
-                       bool   stereo()          const;
-                       ushort instrumentCount() const;
-                       ushort sampleCount()     const;
-                       ushort patternCount()    const;
-                       ushort version()         const;
-                       ushort cmwt()            const;
-                       ushort flags()           const;
-                       ushort special()         const;
-                       int    baseVolume()      const;
-                       uchar  tempo()           const;
-                       uchar  bpmSpeed()        const;
+      ushort sampleLength()    const;
+      bool   stereo()          const;
+      ushort instrumentCount() const;
+      ushort sampleCount()     const;
+      ushort patternCount()    const;
+      ushort version()         const;
+      ushort cmwt()            const;
+      ushort flags()           const;
+      ushort special()         const;
+      int    baseVolume()      const;
+      uchar  tempo()           const;
+      uchar  bpmSpeed()        const;
 
-               protected:
-                       void setSampleLength(ushort sampleLength);
-                       void setStereo(bool stereo);
+    protected:
+      void setSampleLength(ushort sampleLength);
+      void setStereo(bool stereo);
 
-                       void setInstrumentCount(ushort instrumentCount);
-                       void setSampleCount (ushort sampleCount);
-                       void setPatternCount(ushort patternCount);
-                       void setFlags       (ushort flags);
-                       void setSpecial     (ushort special);
-                       void setCmwt        (ushort cmwt);
-                       void setVersion     (ushort version);
-                       void setBaseVolume  (int baseVolume);
-                       void setTempo       (uchar tempo);
-                       void setBpmSpeed    (uchar bpmSpeed);
+      void setInstrumentCount(ushort instrumentCount);
+      void setSampleCount (ushort sampleCount);
+      void setPatternCount(ushort patternCount);
+      void setFlags       (ushort flags);
+      void setSpecial     (ushort special);
+      void setCmwt        (ushort cmwt);
+      void setVersion     (ushort version);
+      void setBaseVolume  (int baseVolume);
+      void setTempo       (uchar tempo);
+      void setBpmSpeed    (uchar bpmSpeed);
 
-               private:
-                       Properties(const Properties&);
-                       Properties &operator=(const Properties&);
+    private:
+      Properties(const Properties&);
+      Properties &operator=(const Properties&);
 
-                       class PropertiesPrivate;
-                       PropertiesPrivate *d;
-               };
-       }
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
 }
 
 #endif
index ec9bbbc1271f312ad2a1cefd60f7d91f704f0463..5ad69e4bc5c1fa7e4dd4a500e055922dd186b4b9 100644 (file)
@@ -34,45 +34,45 @@ Mod::File::File(IOStream *stream) : TagLib::File(stream)
 
 void Mod::File::writeString(const String &s, ulong size)
 {
-       ByteVector data(s.data(String::Latin1));
-       data.resize(size, 0);
-       writeBlock(data);
+  ByteVector data(s.data(String::Latin1));
+  data.resize(size, 0);
+  writeBlock(data);
 }
 
 bool Mod::File::readString(String &s, ulong size)
 {
-       ByteVector data(readBlock(size));
-       if(data.size() < size) return false;
-       int index = data.find((char) 0);
-       if(index > -1)
-       {
-               data.resize(index);
-       }
-       data.replace((char) 0xff, ' ');
+  ByteVector data(readBlock(size));
+  if(data.size() < size) return false;
+  int index = data.find((char) 0);
+  if(index > -1)
+  {
+    data.resize(index);
+  }
+  data.replace((char) 0xff, ' ');
 
-       s = data;
-       return true;
+  s = data;
+  return true;
 }
 
 bool Mod::File::readByte(uchar &byte)
 {
-       ByteVector data(readBlock(1));
-       if(data.size() < 1) return false;
-       byte = data[0];
-       return true;
+  ByteVector data(readBlock(1));
+  if(data.size() < 1) return false;
+  byte = data[0];
+  return true;
 }
 
 bool Mod::File::readU16L(ushort &number)
 {
-       ByteVector data(readBlock(2));
-       if(data.size() < 2) return false;
-       number = data.toUShort(false);
-       return true;
+  ByteVector data(readBlock(2));
+  if(data.size() < 2) return false;
+  number = data.toUShort(false);
+  return true;
 }
 
 bool Mod::File::readU32L(ulong &number) {
-       ByteVector data(readBlock(4));
-       if(data.size() < 4) return false;
-       number = data.toUInt(false);
-       return true;
+  ByteVector data(readBlock(4));
+  if(data.size() < 4) return false;
+  number = data.toUInt(false);
+  return true;
 }
index ff385ce10ffb89fe4e1b0fdde6838425ec6fc0ae..997c6d6293eca9890e3fea381a9ba3b58ef79ca1 100644 (file)
 #include "taglib_export.h"
 
 namespace TagLib {
-       namespace Mod {
-               class TAGLIB_EXPORT File : public TagLib::File {
-                       protected:
-                               File(FileName file);
-                               File(IOStream *stream);
+  namespace Mod {
+    class TAGLIB_EXPORT File : public TagLib::File {
+      protected:
+        File(FileName file);
+        File(IOStream *stream);
 
-                               void writeString(const String &s, ulong size);
-                               bool readString(String &s, ulong size);
-                               bool readByte(uchar &byte);
-                               bool readU16L(ushort &number);
-                               bool readU32L(ulong &number);
-               };
-       }
+        void writeString(const String &s, ulong size);
+        bool readString(String &s, ulong size);
+        bool readByte(uchar &byte);
+        bool readU16L(ushort &number);
+        bool readU32L(ulong &number);
+    };
+  }
 }
 
 #endif
index 17268115ed03dc6f54962e2efd2555f074e193af..1dc940b51e1d408becad9c0b3ff4cec1100fc71b 100644 (file)
 
 // some helper-macros only used internally by (s3m|it|xm)file.cpp
 #define READ_ASSERT(cond) \
-       if(!(cond)) \
-       { \
-               setValid(false); \
-               return; \
-       }
+  if(!(cond)) \
+  { \
+    setValid(false); \
+    return; \
+  }
 
 #define READ(setter,type,read) \
-       { \
-               type number; \
-               READ_ASSERT(read(number)); \
-               setter(number); \
-       }
+  { \
+    type number; \
+    READ_ASSERT(read(number)); \
+    setter(number); \
+  }
 
 #define READ_BYTE(setter) READ(setter,uchar,readByte)
 #define READ_U16L(setter) READ(setter,ushort,readU16L)
 #define READ_U32L(setter) READ(setter,ulong,readU32L)
 
 #define READ_STRING(setter,size) \
-       { \
-               String s; \
-               READ_ASSERT(readString(s, size)); \
-               setter(s); \
-       }
+  { \
+    String s; \
+    READ_ASSERT(readString(s, size)); \
+    setter(s); \
+  }
 
 #define READ_AS(type,name,read) \
-       type name = 0; \
-       READ_ASSERT(read(name));
+  type name = 0; \
+  READ_ASSERT(read(name));
 
 #define READ_BYTE_AS(name) READ_AS(uchar,name,readByte)
 #define READ_U16L_AS(name) READ_AS(ushort,name,readU16L)
 #define READ_U32L_AS(name) READ_AS(ulong,name,readU32L)
 
 #define READ_STRING_AS(name,size) \
-       String name; \
-       READ_ASSERT(readString(name, size));
+  String name; \
+  READ_ASSERT(readString(name, size));
 
 #endif
index 77e7fd18f2097f46d4ae68ec9dca9df8322154a5..29344b8f93b93e447d516ee793122634e42073da 100644 (file)
@@ -27,60 +27,60 @@ using namespace Mod;
 class Mod::Tag::TagPrivate
 {
 public:
-       TagPrivate() {}
+  TagPrivate() {}
 
-       String title;
-       String comment;
+  String title;
+  String comment;
 };
 
 Mod::Tag::Tag() : TagLib::Tag()
 {
-       d = new TagPrivate;
+  d = new TagPrivate;
 }
 
 Mod::Tag::~Tag()
 {
-       delete d;
+  delete d;
 }
 
 String Mod::Tag::title() const
 {
-       return d->title;
+  return d->title;
 }
 
 String Mod::Tag::artist() const
 {
-       return String::null;
+  return String::null;
 }
 
 String Mod::Tag::album() const
 {
-       return String::null;
+  return String::null;
 }
 
 String Mod::Tag::comment() const
 {
-       return d->comment;
+  return d->comment;
 }
 
 String Mod::Tag::genre() const
 {
-       return String::null;
+  return String::null;
 }
 
 uint Mod::Tag::year() const
 {
-       return 0;
+  return 0;
 }
 
 uint Mod::Tag::track() const
 {
-       return 0;
+  return 0;
 }
 
 void Mod::Tag::setTitle(const String &title)
 {
-       d->title = title;
+  d->title = title;
 }
 
 void Mod::Tag::setArtist(const String &)
@@ -93,7 +93,7 @@ void Mod::Tag::setAlbum(const String &)
 
 void Mod::Tag::setComment(const String &comment)
 {
-       d->comment = comment;
+  d->comment = comment;
 }
 
 void Mod::Tag::setGenre(const String &)
index fa4f7a2415990facc3c0638ae8c9f30f0ee920cd..8d6482cb33a6f56b676dde83385704b79331fb8e 100644 (file)
 #include "tag.h"
 
 namespace TagLib {
-       namespace Mod {
-               class TAGLIB_EXPORT Tag : public TagLib::Tag {
-                       public:
-                               Tag();
-                               virtual ~Tag();
-
-                               String title()   const;
-                               String artist()  const;
-                               String album()   const;
-                               String comment() const;
-                               String genre()   const;
-                               uint   year()    const;
-                               uint   track()   const;
-
-                               void setTitle  (const String &title);
-                               void setArtist (const String &artist);
-                               void setAlbum  (const String &album);
-                               void setComment(const String &comment);
-                               void setGenre  (const String &genre);
-                               void setYear (uint year);
-                               void setTrack(uint track);
-
-                       private:
-                               Tag(const Tag &);
-                               Tag &operator=(const Tag &);
-
-                               class TagPrivate;
-                               TagPrivate *d;
-               };
-       }
+  namespace Mod {
+    class TAGLIB_EXPORT Tag : public TagLib::Tag {
+      public:
+        Tag();
+        virtual ~Tag();
+
+        String title()   const;
+        String artist()  const;
+        String album()   const;
+        String comment() const;
+        String genre()   const;
+        uint   year()    const;
+        uint   track()   const;
+
+        void setTitle  (const String &title);
+        void setArtist (const String &artist);
+        void setAlbum  (const String &album);
+        void setComment(const String &comment);
+        void setGenre  (const String &genre);
+        void setYear (uint year);
+        void setTrack(uint track);
+
+      private:
+        Tag(const Tag &);
+        Tag &operator=(const Tag &);
+
+        class TagPrivate;
+        TagPrivate *d;
+    };
+  }
 }
 
 #endif
index 5fee5a2ceab4214a0b4f935595a10f4d3a23adc1..813a5a226ce423878316543c3c376c0db54eb436 100644 (file)
@@ -29,34 +29,34 @@ using namespace S3M;
 class S3M::File::FilePrivate
 {
 public:
-       FilePrivate(AudioProperties::ReadStyle propertiesStyle)
-               : properties(propertiesStyle)
-       {
-       }
+  FilePrivate(AudioProperties::ReadStyle propertiesStyle)
+    : properties(propertiesStyle)
+  {
+  }
 
-       Mod::Tag        tag;
-       S3M::Properties properties;
+  Mod::Tag        tag;
+  S3M::Properties properties;
 };
 
 S3M::File::File(FileName file, bool readProperties,
            AudioProperties::ReadStyle propertiesStyle) :
            Mod::File(file)
 {
-       d = new FilePrivate(propertiesStyle);
-       read(readProperties);
+  d = new FilePrivate(propertiesStyle);
+  read(readProperties);
 }
 
 S3M::File::File(IOStream *stream, bool readProperties,
            AudioProperties::ReadStyle propertiesStyle) :
            Mod::File(stream)
 {
-       d = new FilePrivate(propertiesStyle);
-       read(readProperties);
+  d = new FilePrivate(propertiesStyle);
+  read(readProperties);
 }
 
 S3M::File::~File()
 {
-       delete d;
+  delete d;
 }
 
 Mod::Tag *S3M::File::tag() const
@@ -71,91 +71,91 @@ S3M::Properties *S3M::File::audioProperties() const
 
 bool S3M::File::save()
 {
-       // note: if title starts with "Extended Module: "
-       // the file would look like an .xm file
-       seek(0);
-       writeString(d->tag.title(), 28);
-       // TODO: write comment as sample names
+  // note: if title starts with "Extended Module: "
+  // the file would look like an .xm file
+  seek(0);
+  writeString(d->tag.title(), 28);
+  // TODO: write comment as sample names
     return true;
 }
 
 void S3M::File::read(bool)
 {
-       if(!isOpen())
-               return;
+  if(!isOpen())
+    return;
 
-       READ_STRING(d->tag.setTitle, 28);
-       READ_BYTE_AS(mark);
-       READ_BYTE_AS(type);
+  READ_STRING(d->tag.setTitle, 28);
+  READ_BYTE_AS(mark);
+  READ_BYTE_AS(type);
 
-       READ_ASSERT(mark == 0x1A && type == 0x10);
+  READ_ASSERT(mark == 0x1A && type == 0x10);
 
-       seek(32);
+  seek(32);
 
-       READ_U16L_AS(length);
-       READ_U16L_AS(sampleCount);
+  READ_U16L_AS(length);
+  READ_U16L_AS(sampleCount);
 
-       d->properties.setSampleLength(length);
-       d->properties.setSampleCount(sampleCount);
+  d->properties.setSampleLength(length);
+  d->properties.setSampleCount(sampleCount);
 
-       READ_U16L(d->properties.setPatternCount);
-       READ_U16L(d->properties.setFlags);
-       READ_U16L(d->properties.setVersion);
-       READ_U16L(d->properties.setSamplesType);
+  READ_U16L(d->properties.setPatternCount);
+  READ_U16L(d->properties.setFlags);
+  READ_U16L(d->properties.setVersion);
+  READ_U16L(d->properties.setSamplesType);
 
-       READ_ASSERT(readBlock(4) == "SCRM");
+  READ_ASSERT(readBlock(4) == "SCRM");
 
-       READ_BYTE_AS(baseVolume);
-       d->properties.setBaseVolume(baseVolume << 1);
+  READ_BYTE_AS(baseVolume);
+  d->properties.setBaseVolume(baseVolume << 1);
 
-       READ_BYTE(d->properties.setTempo);
-       READ_BYTE(d->properties.setBpmSpeed);
+  READ_BYTE(d->properties.setTempo);
+  READ_BYTE(d->properties.setBpmSpeed);
 
-       READ_BYTE_AS(stereo);
-       d->properties.setStereo((stereo & 0x80) != 0);
-       READ_BYTE(d->properties.setUltraClick);
+  READ_BYTE_AS(stereo);
+  d->properties.setStereo((stereo & 0x80) != 0);
+  READ_BYTE(d->properties.setUltraClick);
 
-       READ_BYTE_AS(usePanningValues);
-       d->properties.setUsePanningValues(usePanningValues == 0xFC);
+  READ_BYTE_AS(usePanningValues);
+  d->properties.setUsePanningValues(usePanningValues == 0xFC);
 
-       seek(10, Current);
+  seek(10, Current);
 
-       int channels = 0;
-       for(int i = 0; i < 32; ++ i)
-       {
-               READ_BYTE_AS(terminator);
-               if (terminator != 0xff) ++ channels;
-       }
-       d->properties.setChannels(channels);
+  int channels = 0;
+  for(int i = 0; i < 32; ++ i)
+  {
+    READ_BYTE_AS(terminator);
+    if (terminator != 0xff) ++ channels;
+  }
+  d->properties.setChannels(channels);
 
-       seek(channels, Current);
+  seek(channels, Current);
 
-       StringList comment;
-       for(ushort i = 0; i < sampleCount; ++ i)
-       {
-               seek(96 + length + (i << 1));
+  StringList comment;
+  for(ushort i = 0; i < sampleCount; ++ i)
+  {
+    seek(96 + length + (i << 1));
 
-               READ_U16L_AS(instrumentOffset);
-               seek(instrumentOffset << 4);
+    READ_U16L_AS(instrumentOffset);
+    seek(instrumentOffset << 4);
 
-               READ_BYTE_AS(sampleType);
-               READ_STRING_AS(dosFileName, 13);
-               READ_U16L_AS(sampleOffset);
-               READ_U32L_AS(sampleLength);
-               READ_U32L_AS(repeatStart);
-               READ_U32L_AS(repeatStop);
-               READ_BYTE_AS(sampleVolume);
+    READ_BYTE_AS(sampleType);
+    READ_STRING_AS(dosFileName, 13);
+    READ_U16L_AS(sampleOffset);
+    READ_U32L_AS(sampleLength);
+    READ_U32L_AS(repeatStart);
+    READ_U32L_AS(repeatStop);
+    READ_BYTE_AS(sampleVolume);
 
-               seek(2, Current);
+    seek(2, Current);
 
-               READ_BYTE_AS(sampleFlags);
-               READ_U32L_AS(baseFrequency);
+    READ_BYTE_AS(sampleFlags);
+    READ_U32L_AS(baseFrequency);
 
-               seek(12, Current);
+    seek(12, Current);
 
-               READ_STRING_AS(sampleName, 28);
-               comment.append(sampleName);
-       }
+    READ_STRING_AS(sampleName, 28);
+    comment.append(sampleName);
+  }
 
-       d->tag.setComment(comment.toString("\n"));
+  d->tag.setComment(comment.toString("\n"));
 }
index 976065762fb3abec03fe7e70049476ceb2a0d676..05fbfd56d6d0937dd2a5874f933a1728426aa2f7 100644 (file)
 
 namespace TagLib {
 
-       namespace S3M {
-
-               class TAGLIB_EXPORT File : public Mod::File {
-                       public:
-                               /*!
-                                * Contructs a ScreamTracker III file from \a file. If \a readProperties
-                                * is true the file's audio properties will also be read using
-                                * \a propertiesStyle. If false, \a propertiesStyle is ignored.
-                                */
-                               File(FileName file, bool readProperties = true,
-                                    AudioProperties::ReadStyle propertiesStyle =
-                                    AudioProperties::Average);
-
-                               /*!
-                                * Contructs a ScreamTracker III file from \a stream. If \a readProperties
-                                * is true the file's audio properties will also be read using
-                                * \a propertiesStyle. If false, \a propertiesStyle is ignored.
-                                */
-                               File(IOStream *stream, bool readProperties = true,
-                                    AudioProperties::ReadStyle propertiesStyle =
-                                    AudioProperties::Average);
-
-                               /*!
-                                * Destroys this instance of the File.
-                                */
-                               virtual ~File();
-
-                               Mod::Tag *tag() const;
-
-                               /*!
-                                * Returns the S3M::Properties for this file. If no audio properties
-                                * were read then this will return a null pointer.
-                                */
-                               S3M::Properties *audioProperties() const;
-
-                               /*!
-                                * Save the file.
-                                * This is the same as calling save(AllTags);
-                                *
-                                * \note Saving ScreamTracker III tags is not supported.
-                                */
-                               bool save();
-
-                       private:
-                               File(const File &);
-                               File &operator=(const File &);
-
-                               void read(bool readProperties);
-
-                               class FilePrivate;
-                               FilePrivate *d;
-               };
-       }
+  namespace S3M {
+
+    class TAGLIB_EXPORT File : public Mod::File {
+      public:
+        /*!
+         * Contructs a ScreamTracker III file from \a file. If \a readProperties
+         * is true the file's audio properties will also be read using
+         * \a propertiesStyle. If false, \a propertiesStyle is ignored.
+         */
+        File(FileName file, bool readProperties = true,
+             AudioProperties::ReadStyle propertiesStyle =
+             AudioProperties::Average);
+
+        /*!
+         * Contructs a ScreamTracker III file from \a stream. If \a readProperties
+         * is true the file's audio properties will also be read using
+         * \a propertiesStyle. If false, \a propertiesStyle is ignored.
+         */
+        File(IOStream *stream, bool readProperties = true,
+             AudioProperties::ReadStyle propertiesStyle =
+             AudioProperties::Average);
+
+        /*!
+         * Destroys this instance of the File.
+         */
+        virtual ~File();
+
+        Mod::Tag *tag() const;
+
+        /*!
+         * Returns the S3M::Properties for this file. If no audio properties
+         * were read then this will return a null pointer.
+         */
+        S3M::Properties *audioProperties() const;
+
+        /*!
+         * Save the file.
+         * This is the same as calling save(AllTags);
+         *
+         * \note Saving ScreamTracker III tags is not supported.
+         */
+        bool save();
+
+      private:
+        File(const File &);
+        File &operator=(const File &);
+
+        void read(bool readProperties);
+
+        class FilePrivate;
+        FilePrivate *d;
+    };
+  }
 }
 
 #endif
index de1468d7ff0884a04bd3196b30bd81c5d00268b0..11f645e13a2655be12b2b68c8e73e116bb28511e 100644 (file)
@@ -27,188 +27,188 @@ using namespace S3M;
 class S3M::Properties::PropertiesPrivate
 {
 public:
-       PropertiesPrivate() :
-               sampleLength(0),
-               channels(0),
-               stereo(0),
-               sampleCount(0),
-               patternCount(0),
-               flags(0),
-               version(0),
-               samplesType(0),
-               baseVolume(0),
-               tempo(0),
-               bpmSpeed(0),
-               ultraClick(0),
-               usePanningValues(false) {}
-       
-       ushort sampleLength;
-       int    channels;
-       bool   stereo;
-       ushort sampleCount;
-       ushort patternCount;
-       ushort flags;
-       ushort version;
-       ushort samplesType;
-       int    baseVolume;
-       uchar  tempo;
-       uchar  bpmSpeed;
-       uchar  ultraClick;
-       bool   usePanningValues;
+  PropertiesPrivate() :
+    sampleLength(0),
+    channels(0),
+    stereo(0),
+    sampleCount(0),
+    patternCount(0),
+    flags(0),
+    version(0),
+    samplesType(0),
+    baseVolume(0),
+    tempo(0),
+    bpmSpeed(0),
+    ultraClick(0),
+    usePanningValues(false) {}
+  
+  ushort sampleLength;
+  int    channels;
+  bool   stereo;
+  ushort sampleCount;
+  ushort patternCount;
+  ushort flags;
+  ushort version;
+  ushort samplesType;
+  int    baseVolume;
+  uchar  tempo;
+  uchar  bpmSpeed;
+  uchar  ultraClick;
+  bool   usePanningValues;
 };
 
 S3M::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
-               AudioProperties(propertiesStyle),
-               d(new PropertiesPrivate)
+    AudioProperties(propertiesStyle),
+    d(new PropertiesPrivate)
 {
 }
 
 S3M::Properties::~Properties()
 {
-       delete d;
+  delete d;
 }
 
 int S3M::Properties::length() const
 {
-       return 0;
+  return 0;
 }
 
 int S3M::Properties::bitrate() const
 {
-       return 0;
+  return 0;
 }
 
 int S3M::Properties::sampleRate() const
 {
-       return 0;
+  return 0;
 }
 
 int S3M::Properties::channels() const
 {
-       return d->channels;
+  return d->channels;
 }
 
 ushort S3M::Properties::sampleLength() const
 {
-       return d->sampleLength;
+  return d->sampleLength;
 }
 
 bool S3M::Properties::stereo() const
 {
-       return d->stereo;
+  return d->stereo;
 }
 
 ushort S3M::Properties::sampleCount() const
 {
-       return d->sampleCount;
+  return d->sampleCount;
 }
 
 ushort S3M::Properties::patternCount() const
 {
-       return d->patternCount;
+  return d->patternCount;
 }
 
 ushort S3M::Properties::flags() const
 {
-       return d->flags;
+  return d->flags;
 }
 
 ushort S3M::Properties::version() const
 {
-       return d->version;
+  return d->version;
 }
 
 ushort S3M::Properties::samplesType() const
 {
-       return d->samplesType;
+  return d->samplesType;
 }
 
 int S3M::Properties::baseVolume() const
 {
-       return d->baseVolume;
+  return d->baseVolume;
 }
 
 uchar S3M::Properties::tempo() const
 {
-       return d->tempo;
+  return d->tempo;
 }
 
 uchar S3M::Properties::bpmSpeed() const
 {
-       return d->bpmSpeed;
+  return d->bpmSpeed;
 }
 
 uchar S3M::Properties::ultraClick() const
 {
-       return d->ultraClick;
+  return d->ultraClick;
 }
 
 bool S3M::Properties::usePanningValues() const
 {
-       return d->usePanningValues;
+  return d->usePanningValues;
 }
 
 void S3M::Properties::setSampleLength(ushort sampleLength)
 {
-       d->sampleLength = sampleLength;
+  d->sampleLength = sampleLength;
 }
 
 void S3M::Properties::setChannels(int channels)
 {
-       d->channels = channels;
+  d->channels = channels;
 }
 
 void S3M::Properties::setStereo(bool stereo)
 {
-       d->stereo = stereo;
+  d->stereo = stereo;
 }
 
 void S3M::Properties::setSampleCount(ushort sampleCount)
 {
-       d->sampleCount = sampleCount;
+  d->sampleCount = sampleCount;
 }
 
 void S3M::Properties::setPatternCount(ushort patternCount)
 {
-       d->patternCount = patternCount;
+  d->patternCount = patternCount;
 }
 
 void S3M::Properties::setFlags(ushort flags)
 {
-       d->flags = flags;
+  d->flags = flags;
 }
 
 void S3M::Properties::setVersion(ushort version)
 {
-       d->version = version;
+  d->version = version;
 }
 
 void S3M::Properties::setSamplesType(ushort samplesType)
 {
-       d->samplesType = samplesType;
+  d->samplesType = samplesType;
 }
 
 void S3M::Properties::setBaseVolume(int baseVolume)
 {
-       d->baseVolume = baseVolume;
+  d->baseVolume = baseVolume;
 }
 
 void S3M::Properties::setTempo(uchar tempo)
 {
-       d->tempo = tempo;
+  d->tempo = tempo;
 }
 
 void S3M::Properties::setBpmSpeed(uchar bpmSpeed)
 {
-       d->bpmSpeed = bpmSpeed;
+  d->bpmSpeed = bpmSpeed;
 }
 
 void S3M::Properties::setUltraClick(uchar ultraClick)
 {
-       d->ultraClick = ultraClick;
+  d->ultraClick = ultraClick;
 }
 
 void S3M::Properties::setUsePanningValues(bool usePanningValues)
 {
-       d->usePanningValues = usePanningValues;
+  d->usePanningValues = usePanningValues;
 }
index 83697febf5032341f75c64f6ba215679244eccf4..5e549ce0add6255aef7412b6cec8999f6b1c89c2 100644 (file)
 #include "audioproperties.h"
 
 namespace TagLib {
-       namespace S3M {
-               class TAGLIB_EXPORT Properties : public AudioProperties {
-                       friend class File;
-               public:
-                       Properties(AudioProperties::ReadStyle propertiesStyle);
-                       virtual ~Properties();
-                       
-                       int length()     const;
-                       int bitrate()    const;
-                       int sampleRate() const;
-                       int channels()   const;
+  namespace S3M {
+    class TAGLIB_EXPORT Properties : public AudioProperties {
+      friend class File;
+    public:
+      Properties(AudioProperties::ReadStyle propertiesStyle);
+      virtual ~Properties();
+      
+      int length()     const;
+      int bitrate()    const;
+      int sampleRate() const;
+      int channels()   const;
 
-                       ushort sampleLength() const;
-                       bool   stereo()       const;
-                       ushort sampleCount()  const;
-                       ushort patternCount() const;
-                       ushort flags()        const;
-                       ushort version()      const;
-                       ushort samplesType()  const;
-                       int    baseVolume()   const;
-                       uchar  tempo()        const;
-                       uchar  bpmSpeed()     const;
-                       uchar  ultraClick()   const;
-                       bool   usePanningValues() const;
+      ushort sampleLength() const;
+      bool   stereo()       const;
+      ushort sampleCount()  const;
+      ushort patternCount() const;
+      ushort flags()        const;
+      ushort version()      const;
+      ushort samplesType()  const;
+      int    baseVolume()   const;
+      uchar  tempo()        const;
+      uchar  bpmSpeed()     const;
+      uchar  ultraClick()   const;
+      bool   usePanningValues() const;
 
-               protected:
-                       void setSampleLength(ushort sampleLength);
-                       void setChannels(int channels);
+    protected:
+      void setSampleLength(ushort sampleLength);
+      void setChannels(int channels);
 
-                       void setStereo      (bool stereo);
-                       void setSampleCount (ushort sampleCount);
-                       void setPatternCount(ushort patternCount);
-                       void setFlags       (ushort flags);
-                       void setVersion     (ushort version);
-                       void setSamplesType (ushort samplesType);
-                       void setBaseVolume  (int baseVolume);
-                       void setTempo       (uchar tempo);
-                       void setBpmSpeed    (uchar bpmSpeed);
-                       void setUltraClick  (uchar ultraClick);
-                       void setUsePanningValues(bool usePanningValues);
+      void setStereo      (bool stereo);
+      void setSampleCount (ushort sampleCount);
+      void setPatternCount(ushort patternCount);
+      void setFlags       (ushort flags);
+      void setVersion     (ushort version);
+      void setSamplesType (ushort samplesType);
+      void setBaseVolume  (int baseVolume);
+      void setTempo       (uchar tempo);
+      void setBpmSpeed    (uchar bpmSpeed);
+      void setUltraClick  (uchar ultraClick);
+      void setUsePanningValues(bool usePanningValues);
 
-               private:
-                       Properties(const Properties&);
-                       Properties &operator=(const Properties&);
+    private:
+      Properties(const Properties&);
+      Properties &operator=(const Properties&);
 
-                       class PropertiesPrivate;
-                       PropertiesPrivate *d;
-               };
-       }
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
 }
 
 #endif
index a7cc9ccc3c7b53ca0d475dc611053dd7b6783128..fc31ff43ad3301135d307977a1032e926fec9029 100644 (file)
@@ -31,34 +31,34 @@ using namespace XM;
 class XM::File::FilePrivate
 {
 public:
-       FilePrivate(AudioProperties::ReadStyle propertiesStyle)
-               : tag(), properties(propertiesStyle)
-       {
-       }
+  FilePrivate(AudioProperties::ReadStyle propertiesStyle)
+    : tag(), properties(propertiesStyle)
+  {
+  }
 
-       XM::Tag        tag;
-       XM::Properties properties;
+  XM::Tag        tag;
+  XM::Properties properties;
 };
 
 XM::File::File(FileName file, bool readProperties,
                AudioProperties::ReadStyle propertiesStyle) :
                Mod::File(file),
-                          d(new FilePrivate(propertiesStyle))
+         d(new FilePrivate(propertiesStyle))
 {
-       read(readProperties);
+  read(readProperties);
 }
 
 XM::File::File(IOStream *stream, bool readProperties,
                AudioProperties::ReadStyle propertiesStyle) :
                Mod::File(stream),
-                          d(new FilePrivate(propertiesStyle))
+         d(new FilePrivate(propertiesStyle))
 {
-       read(readProperties);
+  read(readProperties);
 }
 
 XM::File::~File()
 {
-       delete d;
+  delete d;
 }
 
 XM::Tag *XM::File::tag() const
@@ -73,123 +73,123 @@ XM::Properties *XM::File::audioProperties() const
 
 bool XM::File::save()
 {
-       seek(17);
-       writeString(d->tag.title(), 20);
-       seek(1, Current);
-       writeString(d->tag.trackerName(), 20);
-       // TODO: write comment as instrument and sample names
+  seek(17);
+  writeString(d->tag.title(), 20);
+  seek(1, Current);
+  writeString(d->tag.trackerName(), 20);
+  // TODO: write comment as instrument and sample names
     return true;
 }
 
 void XM::File::read(bool)
 {
-       if(!isOpen())
-               return;
-
-       READ_ASSERT(readBlock(17) == "Extended Module: ");
-
-       READ_STRING(d->tag.setTitle, 20);
-       READ_BYTE_AS(mark);
-       READ_ASSERT(mark == 0x1A);
-       
-       READ_STRING(d->tag.setTrackerName, 20);
-       READ_U16L(d->properties.setVersion);
-       READ_U32L_AS(headerSize);
-       READ_U16L(d->properties.setSampleLength);
-       READ_U16L(d->properties.setRestartPosition);
-       READ_U16L(d->properties.setChannels);
-       READ_U16L_AS(patternCount);
-       d->properties.setPatternCount(patternCount);
-       READ_U16L_AS(instrumentCount);
-       d->properties.setInstrumentCount(instrumentCount);
-       READ_U16L(d->properties.setFlags);
-       READ_U16L(d->properties.setTempo);
-       READ_U16L(d->properties.setBpmSpeed);
-
-       seek(60 + headerSize);
-               
-       for(ushort i = 0; i < patternCount; ++ i)
-       {
-               READ_U32L_AS(patternHeaderLength);
-               READ_BYTE_AS(patternType);
-               READ_U16L_AS(rowCount);
-               READ_U16L_AS(patternDataSize);
-
-               seek(patternHeaderLength - (4+1+2+2) + patternDataSize, Current);
-       }
-               
-       StringList intrumentNames;
-       StringList sampleNames;
-       for(ushort i = 0; i < instrumentCount; ++ i)
-       {
-               long pos = tell();
-               READ_U32L_AS(instrumentSize);
-
-               String instrumentName;
-               uchar instrumentType = 0;
-               ushort sampleCount = 0;
-                       
-               if(instrumentSize > 4)
-               {
-                       if(!readString(instrumentName, std::min(22UL, instrumentSize-4)))
-                       {
-                               setValid(false);
-                               return;
-                       }
-
-                       if(instrumentSize >= (4+22+1))
-                       {
-                               if(!readByte(instrumentType))
-                               {
-                                       setValid(false);
-                                       return;
-                               }
-
-                               if (instrumentSize >= (4+22+1+2))
-                               {
-                                       if(!readU16L(sampleCount))
-                                       {
-                                               setValid(false);
-                                               return;
-                                       }
-                               }
-                       }
-               }
-
-               ulong sumSampleLength = 0;
-               ulong sampleHeaderSize = 0;
-               if (sampleCount > 0)
-               {
-                       if(!readU32L(sampleHeaderSize))
-                       {
-                               setValid(false);
-                               return;
-                       }
-
-                       seek(pos + instrumentSize);
-
-                       long sampleheaderPos = tell();
-                       for (ushort j = 0; j < sampleCount; ++ j)
-                       {
-                               seek(sampleheaderPos + sampleHeaderSize * j);
-                               READ_U32L_AS(length);
-                               READ_U32L_AS(loopStart);
-                               READ_U32L_AS(loopLength);
-                               READ_BYTE_AS(volume);
-                               READ_BYTE_AS(finetune);
-                               READ_BYTE_AS(sampleType);
-                               READ_BYTE_AS(panning);
-                               READ_BYTE_AS(noteNumber);
-                               READ_BYTE_AS(compression);
-                               READ_STRING_AS(sampleName, 22);
-                               
-                               sumSampleLength += length;
-                               sampleNames.append(sampleName);
-                       }
-               }
-               intrumentNames.append(instrumentName);
-               seek(pos + instrumentSize + sampleHeaderSize * sampleCount + sumSampleLength);
-       }
-
-       d->tag.setComment(intrumentNames.toString("\n") + "\n" + sampleNames.toString("\n"));
+  if(!isOpen())
+    return;
+
+  READ_ASSERT(readBlock(17) == "Extended Module: ");
+
+  READ_STRING(d->tag.setTitle, 20);
+  READ_BYTE_AS(mark);
+  READ_ASSERT(mark == 0x1A);
+  
+  READ_STRING(d->tag.setTrackerName, 20);
+  READ_U16L(d->properties.setVersion);
+  READ_U32L_AS(headerSize);
+  READ_U16L(d->properties.setSampleLength);
+  READ_U16L(d->properties.setRestartPosition);
+  READ_U16L(d->properties.setChannels);
+  READ_U16L_AS(patternCount);
+  d->properties.setPatternCount(patternCount);
+  READ_U16L_AS(instrumentCount);
+  d->properties.setInstrumentCount(instrumentCount);
+  READ_U16L(d->properties.setFlags);
+  READ_U16L(d->properties.setTempo);
+  READ_U16L(d->properties.setBpmSpeed);
+
+  seek(60 + headerSize);
+    
+  for(ushort i = 0; i < patternCount; ++ i)
+  {
+    READ_U32L_AS(patternHeaderLength);
+    READ_BYTE_AS(patternType);
+    READ_U16L_AS(rowCount);
+    READ_U16L_AS(patternDataSize);
+
+    seek(patternHeaderLength - (4+1+2+2) + patternDataSize, Current);
+  }
+    
+  StringList intrumentNames;
+  StringList sampleNames;
+  for(ushort i = 0; i < instrumentCount; ++ i)
+  {
+    long pos = tell();
+    READ_U32L_AS(instrumentSize);
+
+    String instrumentName;
+    uchar instrumentType = 0;
+    ushort sampleCount = 0;
+      
+    if(instrumentSize > 4)
+    {
+      if(!readString(instrumentName, std::min(22UL, instrumentSize-4)))
+      {
+        setValid(false);
+        return;
+      }
+
+      if(instrumentSize >= (4+22+1))
+      {
+        if(!readByte(instrumentType))
+        {
+          setValid(false);
+          return;
+        }
+
+        if (instrumentSize >= (4+22+1+2))
+        {
+          if(!readU16L(sampleCount))
+          {
+            setValid(false);
+            return;
+          }
+        }
+      }
+    }
+
+    ulong sumSampleLength = 0;
+    ulong sampleHeaderSize = 0;
+    if (sampleCount > 0)
+    {
+      if(!readU32L(sampleHeaderSize))
+      {
+        setValid(false);
+        return;
+      }
+
+      seek(pos + instrumentSize);
+
+      long sampleheaderPos = tell();
+      for (ushort j = 0; j < sampleCount; ++ j)
+      {
+        seek(sampleheaderPos + sampleHeaderSize * j);
+        READ_U32L_AS(length);
+        READ_U32L_AS(loopStart);
+        READ_U32L_AS(loopLength);
+        READ_BYTE_AS(volume);
+        READ_BYTE_AS(finetune);
+        READ_BYTE_AS(sampleType);
+        READ_BYTE_AS(panning);
+        READ_BYTE_AS(noteNumber);
+        READ_BYTE_AS(compression);
+        READ_STRING_AS(sampleName, 22);
+        
+        sumSampleLength += length;
+        sampleNames.append(sampleName);
+      }
+    }
+    intrumentNames.append(instrumentName);
+    seek(pos + instrumentSize + sampleHeaderSize * sampleCount + sumSampleLength);
+  }
+
+  d->tag.setComment(intrumentNames.toString("\n") + "\n" + sampleNames.toString("\n"));
 }
index 05c19e58dc329c081bf375ab1ae37155813781f5..f30ea57304b1043c22e8e11318cac8d88092283b 100644 (file)
 
 namespace TagLib {
 
-       namespace XM {
-
-               class TAGLIB_EXPORT File : public Mod::File {
-                       public:
-                               /*!
-                                * Contructs a Extended Module file from \a file. If \a readProperties
-                                * is true the file's audio properties will also be read using
-                                * \a propertiesStyle. If false, \a propertiesStyle is ignored.
-                                */
-                               File(FileName file, bool readProperties = true,
-                                    AudioProperties::ReadStyle propertiesStyle =
-                                    AudioProperties::Average);
-
-                               /*!
-                                * Contructs a Extended Module file from \a stream. If \a readProperties
-                                * is true the file's audio properties will also be read using
-                                * \a propertiesStyle. If false, \a propertiesStyle is ignored.
-                                */
-                               File(IOStream *stream, bool readProperties = true,
-                                    AudioProperties::ReadStyle propertiesStyle =
-                                    AudioProperties::Average);
-
-                               /*!
-                                * Destroys this instance of the File.
-                                */
-                               virtual ~File();
-
-                               XM::Tag *tag() const;
-
-                               /*!
-                                * Returns the XM::Properties for this file. If no audio properties
-                                * were read then this will return a null pointer.
-                                */
-                               XM::Properties *audioProperties() const;
-
-                               /*!
-                                * Save the file.
-                                * This is the same as calling save(AllTags);
-                                *
-                                * \note Saving Extended Module tags is not supported.
-                                */
-                               bool save();
-
-                       private:
-                               File(const File &);
-                               File &operator=(const File &);
-
-                               void read(bool readProperties);
-
-                               class FilePrivate;
-                               FilePrivate *d;
-               };
-       }
+  namespace XM {
+
+    class TAGLIB_EXPORT File : public Mod::File {
+      public:
+        /*!
+         * Contructs a Extended Module file from \a file. If \a readProperties
+         * is true the file's audio properties will also be read using
+         * \a propertiesStyle. If false, \a propertiesStyle is ignored.
+         */
+        File(FileName file, bool readProperties = true,
+             AudioProperties::ReadStyle propertiesStyle =
+             AudioProperties::Average);
+
+        /*!
+         * Contructs a Extended Module file from \a stream. If \a readProperties
+         * is true the file's audio properties will also be read using
+         * \a propertiesStyle. If false, \a propertiesStyle is ignored.
+         */
+        File(IOStream *stream, bool readProperties = true,
+             AudioProperties::ReadStyle propertiesStyle =
+             AudioProperties::Average);
+
+        /*!
+         * Destroys this instance of the File.
+         */
+        virtual ~File();
+
+        XM::Tag *tag() const;
+
+        /*!
+         * Returns the XM::Properties for this file. If no audio properties
+         * were read then this will return a null pointer.
+         */
+        XM::Properties *audioProperties() const;
+
+        /*!
+         * Save the file.
+         * This is the same as calling save(AllTags);
+         *
+         * \note Saving Extended Module tags is not supported.
+         */
+        bool save();
+
+      private:
+        File(const File &);
+        File &operator=(const File &);
+
+        void read(bool readProperties);
+
+        class FilePrivate;
+        FilePrivate *d;
+    };
+  }
 }
 
 #endif
index 5114a864a492745e6c41f3e7a336227e0a614acc..bde9604913710cafa127f8526347b09c3d5d6670 100644 (file)
@@ -27,142 +27,142 @@ using namespace XM;
 class XM::Properties::PropertiesPrivate
 {
 public:
-       PropertiesPrivate() :
-               sampleLength(0),
-               channels(0),
-               version(0),
-               restartPosition(0),
-               patternCount(0),
-               instrumentCount(0),
-               flags(0),
-               tempo(0),
-               bpmSpeed(0)
-       {
-       }
-       
-       ushort sampleLength;
-       int    channels;
-       ushort version;
-       ushort restartPosition;
-       ushort patternCount;
-       ushort instrumentCount;
-       ushort flags;
-       ushort tempo;
-       ushort bpmSpeed;
+  PropertiesPrivate() :
+    sampleLength(0),
+    channels(0),
+    version(0),
+    restartPosition(0),
+    patternCount(0),
+    instrumentCount(0),
+    flags(0),
+    tempo(0),
+    bpmSpeed(0)
+  {
+  }
+  
+  ushort sampleLength;
+  int    channels;
+  ushort version;
+  ushort restartPosition;
+  ushort patternCount;
+  ushort instrumentCount;
+  ushort flags;
+  ushort tempo;
+  ushort bpmSpeed;
 };
 
 XM::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
-       AudioProperties(propertiesStyle),
-       d(new PropertiesPrivate)
+  AudioProperties(propertiesStyle),
+  d(new PropertiesPrivate)
 {
-}                      
+}     
 
 XM::Properties::~Properties()
 {
-       delete d;
+  delete d;
 }
 
 int XM::Properties::length() const
 {
-       return 0;
+  return 0;
 }
 
 int XM::Properties::bitrate() const
 {
-       return 0;
+  return 0;
 }
 
 int XM::Properties::sampleRate() const
 {
-       return 0;
+  return 0;
 }
 
 int XM::Properties::channels() const
 {
-       return d->channels;
+  return d->channels;
 }
 
 ushort XM::Properties::sampleLength() const
 {
-       return d->sampleLength;
+  return d->sampleLength;
 }
 
 ushort XM::Properties::version() const
 {
-       return d->version;
+  return d->version;
 }
 
 ushort XM::Properties::restartPosition() const
 {
-       return d->restartPosition;
+  return d->restartPosition;
 }
 
 ushort XM::Properties::patternCount() const
 {
-       return d->patternCount;
+  return d->patternCount;
 }
 
 ushort XM::Properties::instrumentCount() const
 {
-       return d->instrumentCount;
+  return d->instrumentCount;
 }
 
 ushort XM::Properties::flags() const
 {
-       return d->flags;
+  return d->flags;
 }
 
 ushort XM::Properties::tempo() const
 {
-       return d->tempo;
+  return d->tempo;
 }
 
 ushort XM::Properties::bpmSpeed() const
 {
-       return d->bpmSpeed;
+  return d->bpmSpeed;
 }
 
 void XM::Properties::setSampleLength(int sampleLength)
 {
-       d->sampleLength = sampleLength;
+  d->sampleLength = sampleLength;
 }
 
 void XM::Properties::setChannels(int channels)
 {
-       d->channels = channels;
+  d->channels = channels;
 }
 
 void XM::Properties::setVersion(ushort version)
 {
-       d->version = version;
+  d->version = version;
 }
 
 void XM::Properties::setRestartPosition(ushort restartPosition)
 {
-       d->restartPosition = restartPosition;
+  d->restartPosition = restartPosition;
 }
 
 void XM::Properties::setPatternCount(ushort patternCount)
 {
-       d->patternCount = patternCount;
+  d->patternCount = patternCount;
 }
 
 void XM::Properties::setInstrumentCount(ushort instrumentCount)
 {
-       d->instrumentCount = instrumentCount;
+  d->instrumentCount = instrumentCount;
 }
 
 void XM::Properties::setFlags(ushort flags)
 {
-       d->flags = flags;
+  d->flags = flags;
 }
 
 void XM::Properties::setTempo(ushort tempo)
 {
-       d->tempo = tempo;
+  d->tempo = tempo;
 }
 
 void XM::Properties::setBpmSpeed(ushort bpmSpeed)
 {
-       d->bpmSpeed = bpmSpeed;
+  d->bpmSpeed = bpmSpeed;
 }
index 3506833c85a83d261ea627623f1a53ccb46a0d48..94be5b40416a655f460e4885e8d23abf94e70199 100644 (file)
 #include "audioproperties.h"
 
 namespace TagLib {
-       namespace XM {
-               class Properties : public AudioProperties {
-                       friend class File;
-               public:
-                       Properties(AudioProperties::ReadStyle propertiesStyle);
-                       virtual ~Properties();
-                       
-                       int length()     const;
-                       int bitrate()    const;
-                       int sampleRate() const;
-                       int channels()   const;
+  namespace XM {
+    class Properties : public AudioProperties {
+      friend class File;
+    public:
+      Properties(AudioProperties::ReadStyle propertiesStyle);
+      virtual ~Properties();
+      
+      int length()     const;
+      int bitrate()    const;
+      int sampleRate() const;
+      int channels()   const;
 
-                       ushort sampleLength()    const;
-                       ushort version()         const;
-                       ushort restartPosition() const;
-                       ushort patternCount()    const;
-                       ushort instrumentCount() const;
-                       ushort flags()           const;
-                       ushort tempo()           const;
-                       ushort bpmSpeed()        const;
+      ushort sampleLength()    const;
+      ushort version()         const;
+      ushort restartPosition() const;
+      ushort patternCount()    const;
+      ushort instrumentCount() const;
+      ushort flags()           const;
+      ushort tempo()           const;
+      ushort bpmSpeed()        const;
 
-               protected:
-                       void setSampleLength(int sampleLength);
-                       void setChannels(int channels);
+    protected:
+      void setSampleLength(int sampleLength);
+      void setChannels(int channels);
 
-                       void setVersion(ushort version);
-                       void setRestartPosition(ushort restartPosition);
-                       void setPatternCount(ushort patternCount);
-                       void setInstrumentCount(ushort instrumentCount);
-                       void setFlags(ushort flags);
-                       void setTempo(ushort tempo);
-                       void setBpmSpeed(ushort bpmSpeed);
+      void setVersion(ushort version);
+      void setRestartPosition(ushort restartPosition);
+      void setPatternCount(ushort patternCount);
+      void setInstrumentCount(ushort instrumentCount);
+      void setFlags(ushort flags);
+      void setTempo(ushort tempo);
+      void setBpmSpeed(ushort bpmSpeed);
 
-               private:
-                       Properties(const Properties&);
-                       Properties &operator=(const Properties&);
+    private:
+      Properties(const Properties&);
+      Properties &operator=(const Properties&);
 
-                       class PropertiesPrivate;
-                       PropertiesPrivate *d;
-               };
-       }
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
 }
 
 #endif
index 8de852824cadd8325407124319805f3b7b39f10f..bd91233afe9784d8109b759b7edc4b8d1d0ec3c8 100644 (file)
@@ -27,66 +27,66 @@ using namespace XM;
 class XM::Tag::TagPrivate
 {
 public:
-       TagPrivate() {}
+  TagPrivate() {}
 
-       String title;
-       String comment;
-       String trackerName;
+  String title;
+  String comment;
+  String trackerName;
 };
 
 XM::Tag::Tag() : TagLib::Tag()
 {
-       d = new TagPrivate;
+  d = new TagPrivate;
 }
 
 XM::Tag::~Tag()
 {
-       delete d;
+  delete d;
 }
 
 String XM::Tag::title() const
 {
-       return d->title;
+  return d->title;
 }
 
 String XM::Tag::artist() const
 {
-       return String::null;
+  return String::null;
 }
 
 String XM::Tag::album() const
 {
-       return String::null;
+  return String::null;
 }
 
 String XM::Tag::comment() const
 {
-       return d->comment;
+  return d->comment;
 }
 
 String XM::Tag::genre() const
 {
-       return String::null;
+  return String::null;
 }
 
 uint XM::Tag::year() const
 {
-       return 0;
+  return 0;
 }
 
 uint XM::Tag::track() const
 {
-       return 0;
+  return 0;
 }
 
 String XM::Tag::trackerName() const
 {
-       return d->trackerName;
+  return d->trackerName;
 }
 
 void XM::Tag::setTitle(const String &title)
 {
-       d->title = title;
+  d->title = title;
 }
 
 void XM::Tag::setArtist(const String &)
@@ -99,7 +99,7 @@ void XM::Tag::setAlbum(const String &)
 
 void XM::Tag::setComment(const String &comment)
 {
-       d->comment = comment;
+  d->comment = comment;
 }
 
 void XM::Tag::setGenre(const String &)
@@ -116,5 +116,5 @@ void XM::Tag::setTrack(uint)
 
 void XM::Tag::setTrackerName(const String &trackerName)
 {
-       d->trackerName = trackerName;
+  d->trackerName = trackerName;
 }
index 48525cec68ca2bf0e8a744c1917b5c89c7a84763..3d0cb21f514658278b7ba81d7ee5865b20154a21 100644 (file)
 #include "modtag.h"
 
 namespace TagLib {
-       namespace XM {
-               class Tag : public TagLib::Tag {
-                       public:
-                               Tag();
-                               virtual ~Tag();
-
-                               String title()   const;
-                               String artist()  const;
-                               String album()   const;
-                               String comment() const;
-                               String genre()   const;
-                               uint   year()    const;
-                               uint   track()   const;
-                               String trackerName() const;
-
-                               void setTitle  (const String &title);
-                               void setArtist (const String &artist);
-                               void setAlbum  (const String &album);
-                               void setComment(const String &comment);
-                               void setGenre  (const String &genre);
-                               void setYear (uint year);
-                               void setTrack(uint track);
-                               void setTrackerName(const String &trackerName);
-
-                       private:
-                               Tag(const Tag &);
-                               Tag &operator=(const Tag &);
-
-                               class TagPrivate;
-                               TagPrivate *d;
-               };
-       }
+  namespace XM {
+    class Tag : public TagLib::Tag {
+      public:
+        Tag();
+        virtual ~Tag();
+
+        String title()   const;
+        String artist()  const;
+        String album()   const;
+        String comment() const;
+        String genre()   const;
+        uint   year()    const;
+        uint   track()   const;
+        String trackerName() const;
+
+        void setTitle  (const String &title);
+        void setArtist (const String &artist);
+        void setAlbum  (const String &album);
+        void setComment(const String &comment);
+        void setGenre  (const String &genre);
+        void setYear (uint year);
+        void setTrack(uint track);
+        void setTrackerName(const String &trackerName);
+
+      private:
+        Tag(const Tag &);
+        Tag &operator=(const Tag &);
+
+        class TagPrivate;
+        TagPrivate *d;
+    };
+  }
 }
 
 #endif