/[svn]/libgig/trunk/src/SF.h
ViewVC logotype

Diff of /libgig/trunk/src/SF.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2016 by iliev, Tue Oct 27 18:34:06 2009 UTC revision 2020 by iliev, Fri Oct 30 16:25:27 2009 UTC
# Line 262  namespace sf2 { Line 262  namespace sf2 {
262              static void LoadString(uint32_t ChunkID, RIFF::List* lstINFO, String& s);              static void LoadString(uint32_t ChunkID, RIFF::List* lstINFO, String& s);
263      };      };
264    
265        class Region;
266    
267      class Sample {      class Sample {
268          public:          public:
269    
# Line 320  namespace sf2 { Line 322  namespace sf2 {
322              unsigned long ReadAndLoop (              unsigned long ReadAndLoop (
323                  void*           pBuffer,                  void*           pBuffer,
324                  unsigned long   FrameCount,                  unsigned long   FrameCount,
325                  PlaybackState*  pPlaybackState                  PlaybackState*  pPlaybackState,
326                    Region*         pRegion
327              );              );
328    
329          //protected:          //protected:
# Line 331  namespace sf2 { Line 334  namespace sf2 {
334          //private:          //private:
335              int ChannelCount; // 2 for left and right samples              int ChannelCount; // 2 for left and right samples
336    
337              uint32_t Start;     // in sample data points (frames)              uint32_t Start;     // in sample data points (frames) from the begining of the sample data field
338              uint32_t End;       // in sample data points (frames)              uint32_t End;       // in sample data points (frames) from the begining of the sample data field
339              uint32_t StartLoop; // in sample data points (frames)              uint32_t StartLoop; // in sample data points (frames) from the begining of the sample data field
340              uint32_t EndLoop;   // in sample data points (frames)              uint32_t EndLoop;   // in sample data points (frames) from the begining of the sample data field
341              uint32_t SampleRate;              uint32_t SampleRate;
342              uint8_t  OriginalPitch;              uint8_t  OriginalPitch;
343              uint8_t  PitchCorrection;              uint8_t  PitchCorrection;
# Line 356  namespace sf2 { Line 359  namespace sf2 {
359              int minVel, maxVel;              int minVel, maxVel;
360              int pan; // -64 - +63              int pan; // -64 - +63
361              int fineTune; // -99 - +99              int fineTune; // -99 - +99
362              int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset;              int coarseTune; // TODO:
363              int startloopAddrsOffset, endloopAddrsOffset;              int overridingRootKey; // represents the MIDI key number at which the sample is to be played back at its original sample rate.
364                int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset, endAddrsCoarseOffset;
365                int startloopAddrsOffset, startloopAddrsCoarseOffset, endloopAddrsOffset, endloopAddrsCoarseOffset;
366    
367              double EG1PreAttackDelay;              double EG1PreAttackDelay;
368              double EG1Attack;              double EG1Attack;
# Line 374  namespace sf2 { Line 379  namespace sf2 {
379              double EG2Release;              double EG2Release;
380    
381              Sample* pSample;              Sample* pSample;
382                bool    HasLoop;
383                uint    LoopStart; // index (in frames) from the beginning of the sample
384                uint    LoopEnd;   // index (in frames) from the beginning of the sample
385              Instrument* pInstrument; // used when the region belongs to preset              Instrument* pInstrument; // used when the region belongs to preset
386    
387              Region();              Region();
388              Sample* GetSample() { return pSample; }              Sample* GetSample() { return pSample; }
389              Region* GetParent() { return this; }              Region* GetParent() { return this; }
390    
391                int GetUnityNote();
392    
393              std::vector<ModulatorItem> modulators;              std::vector<ModulatorItem> modulators;
394    
395              friend class Instrument;              friend class Instrument;
# Line 415  namespace sf2 { Line 425  namespace sf2 {
425          public:          public:
426              Instrument(sf2::File* pFile, RIFF::Chunk* ck);              Instrument(sf2::File* pFile, RIFF::Chunk* ck);
427              ~Instrument();              ~Instrument();
428    
429                void DeleteRegion(Region* pRegion);
430          //private:          //private:
431              uint16_t InstBagNdx;              uint16_t InstBagNdx;
432                            
# Line 422  namespace sf2 { Line 434  namespace sf2 {
434               * Load all regions (zones, bags) in the range idx1 - idx2               * Load all regions (zones, bags) in the range idx1 - idx2
435               */               */
436              void LoadRegions(int idx1, int idx2);              void LoadRegions(int idx1, int idx2);
437    
438                Region* CreateRegion();
439      };      };
440    
441      class Preset : public InstrumentBase {      class Preset : public InstrumentBase {
# Line 456  namespace sf2 { Line 470  namespace sf2 {
470              Preset*      GetPreset(int idx);              Preset*      GetPreset(int idx);
471              int          GetInstrumentCount();              int          GetInstrumentCount();
472              Instrument*  GetInstrument(int idx);              Instrument*  GetInstrument(int idx);
473                void         DeleteInstrument(Instrument* pInstrument);
474              int          GetSampleCount();              int          GetSampleCount();
475              Sample*      GetSample(int idx);              Sample*      GetSample(int idx);
476              void         DeleteSample(Sample* pSample);              void         DeleteSample(Sample* pSample);

Legend:
Removed from v.2016  
changed lines
  Added in v.2020

  ViewVC Help
Powered by ViewVC