libgig  4.4.1
gig::ScriptGroup Class Reference

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

#include <gig.h>

Inheritance diagram for gig::ScriptGroup:
DLS::Storage

Public Member Functions

ScriptGetScript (size_t 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.
 

Protected Member Functions

 ScriptGroup (File *file, RIFF::List *lstRTIS)
 
void LoadScripts ()
 
virtual void UpdateChunks (progress_t *pProgress)
 Apply this script group to the respective RIFF chunks. More...
 
virtual void DeleteChunks ()
 Remove all RIFF chunks associated with this ScriptGroup object. More...
 

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

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

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

◆ DeleteChunks()

void gig::ScriptGroup::DeleteChunks ( )
protectedvirtual

Remove all RIFF chunks associated with this ScriptGroup object.

At the moment ScriptGroup::DeleteChunks() does nothing. It is recommended to call this method explicitly though from deriving classes's own overridden implementation of this method to avoid potential future compatiblity issues.

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

Implements DLS::Storage.

Definition at line 4823 of file gig.cpp.

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

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

References RIFF::List::DeleteSubChunk(), gig::Sample::FineTune, RIFF::List::GetListType(), RIFF::Chunk::GetParent(), RIFF::Chunk::GetPos(), RIFF::Chunk::GetSize(), RIFF::List::GetSubChunk(), RIFF::List::GetSubList(), RIFF::List::GetSubListAt(), DLS::range_t::high, DLS::Region::KeyRange, DLS::range_t::low, DLS::Resource::pInfo, RIFF::Chunk::ReadInt16(), RIFF::Chunk::ReadInt32(), RIFF::Chunk::ReadUint16(), RIFF::Chunk::ReadUint32(), RIFF::Chunk::ReadUint8(), DLS::Info::SetFixedStringLengths(), and RIFF::Chunk::SetPos().

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

◆ GetScript()

Script * gig::ScriptGroup::GetScript ( size_t  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 4858 of file gig.cpp.

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

◆ UpdateChunks()

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

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

Implements DLS::Storage.

Definition at line 4835 of file gig.cpp.


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