libgig  3.3.0.svn4
gig::Group Class Reference

Group of Gigasampler objects. More...

#include <gig.h>

Public Member Functions

SampleGetFirstSample ()
 Returns the first Sample of this Group. More...
 
SampleGetNextSample ()
 Returns the next Sample of the Group. More...
 
void AddSample (Sample *pSample)
 Move Sample given by pSample from another Group to this Group. More...
 

Public Attributes

String Name
 Stores the name of this Group. More...
 

Protected Member Functions

 Group (File *file, RIFF::Chunk *ck3gnm)
 Constructor. More...
 
virtual ~Group ()
 
virtual void UpdateChunks ()
 Update chunks with current group settings. More...
 
void MoveAll ()
 Move all members of this group to another group (preferably the 1st one except this). More...
 

Friends

class File
 

Detailed Description

Group of Gigasampler objects.

Groups help to organize a huge collection of Gigasampler objects. Groups are not concerned at all for the synthesis, but they help sound library developers when working on complex instruments with an instrument editor (as long as that instrument editor supports it ;-).

At the moment, it seems as only samples can be grouped together in the Gigasampler format yet. If this is false in the meantime, please tell us !

A sample is always assigned to exactly one Group. This also means there is always at least one Group in a .gig file, no matter if you created one yet or not.

Definition at line 729 of file gig.h.

Constructor & Destructor Documentation

gig::Group::Group ( File file,
RIFF::Chunk ck3gnm 
)
protected

Constructor.

Parameters
file- pointer to the gig::File object
ck3gnm- pointer to 3gnm chunk associated with this group or NULL if this is a new Group

Definition at line 3297 of file gig.cpp.

References sf2::LoadString(), and Name.

gig::Group::~Group ( )
protectedvirtual

Definition at line 3303 of file gig.cpp.

References RIFF::List::DeleteSubChunk(), and RIFF::Chunk::GetParent().

Member Function Documentation

void gig::Group::AddSample ( Sample pSample)

Move Sample given by pSample from another Group to this Group.

Definition at line 3380 of file gig.cpp.

References gig::Sample::pGroup.

Referenced by MoveAll().

Sample * gig::Group::GetFirstSample ( )

Returns the first Sample of this Group.

You have to call this method once before you use GetNextSample().

Notice: this method might block for a long time, in case the samples of this .gig file were not scanned yet

Returns
pointer address to first Sample or NULL if there is none applied to this Group
See Also
GetNextSample()

Definition at line 3351 of file gig.cpp.

References gig::File::GetFirstSample(), and gig::File::GetNextSample().

Referenced by gig::File::DeleteGroup(), and MoveAll().

Sample * gig::Group::GetNextSample ( )

Returns the next Sample of the Group.

You have to call GetFirstSample() once before you can use this method. By calling this method multiple times it iterates through the Samples assigned to this Group.

Returns
pointer address to the next Sample of this Group or NULL if end reached
See Also
GetFirstSample()

Definition at line 3369 of file gig.cpp.

References gig::File::GetNextSample().

Referenced by gig::File::DeleteGroup(), and MoveAll().

void gig::Group::MoveAll ( )
protected

Move all members of this group to another group (preferably the 1st one except this).

This method is called explicitly by File::DeleteGroup() thus when a Group was deleted. This code was intentionally not placed in the destructor!

Definition at line 3390 of file gig.cpp.

References AddSample(), gig::File::GetFirstGroup(), GetFirstSample(), gig::File::GetNextGroup(), and GetNextSample().

Referenced by gig::File::DeleteGroupOnly().

void gig::Group::UpdateChunks ( )
protectedvirtual

Update chunks with current group settings.

Apply current Group field values to the respective chunks. You have to call File::Save() to make changes persistent.

Usually there is absolutely no need to call this method explicitly. It will be called automatically when File::Save() was called.

Definition at line 3316 of file gig.cpp.

References RIFF::List::AddSubList(), CHUNK_ID_3GNM, CHUNK_ID_PTBL, RIFF::List::GetFirstSubChunk(), RIFF::List::GetNextSubChunk(), RIFF::List::GetSubChunk(), RIFF::List::GetSubList(), LIST_TYPE_3GNL, LIST_TYPE_3GRI, DLS::version_t::major, RIFF::List::MoveSubChunk(), Name, DLS::File::pRIFF, and DLS::File::pVersion.

Friends And Related Function Documentation

friend class File
friend

Definition at line 741 of file gig.h.

Member Data Documentation

String gig::Group::Name

Stores the name of this Group.

Definition at line 731 of file gig.h.

Referenced by Group(), gig::File::LoadGroups(), and UpdateChunks().


The documentation for this class was generated from the following files: