69 |
namespace gig { |
namespace gig { |
70 |
|
|
71 |
typedef std::string String; |
typedef std::string String; |
72 |
|
typedef RIFF::progress_t progress_t; |
73 |
|
|
74 |
/** Lower and upper limit of a range. */ |
/** Lower and upper limit of a range. */ |
75 |
struct range_t { |
struct range_t { |
312 |
unsigned long loop_cycles_left; ///< How many times the loop has still to be passed, this value will be decremented with each loop cycle. |
unsigned long loop_cycles_left; ///< How many times the loop has still to be passed, this value will be decremented with each loop cycle. |
313 |
}; |
}; |
314 |
|
|
|
/** |
|
|
* @brief Used for indicating the progress of a certain task. |
|
|
* |
|
|
* The function pointer argument has to be supplied with a valid |
|
|
* function of the given signature which will then be called on |
|
|
* progress changes. An equivalent progress_t structure will be passed |
|
|
* back as argument to the callback function on each progress change. |
|
|
* The factor field of the supplied progress_t structure will then |
|
|
* reflect the current progress as value between 0.0 and 1.0. You might |
|
|
* want to use the custom field for data needed in your callback |
|
|
* function. |
|
|
*/ |
|
|
struct progress_t { |
|
|
void (*callback)(progress_t*); ///< Callback function pointer which has to be assigned to a function for progress notification. |
|
|
float factor; ///< Reflects current progress as value between 0.0 and 1.0. |
|
|
void* custom; ///< This pointer can be used for arbitrary data. |
|
|
float __range_min; ///< Only for internal usage, do not modify! |
|
|
float __range_max; ///< Only for internal usage, do not modify! |
|
|
progress_t(); |
|
|
}; |
|
|
|
|
315 |
// just symbol prototyping |
// just symbol prototyping |
316 |
class File; |
class File; |
317 |
class Instrument; |
class Instrument; |
447 |
using DLS::Sampler::DeleteSampleLoop; |
using DLS::Sampler::DeleteSampleLoop; |
448 |
// overridden methods |
// overridden methods |
449 |
virtual void SetGain(int32_t gain); |
virtual void SetGain(int32_t gain); |
450 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(progress_t* pProgress); |
451 |
virtual void CopyAssign(const DimensionRegion* orig); |
virtual void CopyAssign(const DimensionRegion* orig); |
452 |
protected: |
protected: |
453 |
uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number. |
uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number. |
627 |
unsigned long ReadAndLoop(void* pBuffer, unsigned long SampleCount, playback_state_t* pPlaybackState, DimensionRegion* pDimRgn, buffer_t* pExternalDecompressionBuffer = NULL); |
unsigned long ReadAndLoop(void* pBuffer, unsigned long SampleCount, playback_state_t* pPlaybackState, DimensionRegion* pDimRgn, buffer_t* pExternalDecompressionBuffer = NULL); |
628 |
unsigned long Write(void* pBuffer, unsigned long SampleCount); |
unsigned long Write(void* pBuffer, unsigned long SampleCount); |
629 |
Group* GetGroup() const; |
Group* GetGroup() const; |
630 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(progress_t* pProgress); |
631 |
void CopyAssignMeta(const Sample* orig); |
void CopyAssignMeta(const Sample* orig); |
632 |
void CopyAssignWave(const Sample* orig); |
void CopyAssignWave(const Sample* orig); |
633 |
protected: |
protected: |
712 |
dimension_def_t* GetDimensionDefinition(dimension_t type); |
dimension_def_t* GetDimensionDefinition(dimension_t type); |
713 |
void DeleteDimensionZone(dimension_t type, int zone); |
void DeleteDimensionZone(dimension_t type, int zone); |
714 |
void SplitDimensionZone(dimension_t type, int zone); |
void SplitDimensionZone(dimension_t type, int zone); |
715 |
|
void SetDimensionType(dimension_t oldType, dimension_t newType); |
716 |
// overridden methods |
// overridden methods |
717 |
virtual void SetKeyRange(uint16_t Low, uint16_t High); |
virtual void SetKeyRange(uint16_t Low, uint16_t High); |
718 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(progress_t* pProgress); |
719 |
virtual void CopyAssign(const Region* orig); |
virtual void CopyAssign(const Region* orig); |
720 |
protected: |
protected: |
721 |
Region(Instrument* pInstrument, RIFF::List* rgnList); |
Region(Instrument* pInstrument, RIFF::List* rgnList); |
865 |
protected: |
protected: |
866 |
Script(ScriptGroup* group, RIFF::Chunk* ckScri); |
Script(ScriptGroup* group, RIFF::Chunk* ckScri); |
867 |
virtual ~Script(); |
virtual ~Script(); |
868 |
void UpdateChunks(); |
void UpdateChunks(progress_t* pProgress); |
869 |
void RemoveAllScriptReferences(); |
void RemoveAllScriptReferences(); |
870 |
friend class ScriptGroup; |
friend class ScriptGroup; |
871 |
friend class Instrument; |
friend class Instrument; |
898 |
ScriptGroup(File* file, RIFF::List* lstRTIS); |
ScriptGroup(File* file, RIFF::List* lstRTIS); |
899 |
virtual ~ScriptGroup(); |
virtual ~ScriptGroup(); |
900 |
void LoadScripts(); |
void LoadScripts(); |
901 |
void UpdateChunks(); |
void UpdateChunks(progress_t* pProgress); |
902 |
friend class Script; |
friend class Script; |
903 |
friend class File; |
friend class File; |
904 |
private: |
private: |
936 |
Region* GetNextRegion(); |
Region* GetNextRegion(); |
937 |
Region* AddRegion(); |
Region* AddRegion(); |
938 |
void DeleteRegion(Region* pRegion); |
void DeleteRegion(Region* pRegion); |
939 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(progress_t* pProgress); |
940 |
virtual void CopyAssign(const Instrument* orig); |
virtual void CopyAssign(const Instrument* orig); |
941 |
// own methods |
// own methods |
942 |
Region* GetRegion(unsigned int Key); |
Region* GetRegion(unsigned int Key); |
962 |
void CopyAssign(const Instrument* orig, const std::map<Sample*,Sample*>* mSamples); |
void CopyAssign(const Instrument* orig, const std::map<Sample*,Sample*>* mSamples); |
963 |
void UpdateRegionKeyTable(); |
void UpdateRegionKeyTable(); |
964 |
void LoadScripts(); |
void LoadScripts(); |
965 |
|
void UpdateScriptFileOffsets(); |
966 |
friend class File; |
friend class File; |
967 |
friend class Region; // so Region can call UpdateRegionKeyTable() |
friend class Region; // so Region can call UpdateRegionKeyTable() |
968 |
private: |
private: |
1004 |
protected: |
protected: |
1005 |
Group(File* file, RIFF::Chunk* ck3gnm); |
Group(File* file, RIFF::Chunk* ck3gnm); |
1006 |
virtual ~Group(); |
virtual ~Group(); |
1007 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(progress_t* pProgress); |
1008 |
void MoveAll(); |
void MoveAll(); |
1009 |
friend class File; |
friend class File; |
1010 |
private: |
private: |
1060 |
ScriptGroup* AddScriptGroup(); |
ScriptGroup* AddScriptGroup(); |
1061 |
void DeleteScriptGroup(ScriptGroup* pGroup); |
void DeleteScriptGroup(ScriptGroup* pGroup); |
1062 |
virtual ~File(); |
virtual ~File(); |
1063 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(progress_t* pProgress); |
1064 |
protected: |
protected: |
1065 |
// overridden protected methods from DLS::File |
// overridden protected methods from DLS::File |
1066 |
virtual void LoadSamples(); |
virtual void LoadSamples(); |
1067 |
virtual void LoadInstruments(); |
virtual void LoadInstruments(); |
1068 |
virtual void LoadGroups(); |
virtual void LoadGroups(); |
1069 |
|
virtual void UpdateFileOffsets(); |
1070 |
// own protected methods |
// own protected methods |
1071 |
virtual void LoadSamples(progress_t* pProgress); |
virtual void LoadSamples(progress_t* pProgress); |
1072 |
virtual void LoadInstruments(progress_t* pProgress); |
virtual void LoadInstruments(progress_t* pProgress); |