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

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

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

revision 929 by schoenebeck, Tue Oct 24 22:24:45 2006 UTC revision 930 by schoenebeck, Sun Oct 29 17:57:20 2006 UTC
# Line 496  namespace gig { Line 496  namespace gig {
496       */       */
497      class Sample : public DLS::Sample {      class Sample : public DLS::Sample {
498          public:          public:
             Group*         pGroup;            ///< pointer to the Group this sample belongs to, NULL otherwise  
499              uint32_t       Manufacturer;      ///< Specifies the MIDI Manufacturer's Association (MMA) Manufacturer code for the sampler intended to receive this file's waveform. If no particular manufacturer is to be specified, a value of 0 should be used.              uint32_t       Manufacturer;      ///< Specifies the MIDI Manufacturer's Association (MMA) Manufacturer code for the sampler intended to receive this file's waveform. If no particular manufacturer is to be specified, a value of 0 should be used.
500              uint32_t       Product;           ///< Specifies the MIDI model ID defined by the manufacturer corresponding to the Manufacturer field. If no particular manufacturer's product is to be specified, a value of 0 should be used.              uint32_t       Product;           ///< Specifies the MIDI model ID defined by the manufacturer corresponding to the Manufacturer field. If no particular manufacturer's product is to be specified, a value of 0 should be used.
501              uint32_t       SamplePeriod;      ///< Specifies the duration of time that passes during the playback of one sample in nanoseconds (normally equal to 1 / Samples Per Second, where Samples Per Second is the value found in the format chunk), don't bother to update this attribute, it won't be saved.              uint32_t       SamplePeriod;      ///< Specifies the duration of time that passes during the playback of one sample in nanoseconds (normally equal to 1 / Samples Per Second, where Samples Per Second is the value found in the format chunk), don't bother to update this attribute, it won't be saved.
# Line 533  namespace gig { Line 532  namespace gig {
532              unsigned long Read(void* pBuffer, unsigned long SampleCount, buffer_t* pExternalDecompressionBuffer = NULL);              unsigned long Read(void* pBuffer, unsigned long SampleCount, buffer_t* pExternalDecompressionBuffer = NULL);
533              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);
534              unsigned long Write(void* pBuffer, unsigned long SampleCount);              unsigned long Write(void* pBuffer, unsigned long SampleCount);
535                Group*        GetGroup() const;
536              virtual void  UpdateChunks();              virtual void  UpdateChunks();
537          protected:          protected:
538              static unsigned int  Instances;               ///< Number of instances of class Sample.              static unsigned int  Instances;               ///< Number of instances of class Sample.
539              static buffer_t      InternalDecompressionBuffer; ///< Buffer used for decompression as well as for truncation of 24 Bit -> 16 Bit samples.              static buffer_t      InternalDecompressionBuffer; ///< Buffer used for decompression as well as for truncation of 24 Bit -> 16 Bit samples.
540                Group*               pGroup;                  ///< pointer to the Group this sample belongs to (always not-NULL)
541              unsigned long        FrameOffset;             ///< Current offset (sample points) in current sample frame (for decompression only).              unsigned long        FrameOffset;             ///< Current offset (sample points) in current sample frame (for decompression only).
542              unsigned long*       FrameTable;              ///< For positioning within compressed samples only: stores the offset values for each frame.              unsigned long*       FrameTable;              ///< For positioning within compressed samples only: stores the offset values for each frame.
543              unsigned long        SamplePos;               ///< For compressed samples only: stores the current position (in sample points).              unsigned long        SamplePos;               ///< For compressed samples only: stores the current position (in sample points).
# Line 576  namespace gig { Line 577  namespace gig {
577              void ScanCompressedSample();              void ScanCompressedSample();
578              friend class File;              friend class File;
579              friend class Region;              friend class Region;
580                friend class Group; // allow to modify protected member pGroup
581      };      };
582    
583      // TODO: <3dnl> list not used yet - not important though (just contains optional descriptions for the dimensions)      // TODO: <3dnl> list not used yet - not important though (just contains optional descriptions for the dimensions)
# Line 654  namespace gig { Line 656  namespace gig {
656       * At the moment, it seems as only samples can be grouped together in       * At the moment, it seems as only samples can be grouped together in
657       * the Gigasampler format yet. If this is false in the meantime, please       * the Gigasampler format yet. If this is false in the meantime, please
658       * tell us !       * tell us !
659         *
660         * A sample is always assigned to exactly one Group. This also means
661         * there is always at least one Group in a .gig file, no matter if you
662         * created one yet or not.
663       */       */
664      class Group {      class Group {
665          public:          public:
666              String Name; ///< Stores the name of this Group.              String Name; ///< Stores the name of this Group.
667    
668                Sample* GetFirstSample();
669                Sample* GetNextSample();
670                void AddSample(Sample* pSample);
671          protected:          protected:
672              Group(RIFF::File* file, RIFF::Chunk* ck3gnm);              Group(File* file, RIFF::Chunk* ck3gnm);
673              virtual ~Group();              virtual ~Group();
674              virtual void UpdateChunks();              virtual void UpdateChunks();
675                void MoveAll();
676              friend class File;              friend class File;
677          private:          private:
678              RIFF::File*  pFile;              File*        pFile;
679              RIFF::Chunk* pNameChunk;              RIFF::Chunk* pNameChunk;
680      };      };
681    
# Line 710  namespace gig { Line 721  namespace gig {
721              virtual void LoadInstruments(progress_t* pProgress);              virtual void LoadInstruments(progress_t* pProgress);
722              friend class Region;              friend class Region;
723              friend class Sample;              friend class Sample;
724                friend class Group; // so Group can access protected member pRIFF
725          private:          private:
726              std::list<Group*>*          pGroups;              std::list<Group*>*          pGroups;
727              std::list<Group*>::iterator GroupsIterator;              std::list<Group*>::iterator GroupsIterator;

Legend:
Removed from v.929  
changed lines
  Added in v.930

  ViewVC Help
Powered by ViewVC