--- libgig/trunk/src/gig.h 2004/11/21 18:02:21 308 +++ libgig/trunk/src/gig.h 2005/01/23 20:47:18 347 @@ -274,18 +274,25 @@ vcf_type_bandreject = 0x03 } vcf_type_t; - /** Defines the envelope of a crossfade. */ + /** + * Defines the envelope of a crossfade. + * + * Note: The default value for crossfade points is 0,0,0,0. Layers with + * such a default value should be treated as if they would not have a + * crossfade, that is the crossfade volume factor should always + * be 1.0f for such layers. + */ struct crossfade_t { #if WORDS_BIGENDIAN - uint8_t in_start; ///< Start position of fade in. - uint8_t in_end; ///< End position of fade in. - uint8_t out_start; ///< Start position of fade out. - uint8_t out_end; ///< End postition of fade out. - #else // little endian uint8_t out_end; ///< End postition of fade out. uint8_t out_start; ///< Start position of fade out. uint8_t in_end; ///< End position of fade in. uint8_t in_start; ///< Start position of fade in. + #else // little endian + uint8_t in_start; ///< Start position of fade in. + uint8_t in_end; ///< End position of fade in. + uint8_t out_start; ///< Start position of fade out. + uint8_t out_end; ///< End postition of fade out. #endif // WORDS_BIGENDIAN }; @@ -300,6 +307,7 @@ class File; class Instrument; class Sample; + class Region; /** Encapsulates articulation information of a dimension region. * @@ -564,13 +572,13 @@ class Region : public DLS::Region { public: unsigned int Dimensions; ///< Number of defined dimensions. - dimension_def_t pDimensionDefinitions[5]; ///< Defines the five possible dimensions (the dimension's controller and number of bits/splits). + dimension_def_t pDimensionDefinitions[8]; ///< Defines the five (gig2) or eight (gig3) possible dimensions (the dimension's controller and number of bits/splits). uint32_t DimensionRegions; ///< Total number of DimensionRegions this Region contains. - DimensionRegion* pDimensionRegions[32]; ///< Pointer array to the 32 possible dimension regions (reflects NULL for dimension regions not in use). Avoid to access the array directly and better use GetDimensionRegionByValue() instead, but of course in some cases it makes sense to use the array (e.g. iterating through all DimensionRegions). + DimensionRegion* pDimensionRegions[256]; ///< Pointer array to the 32 (gig2) or 256 (gig3) possible dimension regions (reflects NULL for dimension regions not in use). Avoid to access the array directly and better use GetDimensionRegionByValue() instead, but of course in some cases it makes sense to use the array (e.g. iterating through all DimensionRegions). unsigned int Layers; ///< Amount of defined layers (1 - 32). A value of 1 actually means no layering, a value > 1 means there is Layer dimension. The same information can of course also be obtained by accessing pDimensionDefinitions. - DimensionRegion* GetDimensionRegionByValue(uint Dim4Val, uint Dim3Val, uint Dim2Val, uint Dim1Val, uint Dim0Val); - DimensionRegion* GetDimensionRegionByBit(uint8_t Dim4Bit, uint8_t Dim3Bit, uint8_t Dim2Bit, uint8_t Dim1Bit, uint8_t Dim0Bit); + DimensionRegion* GetDimensionRegionByValue(const uint DimValues[8]); + DimensionRegion* GetDimensionRegionByBit(const uint8_t DimBits[8]); Sample* GetSample(); protected: uint8_t VelocityTable[128]; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number.