--- libgig/trunk/src/gig.h 2005/11/22 11:26:55 809 +++ libgig/trunk/src/gig.h 2006/05/14 07:15:38 864 @@ -130,7 +130,7 @@ /** Defines how the filter cutoff frequency is controlled by. */ typedef enum { vcf_cutoff_ctrl_none = 0x00, - vcf_cutoff_ctrl_none2 = 0x01, ///< The difference betwheen none and none2 is unknown + vcf_cutoff_ctrl_none2 = 0x01, ///< The difference between none and none2 is unknown vcf_cutoff_ctrl_modwheel = 0x81, ///< Modulation Wheel (MIDI Controller 1) vcf_cutoff_ctrl_effect1 = 0x8c, ///< Effect Controller 1 (Coarse, MIDI Controller 12) vcf_cutoff_ctrl_effect2 = 0x8d, ///< Effect Controller 2 (Coarse, MIDI Controller 13) @@ -240,8 +240,7 @@ * into the corresponding dimension bit number. */ typedef enum { - split_type_normal, ///< dimension value between 0-127, no custom range of zones - split_type_customvelocity, ///< a velocity dimension split with custom range definition for each zone (if a velocity dimension split has no custom defined zone ranges then it's also just of type split_type_normal) + split_type_normal, ///< dimension value between 0-127 split_type_bit ///< dimension values are already the sought bit number } split_type_t; @@ -251,10 +250,7 @@ uint8_t bits; ///< Number of "bits" (1 bit = 2 splits/zones, 2 bit = 4 splits/zones, 3 bit = 8 splits/zones,...). uint8_t zones; ///< Number of zones the dimension has. split_type_t split_type; ///< Intended for internal usage: will be used to convert a dimension value into the corresponding dimension bit number. - range_t* ranges; ///< Intended for internal usage: Points to the beginning of a range_t array which reflects the value ranges of each dimension zone (only if custom defined ranges are defined, is NULL otherwise). float zone_size; ///< Intended for internal usage: reflects the size of each zone (128/zones) for normal split types only, 0 otherwise. - - dimension_def_t& operator=(const dimension_def_t& arg); }; /** Defines which frequencies are filtered by the VCF. */ @@ -434,6 +430,7 @@ // overridden methods 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(); friend class Region; @@ -527,7 +524,7 @@ unsigned long SetPos(unsigned long SampleCount, RIFF::stream_whence_t Whence = RIFF::stream_start); unsigned long GetPos(); unsigned long Read(void* pBuffer, unsigned long SampleCount, buffer_t* pExternalDecompressionBuffer = NULL); - unsigned long ReadAndLoop(void* pBuffer, unsigned long SampleCount, playback_state_t* pPlaybackState, buffer_t* pExternalDecompressionBuffer = NULL); + unsigned long ReadAndLoop(void* pBuffer, unsigned long SampleCount, playback_state_t* pPlaybackState, DimensionRegion* pDimRgn, buffer_t* pExternalDecompressionBuffer = NULL); unsigned long Write(void* pBuffer, unsigned long SampleCount); virtual void UpdateChunks(); protected: @@ -591,14 +588,9 @@ void DeleteDimension(dimension_def_t* pDimDef); virtual void UpdateChunks(); protected: - typedef std::list DimensionList; - - 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. - DimensionList DimensionDefinitions; - Region(Instrument* pInstrument, RIFF::List* rgnList); void LoadDimensionRegions(RIFF::List* rgn); - void UpdateVelocityTable(dimension_def_t* pDimDef); + void UpdateVelocityTable(); Sample* GetSampleFromWavePool(unsigned int WavePoolTableIndex, progress_t* pProgress = NULL); ~Region(); friend class Instrument; @@ -637,9 +629,7 @@ // own methods Region* GetRegion(unsigned int Key); protected: - Region** pRegions; ///< Pointer array to the regions Region* RegionKeyTable[128]; ///< fast lookup for the corresponding Region of a MIDI key - int RegionIndex; Instrument(File* pFile, RIFF::List* insList, progress_t* pProgress = NULL); ~Instrument(); @@ -674,21 +664,14 @@ Instrument* GetInstrument(uint index, progress_t* pProgress = NULL); Instrument* AddInstrument(); void DeleteInstrument(Instrument* pInstrument); - ~File(); protected: - typedef std::list SampleList; - typedef std::list InstrumentList; - - SampleList* pSamples; - SampleList::iterator SamplesIterator; - InstrumentList* pInstruments; - InstrumentList::iterator InstrumentsIterator; - - void LoadSamples(progress_t* pProgress = NULL); - void LoadInstruments(progress_t* pProgress = NULL); + // overridden protected methods from DLS::File + virtual void LoadSamples(); + virtual void LoadInstruments(); + // own protected methods + virtual void LoadSamples(progress_t* pProgress); + virtual void LoadInstruments(progress_t* pProgress); friend class Region; - - std::list ExtensionFiles; }; /** Will be thrown whenever a gig specific error occurs while trying to access a Gigasampler File. */