5539 |
* @param index - instrument script slot index |
* @param index - instrument script slot index |
5540 |
* @returns script or NULL if index is out of bounds |
* @returns script or NULL if index is out of bounds |
5541 |
*/ |
*/ |
5542 |
Script* Instrument::GetScriptOfSlot(uint index) { |
Script* Instrument::GetScriptOfSlot(size_t index) { |
5543 |
LoadScripts(); |
LoadScripts(); |
5544 |
if (index >= pScriptRefs->size()) return NULL; |
if (index >= pScriptRefs->size()) return NULL; |
5545 |
return pScriptRefs->at(index).script; |
return pScriptRefs->at(index).script; |
5600 |
* @param index1 - index of the first script slot to swap |
* @param index1 - index of the first script slot to swap |
5601 |
* @param index2 - index of the second script slot to swap |
* @param index2 - index of the second script slot to swap |
5602 |
*/ |
*/ |
5603 |
void Instrument::SwapScriptSlots(uint index1, uint index2) { |
void Instrument::SwapScriptSlots(size_t index1, size_t index2) { |
5604 |
LoadScripts(); |
LoadScripts(); |
5605 |
if (index1 >= pScriptRefs->size() || index2 >= pScriptRefs->size()) |
if (index1 >= pScriptRefs->size() || index2 >= pScriptRefs->size()) |
5606 |
return; |
return; |
5615 |
* |
* |
5616 |
* @param index - index of script slot to remove |
* @param index - index of script slot to remove |
5617 |
*/ |
*/ |
5618 |
void Instrument::RemoveScriptSlot(uint index) { |
void Instrument::RemoveScriptSlot(size_t index) { |
5619 |
LoadScripts(); |
LoadScripts(); |
5620 |
if (index >= pScriptRefs->size()) return; |
if (index >= pScriptRefs->size()) return; |
5621 |
pScriptRefs->erase( pScriptRefs->begin() + index ); |
pScriptRefs->erase( pScriptRefs->begin() + index ); |
5656 |
* GigaStudio 4 software. It will currently only work with LinuxSampler and |
* GigaStudio 4 software. It will currently only work with LinuxSampler and |
5657 |
* gigedit. |
* gigedit. |
5658 |
*/ |
*/ |
5659 |
uint Instrument::ScriptSlotCount() const { |
size_t Instrument::ScriptSlotCount() const { |
5660 |
return uint(pScriptRefs ? pScriptRefs->size() : scriptPoolFileOffsets.size()); |
return pScriptRefs ? pScriptRefs->size() : scriptPoolFileOffsets.size(); |
5661 |
} |
} |
5662 |
|
|
5663 |
/** @brief Whether script execution shall be skipped. |
/** @brief Whether script execution shall be skipped. |
5676 |
* @param index - index of the script slot on this instrument |
* @param index - index of the script slot on this instrument |
5677 |
* @see Script::Bypass |
* @see Script::Bypass |
5678 |
*/ |
*/ |
5679 |
bool Instrument::IsScriptSlotBypassed(uint index) { |
bool Instrument::IsScriptSlotBypassed(size_t index) { |
5680 |
if (index >= ScriptSlotCount()) return false; |
if (index >= ScriptSlotCount()) return false; |
5681 |
return pScriptRefs ? pScriptRefs->at(index).bypass |
return pScriptRefs ? pScriptRefs->at(index).bypass |
5682 |
: scriptPoolFileOffsets.at(index).bypass; |
: scriptPoolFileOffsets.at(index).bypass; |
5696 |
* @param bBypass - if true, the script slot will be skipped by the sampler |
* @param bBypass - if true, the script slot will be skipped by the sampler |
5697 |
* @see Script::Bypass |
* @see Script::Bypass |
5698 |
*/ |
*/ |
5699 |
void Instrument::SetScriptSlotBypassed(uint index, bool bBypass) { |
void Instrument::SetScriptSlotBypassed(size_t index, bool bBypass) { |
5700 |
if (index >= ScriptSlotCount()) return; |
if (index >= ScriptSlotCount()) return; |
5701 |
if (pScriptRefs) |
if (pScriptRefs) |
5702 |
pScriptRefs->at(index).bypass = bBypass; |
pScriptRefs->at(index).bypass = bBypass; |
5716 |
* the @c Script identified by passed @p uuid. |
* the @c Script identified by passed @p uuid. |
5717 |
*/ |
*/ |
5718 |
bool Instrument::ReferencesScriptWithUuid(const _UUID& uuid) { |
bool Instrument::ReferencesScriptWithUuid(const _UUID& uuid) { |
5719 |
const uint nSlots = ScriptSlotCount(); |
const size_t nSlots = ScriptSlotCount(); |
5720 |
for (uint iSlot = 0; iSlot < nSlots; ++iSlot) |
for (size_t iSlot = 0; iSlot < nSlots; ++iSlot) |
5721 |
if (_UUIDFromCArray(&GetScriptOfSlot(iSlot)->Uuid[0]) == uuid) |
if (_UUIDFromCArray(&GetScriptOfSlot(iSlot)->Uuid[0]) == uuid) |
5722 |
return true; |
return true; |
5723 |
return false; |
return false; |
5742 |
* @param slot - script slot index of the variable to be retrieved |
* @param slot - script slot index of the variable to be retrieved |
5743 |
* @param variable - name of the 'patch' variable in that script |
* @param variable - name of the 'patch' variable in that script |
5744 |
*/ |
*/ |
5745 |
bool Instrument::IsScriptPatchVariableSet(int slot, String variable) { |
bool Instrument::IsScriptPatchVariableSet(size_t slot, String variable) { |
5746 |
if (variable.empty()) return false; |
if (variable.empty()) return false; |
5747 |
Script* script = GetScriptOfSlot(slot); |
Script* script = GetScriptOfSlot(slot); |
5748 |
if (!script) return false; |
if (!script) return false; |