3673 |
throw gig::Exception("No dimension with provided old dimension type exists on this region"); |
throw gig::Exception("No dimension with provided old dimension type exists on this region"); |
3674 |
if (newType == dimension_samplechannel && def->zones != 2) |
if (newType == dimension_samplechannel && def->zones != 2) |
3675 |
throw gig::Exception("Cannot change to dimension type 'sample channel', because existing dimension does not have 2 zones"); |
throw gig::Exception("Cannot change to dimension type 'sample channel', because existing dimension does not have 2 zones"); |
3676 |
|
if (GetDimensionDefinition(newType)) |
3677 |
|
throw gig::Exception("There is already a dimension with requested new dimension type on this region"); |
3678 |
|
def->dimension = newType; |
3679 |
def->split_type = __resolveSplitType(newType); |
def->split_type = __resolveSplitType(newType); |
3680 |
} |
} |
3681 |
|
|
4520 |
} |
} |
4521 |
|
|
4522 |
// own gig format extensions |
// own gig format extensions |
4523 |
if (pScriptRefs) { |
if (ScriptSlotCount()) { |
4524 |
|
// make sure we have converted the original loaded script file |
4525 |
|
// offsets into valid Script object pointers |
4526 |
|
LoadScripts(); |
4527 |
|
|
4528 |
RIFF::List* lst3LS = pCkInstrument->GetSubList(LIST_TYPE_3LS); |
RIFF::List* lst3LS = pCkInstrument->GetSubList(LIST_TYPE_3LS); |
4529 |
if (!lst3LS) lst3LS = pCkInstrument->AddSubList(LIST_TYPE_3LS); |
if (!lst3LS) lst3LS = pCkInstrument->AddSubList(LIST_TYPE_3LS); |
4530 |
const int slotCount = pScriptRefs->size(); |
const int slotCount = pScriptRefs->size(); |
4551 |
store32(&pData[pos], (*pScriptRefs)[i].bypass ? 1 : 0); |
store32(&pData[pos], (*pScriptRefs)[i].bypass ? 1 : 0); |
4552 |
pos += sizeof(uint32_t); |
pos += sizeof(uint32_t); |
4553 |
} |
} |
4554 |
|
} else { |
4555 |
|
// no script slots, so get rid of any LS custom RIFF chunks (if any) |
4556 |
|
RIFF::List* lst3LS = pCkInstrument->GetSubList(LIST_TYPE_3LS); |
4557 |
|
if (lst3LS) pCkInstrument->DeleteSubChunk(lst3LS); |
4558 |
} |
} |
4559 |
} |
} |
4560 |
|
|
4561 |
void Instrument::UpdateScriptFileOffsets() { |
void Instrument::UpdateScriptFileOffsets() { |
4562 |
// own gig format extensions |
// own gig format extensions |
4563 |
if (pScriptRefs) { |
if (pScriptRefs && pScriptRefs->size() > 0) { |
4564 |
RIFF::List* lst3LS = pCkInstrument->GetSubList(LIST_TYPE_3LS); |
RIFF::List* lst3LS = pCkInstrument->GetSubList(LIST_TYPE_3LS); |
4565 |
RIFF::Chunk* ckSCSL = lst3LS->GetSubChunk(CHUNK_ID_SCSL); |
RIFF::Chunk* ckSCSL = lst3LS->GetSubChunk(CHUNK_ID_SCSL); |
4566 |
const int slotCount = pScriptRefs->size(); |
const int slotCount = pScriptRefs->size(); |