libgig
4.3.0
|
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... | |
ScriptGroup * | GetGroup () const |
Returns the script group this script currently belongs to. More... | |
void | CopyAssign (const Script *orig) |
Make a (semi) deep copy of the Script object given by orig and assign it to this object. More... | |
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. More... | |
void | DeleteChunks () |
Remove all RIFF chunks associated with this Script object. More... | |
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. |
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 4757 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.
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 4733 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 4668 of file gig.cpp.
References RIFF::List::AddSubChunk(), Bypass, Compression, Encoding, Language, RIFF::Chunk::LoadChunkData(), Name, RIFF::Chunk::Resize(), and Uuid.