--- libgig/trunk/src/gig.h 2007/05/26 13:59:40 1207 +++ libgig/trunk/src/gig.h 2007/09/09 21:22:58 1335 @@ -470,6 +470,7 @@ double GetVelocityAttenuation(uint8_t MIDIKeyVelocity); double GetVelocityRelease(uint8_t MIDIKeyVelocity); double GetVelocityCutoff(uint8_t MIDIKeyVelocity); + Region* GetParent() const; // derived methods DLS::Sampler::AddSampleLoop; DLS::Sampler::DeleteSampleLoop; @@ -477,7 +478,8 @@ virtual void UpdateChunks(); protected: uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number. - DimensionRegion(RIFF::List* _3ewl); + DimensionRegion(Region* pParent, RIFF::List* _3ewl); + DimensionRegion(RIFF::List* _3ewl, const DimensionRegion& src); ~DimensionRegion(); friend class Region; private: @@ -516,6 +518,7 @@ double* pVelocityAttenuationTable; ///< Points to the velocity table corresponding to the velocity parameters of this DimensionRegion. double* pVelocityReleaseTable; ///< Points to the velocity table corresponding to the release velocity parameters of this DimensionRegion double* pVelocityCutoffTable; ///< Points to the velocity table corresponding to the filter velocity parameters of this DimensionRegion + Region* pRegion; leverage_ctrl_t DecodeLeverageController(_lev_ctrl_t EncodedController); _lev_ctrl_t EncodeLeverageController(leverage_ctrl_t DecodedController); @@ -635,11 +638,14 @@ 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). Use AddDimension() and DeleteDimension() to create a new dimension or delete an existing one (which will create or delete the respective dimension region(s) automatically). 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. Do not alter this value! + // own methods DimensionRegion* GetDimensionRegionByValue(const uint DimValues[8]); DimensionRegion* GetDimensionRegionByBit(const uint8_t DimBits[8]); Sample* GetSample(); void AddDimension(dimension_def_t* pDimDef); void DeleteDimension(dimension_def_t* pDimDef); + // overridden methods + virtual void SetKeyRange(uint16_t Low, uint16_t High); virtual void UpdateChunks(); protected: Region(Instrument* pInstrument, RIFF::List* rgnList); @@ -674,8 +680,6 @@ // derived methods from DLS::Resource DLS::Resource::GetParent; - // derived methods from DLS::Instrument - DLS::Instrument::MoveRegion; // overridden methods Region* GetFirstRegion(); Region* GetNextRegion(); @@ -691,6 +695,7 @@ ~Instrument(); void UpdateRegionKeyTable(); friend class File; + friend class Region; // so Region can call UpdateRegionKeyTable() }; /** @brief Group of Gigasampler objects