--- libgig/trunk/src/DLS.h 2007/03/18 07:13:06 1102 +++ libgig/trunk/src/DLS.h 2007/05/27 13:54:24 1209 @@ -224,10 +224,10 @@ /** Defines Sample Loop Points. */ struct sample_loop_t { - uint32_t Size; - uint32_t LoopType; - uint32_t LoopStart; - uint32_t LoopLength; + uint32_t Size; ///< For internal usage only: usually reflects exactly @c sizeof(sample_loop_t), otherwise if the value is larger then the DLS format was extended! + uint32_t LoopType; ///< Defines how the waveform samples will be looped (appropriate loop types for the gig format are defined by gig::loop_type_t). + uint32_t LoopStart; ///< The start value specifies the offset (in sample points) in the waveform data of the first sample point to be played in the loop. + uint32_t LoopLength; ///< Length of the looping area (in sample points). }; // just symbol prototyping @@ -316,8 +316,13 @@ String SourceForm; ///< . Identifies the original form of the material that was digitized, such as record, sampling CD, TV sound track. This is not neccessarily the same as Medium. String Commissioned; ///< . Lists the name of the person or organization that commissioned the subject of the file, e.g., Pope Julian II. String Subject; ///< . Describes the contents of the file. - bool UseFixedLengthStrings; ///< Set this to true if the info strings should be stored with a fixed length format. This is used for gig files, not for ordinary DLS files. + bool UseFixedLengthStrings; ///< Deprecated. Use #FixedStringLengths instead. + struct FixedStringLength { + uint32_t chunkId; + int length; + }; + const FixedStringLength* FixedStringLengths; ///< List of IDs and string lengths for strings that should be stored in a fixed length format. This is used for gig files, not for ordinary DLS files. Info(RIFF::List* list); virtual ~Info(); virtual void UpdateChunks(); @@ -325,7 +330,7 @@ RIFF::List* pResourceListChunk; static void LoadString(uint32_t ChunkID, RIFF::List* lstINFO, String& s); - static void SaveString(uint32_t ChunkID, RIFF::List* lstINFO, const String& s, const String& sDefault, bool bUseFixedLengthStrings, int size); + void SaveString(uint32_t ChunkID, RIFF::List* lstINFO, const String& s, const String& sDefault); }; /** Abstract base class which encapsulates data structures which all DLS resources are able to provide. */ @@ -336,6 +341,7 @@ Resource* GetParent() { return pParent; }; virtual void UpdateChunks(); + void GenerateDLSID(); protected: Resource* pParent; RIFF::List* pResourceList; @@ -355,6 +361,8 @@ uint32_t SampleLoops; ///< Reflects the number of sample loops. sample_loop_t* pSampleLoops; ///< Points to the beginning of a sample loop array, or is NULL if there are no loops defined. + void AddSampleLoop(sample_loop_t* pLoopDef); + void DeleteSampleLoop(sample_loop_t* pLoopDef); virtual void UpdateChunks(); protected: RIFF::List* pParentList;