libgig  4.0.0
gig::Script Class Reference

Real-time instrument script (gig format extension). More...

#include <gig.h>

Public Types

enum  Encoding_t { ENCODING_ASCII = 0 }
 
enum  Compression_t { COMPRESSION_NONE = 0 }
 
enum  Language_t { LANGUAGE_NKSP = 0 }
 

Public Member Functions

String GetScriptAsText ()
 Returns the current script (i.e. More...
 
void SetScriptAsText (const String &text)
 Replaces the current script with the new script source code text given by text. More...
 
void SetGroup (ScriptGroup *pGroup)
 Move this script from its current ScriptGroup to another ScriptGroup given by pGroup. More...
 
ScriptGroupGetGroup () const
 Returns the script group this script currently belongs to. More...
 

Public Attributes

String Name
 Arbitrary name of the script, which may be displayed i.e. in an instrument editor. More...
 
Compression_t Compression
 Whether the script was/should be compressed, and if so, which compression algorithm shall be used. More...
 
Encoding_t Encoding
 Format the script's source code text is encoded with. More...
 
Language_t Language
 Programming language and dialect the script is written in. More...
 
bool Bypass
 Global bypass: if enabled, this script shall not be executed by the sampler for any instrument. More...
 

Protected Member Functions

 Script (ScriptGroup *group, RIFF::Chunk *ckScri)
 
virtual ~Script ()
 
void UpdateChunks (progress_t *pProgress)
 Apply this script to the respective RIFF chunks. More...
 
void RemoveAllScriptReferences ()
 

Friends

class ScriptGroup
 
class Instrument
 

Detailed Description

Real-time instrument script (gig format extension).

Real-time instrument scripts are user supplied small programs which can be used by instrument designers to create custom behaviors and features not available in the stock sampler engine. Features which might be very exotic or specific for the respective instrument.

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. Scripts will not load with the original GigaStudio software.

You find more informations about Instrument Scripts on the LinuxSampler documentation site:

Definition at line 991 of file gig.h.

Member Enumeration Documentation

◆ Compression_t

Enumerator
COMPRESSION_NONE 

Is not compressed at all (default).

Definition at line 996 of file gig.h.

◆ Encoding_t

Enumerator
ENCODING_ASCII 

Standard 8 bit US ASCII character encoding (default).

Definition at line 993 of file gig.h.

◆ Language_t

Enumerator
LANGUAGE_NKSP 

NKSP stands for "Is Not KSP" (default). Refer to the NKSP Reference Manual for details about this script language.

Definition at line 999 of file gig.h.

Constructor & Destructor Documentation

◆ Script()

gig::Script::Script ( ScriptGroup group,
RIFF::Chunk ckScri 
)
protected

◆ ~Script()

gig::Script::~Script ( )
protectedvirtual

Definition at line 4140 of file gig.cpp.

Member Function Documentation

◆ GetGroup()

ScriptGroup * gig::Script::GetGroup ( ) const

Returns the script group this script currently belongs to.

Each script is a member of exactly one ScriptGroup.

Returns
current script group

Definition at line 4224 of file gig.cpp.

◆ GetScriptAsText()

String gig::Script::GetScriptAsText ( )

Returns the current script (i.e.

as source code) in text format.

Definition at line 4146 of file gig.cpp.

◆ RemoveAllScriptReferences()

void gig::Script::RemoveAllScriptReferences ( )
protected

◆ SetGroup()

void gig::Script::SetGroup ( ScriptGroup pGroup)

Move this script from its current ScriptGroup to another ScriptGroup given by pGroup.

Parameters
pGroup- script's new group

Definition at line 4211 of file gig.cpp.

◆ SetScriptAsText()

void gig::Script::SetScriptAsText ( const String text)

Replaces the current script with the new script source code text given by text.

Parameters
text- new script source code

Definition at line 4159 of file gig.cpp.

◆ UpdateChunks()

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

Apply this script 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 4173 of file gig.cpp.

References CHUNK_ID_SCRI.

Friends And Related Function Documentation

◆ Instrument

friend class Instrument
friend

Definition at line 1019 of file gig.h.

◆ ScriptGroup

friend class ScriptGroup
friend

Definition at line 1018 of file gig.h.

Member Data Documentation

◆ Bypass

bool gig::Script::Bypass

Global bypass: if enabled, this script shall not be executed by the sampler for any instrument.

Definition at line 1007 of file gig.h.

◆ Compression

Compression_t gig::Script::Compression

Whether the script was/should be compressed, and if so, which compression algorithm shall be used.

Definition at line 1004 of file gig.h.

◆ Encoding

Encoding_t gig::Script::Encoding

Format the script's source code text is encoded with.

Definition at line 1005 of file gig.h.

◆ Language

Language_t gig::Script::Language

Programming language and dialect the script is written in.

Definition at line 1006 of file gig.h.

◆ Name

String gig::Script::Name

Arbitrary name of the script, which may be displayed i.e. in an instrument editor.

Definition at line 1003 of file gig.h.


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