libgig 4.4.1
|
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. | |
void | SetScriptAsText (const String &text) |
Replaces the current script with the new script source code text given by text. | |
void | SetGroup (ScriptGroup *pGroup) |
Move this script from its current ScriptGroup to another ScriptGroup given by pGroup. | |
ScriptGroup * | GetGroup () const |
Returns the script group this script currently belongs to. | |
void | CopyAssign (const Script *orig) |
Make a (semi) deep copy of the Script object given by orig and assign it to this object. | |
Public Attributes | |
String | Name |
Arbitrary name of the script, which may be displayed i.e. in an instrument editor. | |
Compression_t | Compression |
Whether the script was/should be compressed, and if so, which compression algorithm shall be used. | |
Encoding_t | Encoding |
Format the script's source code text is encoded with. | |
Language_t | Language |
Programming language and dialect the script is written in. | |
bool | Bypass |
Global bypass: if enabled, this script shall not be executed by the sampler for any instrument. | |
uint8_t | Uuid [16] |
Persistent Universally Unique Identifier of this script, which remains identical after any changes to this script. | |
Protected Member Functions | |
Script (ScriptGroup *group, RIFF::Chunk *ckScri) | |
void | UpdateChunks (progress_t *pProgress) |
Apply this script to the respective RIFF chunks. | |
void | DeleteChunks () |
Remove all RIFF chunks associated with this Script object. | |
void | RemoveAllScriptReferences () |
void | GenerateUuid () |
Generate a new Universally Unique Identifier (UUID) for this script. | |
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:
Enumerator | |
---|---|
LANGUAGE_NKSP | NKSP stands for "Is Not KSP" (default). Refer to the NKSP Reference Manual for details about this script language. |
|
protected |
void gig::Script::CopyAssign | ( | const Script * | orig | ) |
Make a (semi) deep copy of the Script object given by orig and assign it to this object.
Note: the ScriptGroup this Script object belongs to remains untouched by this call.
orig | - original Script object to be copied from |
Definition at line 4770 of file gig.cpp.
References Bypass, Compression, Encoding, Language, and Name.
Referenced by gig::File::AddContentOf().
|
protectedvirtual |
Remove all RIFF chunks associated with this Script object.
At the moment Script::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.
|
protected |
Generate a new Universally Unique Identifier (UUID) for this script.
Definition at line 4719 of file gig.cpp.
References DLS::Resource::GenerateDLSID(), and Uuid.
ScriptGroup * gig::Script::GetGroup | ( | ) | const |
Returns the script group this script currently belongs to.
Each script is a member of exactly one ScriptGroup.
String gig::Script::GetScriptAsText | ( | ) |
void gig::Script::SetGroup | ( | ScriptGroup * | pGroup | ) |
Move this script from its current ScriptGroup to another ScriptGroup given by pGroup.
pGroup | - script's new group |
Definition at line 4746 of file gig.cpp.
References RIFF::Chunk::GetParent(), and RIFF::List::MoveSubChunk().
void gig::Script::SetScriptAsText | ( | const String & | text | ) |
|
protectedvirtual |
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.
pProgress | - callback function for progress notification |
Implements DLS::Storage.
Definition at line 4681 of file gig.cpp.
References RIFF::List::AddSubChunk(), Bypass, Compression, Encoding, Language, RIFF::Chunk::LoadChunkData(), Name, RIFF::Chunk::Resize(), and Uuid.
bool gig::Script::Bypass |
Global bypass: if enabled, this script shall not be executed by the sampler for any instrument.
Definition at line 1195 of file gig.h.
Referenced by CopyAssign(), and UpdateChunks().
Compression_t gig::Script::Compression |
Whether the script was/should be compressed, and if so, which compression algorithm shall be used.
Definition at line 1192 of file gig.h.
Referenced by CopyAssign(), and UpdateChunks().
Encoding_t gig::Script::Encoding |
Format the script's source code text is encoded with.
Definition at line 1193 of file gig.h.
Referenced by CopyAssign(), and UpdateChunks().
Language_t gig::Script::Language |
Programming language and dialect the script is written in.
Definition at line 1194 of file gig.h.
Referenced by CopyAssign(), and UpdateChunks().
String gig::Script::Name |
Arbitrary name of the script, which may be displayed i.e. in an instrument editor.
Definition at line 1191 of file gig.h.
Referenced by CopyAssign(), and UpdateChunks().
uint8_t gig::Script::Uuid[16] |
Persistent Universally Unique Identifier of this script, which remains identical after any changes to this script.
Definition at line 1196 of file gig.h.
Referenced by GenerateUuid(), gig::Instrument::GetScriptPatchVariables(), gig::Instrument::IsScriptPatchVariableSet(), gig::Instrument::SetScriptPatchVariable(), gig::Instrument::UnsetScriptPatchVariable(), and UpdateChunks().