2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file loader library * |
* libgig - C++ cross-platform Gigasampler format file loader library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2005 by Christian Schoenebeck * |
* Copyright (C) 2003-2006 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
130 |
/** Defines how the filter cutoff frequency is controlled by. */ |
/** Defines how the filter cutoff frequency is controlled by. */ |
131 |
typedef enum { |
typedef enum { |
132 |
vcf_cutoff_ctrl_none = 0x00, |
vcf_cutoff_ctrl_none = 0x00, |
133 |
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 |
134 |
vcf_cutoff_ctrl_modwheel = 0x81, ///< Modulation Wheel (MIDI Controller 1) |
vcf_cutoff_ctrl_modwheel = 0x81, ///< Modulation Wheel (MIDI Controller 1) |
135 |
vcf_cutoff_ctrl_effect1 = 0x8c, ///< Effect Controller 1 (Coarse, MIDI Controller 12) |
vcf_cutoff_ctrl_effect1 = 0x8c, ///< Effect Controller 1 (Coarse, MIDI Controller 12) |
136 |
vcf_cutoff_ctrl_effect2 = 0x8d, ///< Effect Controller 2 (Coarse, MIDI Controller 13) |
vcf_cutoff_ctrl_effect2 = 0x8d, ///< Effect Controller 2 (Coarse, MIDI Controller 13) |
240 |
* into the corresponding dimension bit number. |
* into the corresponding dimension bit number. |
241 |
*/ |
*/ |
242 |
typedef enum { |
typedef enum { |
243 |
split_type_normal, ///< dimension value between 0-127, no custom range of zones |
split_type_normal, ///< dimension value between 0-127 |
|
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) |
|
244 |
split_type_bit ///< dimension values are already the sought bit number |
split_type_bit ///< dimension values are already the sought bit number |
245 |
} split_type_t; |
} split_type_t; |
246 |
|
|
250 |
uint8_t bits; ///< Number of "bits" (1 bit = 2 splits/zones, 2 bit = 4 splits/zones, 3 bit = 8 splits/zones,...). |
uint8_t bits; ///< Number of "bits" (1 bit = 2 splits/zones, 2 bit = 4 splits/zones, 3 bit = 8 splits/zones,...). |
251 |
uint8_t zones; ///< Number of zones the dimension has. |
uint8_t zones; ///< Number of zones the dimension has. |
252 |
split_type_t split_type; ///< Intended for internal usage: will be used to convert a dimension value into the corresponding dimension bit number. |
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). |
|
253 |
float zone_size; ///< Intended for internal usage: reflects the size of each zone (128/zones) for normal split types only, 0 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); |
|
254 |
}; |
}; |
255 |
|
|
256 |
/** Defines which frequencies are filtered by the VCF. */ |
/** Defines which frequencies are filtered by the VCF. */ |
430 |
// overridden methods |
// overridden methods |
431 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
432 |
protected: |
protected: |
433 |
|
uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number. |
434 |
DimensionRegion(RIFF::List* _3ewl); |
DimensionRegion(RIFF::List* _3ewl); |
435 |
~DimensionRegion(); |
~DimensionRegion(); |
436 |
friend class Region; |
friend class Region; |
524 |
unsigned long SetPos(unsigned long SampleCount, RIFF::stream_whence_t Whence = RIFF::stream_start); |
unsigned long SetPos(unsigned long SampleCount, RIFF::stream_whence_t Whence = RIFF::stream_start); |
525 |
unsigned long GetPos(); |
unsigned long GetPos(); |
526 |
unsigned long Read(void* pBuffer, unsigned long SampleCount, buffer_t* pExternalDecompressionBuffer = NULL); |
unsigned long Read(void* pBuffer, unsigned long SampleCount, buffer_t* pExternalDecompressionBuffer = NULL); |
527 |
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); |
528 |
unsigned long Write(void* pBuffer, unsigned long SampleCount); |
unsigned long Write(void* pBuffer, unsigned long SampleCount); |
529 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
530 |
protected: |
protected: |
576 |
class Region : public DLS::Region { |
class Region : public DLS::Region { |
577 |
public: |
public: |
578 |
unsigned int Dimensions; ///< Number of defined dimensions, do not alter! |
unsigned int Dimensions; ///< Number of defined dimensions, do not alter! |
579 |
dimension_def_t pDimensionDefinitions[8]; ///< Defines the five (gig2) or eight (gig3) possible dimensions (the dimension's controller and number of bits/splits). Use AddDimension() and DeleteDimension() to create a new dimension ot delete an existing one. |
dimension_def_t pDimensionDefinitions[8]; ///< Defines the five (gig2) or eight (gig3) possible dimensions (the dimension's controller and number of bits/splits). Use AddDimension() and DeleteDimension() to create a new dimension or delete an existing one. |
580 |
uint32_t DimensionRegions; ///< Total number of DimensionRegions this Region contains, do not alter! |
uint32_t DimensionRegions; ///< Total number of DimensionRegions this Region contains, do not alter! |
581 |
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 ot delete an existing one (which will create or delete the respective dimension region(s) automatically). |
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). |
582 |
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! |
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! |
583 |
|
|
584 |
DimensionRegion* GetDimensionRegionByValue(const uint DimValues[8]); |
DimensionRegion* GetDimensionRegionByValue(const uint DimValues[8]); |
588 |
void DeleteDimension(dimension_def_t* pDimDef); |
void DeleteDimension(dimension_def_t* pDimDef); |
589 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
590 |
protected: |
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. |
|
|
|
|
591 |
Region(Instrument* pInstrument, RIFF::List* rgnList); |
Region(Instrument* pInstrument, RIFF::List* rgnList); |
592 |
void LoadDimensionRegions(RIFF::List* rgn); |
void LoadDimensionRegions(RIFF::List* rgn); |
593 |
void UpdateVelocityTable(dimension_def_t* pDimDef); |
void UpdateVelocityTable(); |
594 |
Sample* GetSampleFromWavePool(unsigned int WavePoolTableIndex, progress_t* pProgress = NULL); |
Sample* GetSampleFromWavePool(unsigned int WavePoolTableIndex, progress_t* pProgress = NULL); |
595 |
~Region(); |
~Region(); |
596 |
friend class Instrument; |
friend class Instrument; |
664 |
Instrument* GetInstrument(uint index, progress_t* pProgress = NULL); |
Instrument* GetInstrument(uint index, progress_t* pProgress = NULL); |
665 |
Instrument* AddInstrument(); |
Instrument* AddInstrument(); |
666 |
void DeleteInstrument(Instrument* pInstrument); |
void DeleteInstrument(Instrument* pInstrument); |
|
~File(); |
|
667 |
protected: |
protected: |
|
std::list<RIFF::File*> ExtensionFiles; |
|
|
|
|
668 |
// overridden protected methods from DLS::File |
// overridden protected methods from DLS::File |
669 |
virtual void LoadSamples(); |
virtual void LoadSamples(); |
670 |
virtual void LoadInstruments(); |
virtual void LoadInstruments(); |