libgig  4.0.0
gig::ScriptGroup Class Reference

Group of instrument scripts (gig format extension). More...

#include <gig.h>

Public Member Functions

ScriptGetScript (uint index)
 Get instrument script. More...
 
ScriptAddScript ()
 Add new instrument script. More...
 
void DeleteScript (Script *pScript)
 Delete an instrument script. More...
 

Public Attributes

String Name
 Name of this script group. For example to be displayed in an instrument editor. More...
 

Protected Member Functions

 ScriptGroup (File *file, RIFF::List *lstRTIS)
 
virtual ~ScriptGroup ()
 
void LoadScripts ()
 
void UpdateChunks (progress_t *pProgress)
 Apply this script group to the respective RIFF chunks. More...
 

Friends

class Script
 
class File
 

Detailed Description

Group of instrument scripts (gig format extension).

This class is simply used to sort a bunch of real-time instrument scripts into individual groups. This allows instrument designers and script developers to keep scripts in a certain order while working with a larger amount of scripts in an instrument editor.

This is an extension of the GigaStudio format, thus a feature which was not available in the GigaStudio 4 software. It is currently only supported by LinuxSampler and gigedit.

Definition at line 1038 of file gig.h.

Constructor & Destructor Documentation

§ ScriptGroup()

gig::ScriptGroup::ScriptGroup ( File file,
RIFF::List lstRTIS 
)
protected

Definition at line 4211 of file gig.cpp.

References CHUNK_ID_LSNM, RIFF::List::GetSubChunk(), and sf2::LoadString().

§ ~ScriptGroup()

gig::ScriptGroup::~ScriptGroup ( )
protectedvirtual

Definition at line 4223 of file gig.cpp.

Member Function Documentation

§ AddScript()

Script * gig::ScriptGroup::AddScript ( )

Add new instrument script.

Adds a new real-time instrument script to the file. The script is not actually used / executed unless it is referenced by an instrument to be used. This is similar to samples, which you can add to a file, without an instrument necessarily actually using it.

You have to call Save() to make this persistent to the file.

Returns
new empty script object

Definition at line 4286 of file gig.cpp.

§ DeleteScript()

void gig::ScriptGroup::DeleteScript ( Script pScript)

Delete an instrument script.

This will delete the given real-time instrument script. References of instruments that are using that script will be removed accordingly.

You have to call Save() to make this persistent to the file.

Parameters
pScript- script to delete
Exceptions
gig::Exceptionif given script could not be found

Definition at line 4303 of file gig.cpp.

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

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

§ GetScript()

Script * gig::ScriptGroup::GetScript ( uint  index)

Get instrument script.

Returns the real-time instrument script with the given index.

Parameters
index- number of the sought script (0..n)
Returns
sought script or NULL if there's no such script

Definition at line 4267 of file gig.cpp.

Referenced by gig::File::DeleteScriptGroup(), and gig::Instrument::LoadScripts().

§ LoadScripts()

void gig::ScriptGroup::LoadScripts ( )
protected

Definition at line 4316 of file gig.cpp.

References CHUNK_ID_SCRI.

§ UpdateChunks()

void gig::ScriptGroup::UpdateChunks ( progress_t pProgress)
protected

Apply this script group to the respective RIFF 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

Definition at line 4244 of file gig.cpp.

References CHUNK_ID_LSNM, LIST_TYPE_3LS, and LIST_TYPE_RTIS.

Friends And Related Function Documentation

§ File

friend class File
friend

Definition at line 1051 of file gig.h.

§ Script

friend class Script
friend

Definition at line 1050 of file gig.h.

Member Data Documentation

§ Name

String gig::ScriptGroup::Name

Name of this script group. For example to be displayed in an instrument editor.

Definition at line 1040 of file gig.h.


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