gig::Group Class Reference

Group of Gigasampler samples. More...

`#include <gig.h>`

Inheritance diagram for gig::Group:

## Public Member Functions

Sample * | GetSample (size_t index)
| Returns Sample object at index of this sample group.
Sample * | GetFirstSample ()
| Returns the first Sample of this Group.
Sample * | GetNextSample ()
| Returns the next Sample of the Group.
void | AddSample (Sample *pSample)
| Move Sample given by pSample from another Group to this Group.

## Public Attributes

String | Name
| Stores the name of this Group.

## Protected Member Functions

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

## Detailed Description

Group of Gigasampler samples.

Groups help to organize a huge collection of Gigasampler samples. 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 ;-).

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 1365 of file gig.h.

## Constructor & Destructor Documentation

## Group()

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 6071 of file gig.cpp.

References Group(), and Name.

Referenced by Group(), and MoveAll().

## ~Group()

gig::Group::~Group | ( |  | ) |

protected virtual

Destructor.

Currently this destructor implementation does nothing.

Definition at line 6082 of file gig.cpp.

References ~Group().

Referenced by ~Group().

## Member Function Documentation

## AddSample()

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

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

Definition at line 6203 of file gig.cpp.

References AddSample(), and gig::Sample::pGroup.

Referenced by AddSample(), and MoveAll().

## DeleteChunks()

void gig::Group::DeleteChunks | ( |  | ) |

protected virtual

Remove all RIFF chunks associated with this Group object.

See DLS::Storage::DeleteChunks() for details.

Implements DLS::Storage.

Definition at line 6089 of file gig.cpp.

References DeleteChunks().

Referenced by DeleteChunks(), gig::File::DeleteGroup(), and gig::File::DeleteGroupOnly().

## GetFirstSample()

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()

Deprecated
  This method is not reentrant-safe, use GetSample() instead.

Definition at line 6165 of file gig.cpp.

References GetFirstSample().

Referenced by GetFirstSample().

## GetNextSample()

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()

Deprecated
  This method is not reentrant-safe, use GetSample() instead.

Definition at line 6189 of file gig.cpp.

References GetNextSample().

Referenced by GetNextSample().

## GetSample()

Sample * gig::Group::GetSample | ( | size_t | index | ) |

Returns Sample object at index of this sample group.

Parameters

  index | - position of sample in this sample group's sample list (0..n)

Returns
  sample object or NULL if index is out of bounds

Definition at line 6139 of file gig.cpp.

References GetSample().

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

## 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 6213 of file gig.cpp.

References AddSample(), GetSample(), Group(), and MoveAll().

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

## UpdateChunks()

void gig::Group::UpdateChunks | ( | progress_t * | pProgress | ) |

protected virtual

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.

Parameters

  pProgress | - callback function for progress notification

Implements DLS::Storage.

Definition at line 6107 of file gig.cpp.

References RIFF::List::AddSubList(), RIFF::List::GetSubChunk(), RIFF::List::GetSubChunkAt(), RIFF::List::GetSubList(), RIFF::List::MoveSubChunk(), Name, and UpdateChunks().

Referenced by UpdateChunks().

## Member Data Documentation

## Name

String gig::Group::Name

Stores the name of this Group.

Definition at line 1367 of file gig.h.

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

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

- gig.h
- gig.cpp