libgig  3.3.0.19svn2660
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 ()
 

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

Constructor & Destructor Documentation

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

Definition at line 4230 of file gig.cpp.

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

gig::ScriptGroup::~ScriptGroup ( )
protectedvirtual

Definition at line 4242 of file gig.cpp.

Member Function Documentation

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

References LoadScripts(), and Script.

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

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

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

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

References LoadScripts().

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

void gig::ScriptGroup::LoadScripts ( )
protected
void gig::ScriptGroup::UpdateChunks ( )
protected

Friends And Related Function Documentation

friend class File
friend

Definition at line 923 of file gig.h.

friend class Script
friend

Definition at line 922 of file gig.h.

Referenced by AddScript(), and LoadScripts().

Member Data Documentation

String gig::ScriptGroup::Name

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

Definition at line 912 of file gig.h.

Referenced by ScriptGroup(), and UpdateChunks().


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