254 |
} |
} |
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
// *************** Other Internal functions *************** |
259 |
|
// * |
260 |
|
|
261 |
|
static split_type_t __resolveSplitType(dimension_t dimension) { |
262 |
|
return ( |
263 |
|
dimension == dimension_layer || |
264 |
|
dimension == dimension_samplechannel || |
265 |
|
dimension == dimension_releasetrigger || |
266 |
|
dimension == dimension_keyboard || |
267 |
|
dimension == dimension_roundrobin || |
268 |
|
dimension == dimension_random || |
269 |
|
dimension == dimension_smartmidi || |
270 |
|
dimension == dimension_roundrobinkeyboard |
271 |
|
) ? split_type_bit : split_type_normal; |
272 |
|
} |
273 |
|
|
274 |
|
static int __resolveZoneSize(dimension_def_t& dimension_definition) { |
275 |
|
return (dimension_definition.split_type == split_type_normal) |
276 |
|
? int(128.0 / dimension_definition.zones) : 0; |
277 |
|
} |
278 |
|
|
279 |
|
|
280 |
|
|
281 |
// *************** Sample *************** |
// *************** Sample *************** |
282 |
// * |
// * |
283 |
|
|
303 |
* is located, 0 otherwise |
* is located, 0 otherwise |
304 |
*/ |
*/ |
305 |
Sample::Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset, unsigned long fileNo) : DLS::Sample((DLS::File*) pFile, waveList, WavePoolOffset) { |
Sample::Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset, unsigned long fileNo) : DLS::Sample((DLS::File*) pFile, waveList, WavePoolOffset) { |
306 |
pInfo->UseFixedLengthStrings = true; |
static const DLS::Info::FixedStringLength fixedStringLengths[] = { |
307 |
|
{ CHUNK_ID_INAM, 64 }, |
308 |
|
{ 0, 0 } |
309 |
|
}; |
310 |
|
pInfo->FixedStringLengths = fixedStringLengths; |
311 |
Instances++; |
Instances++; |
312 |
FileNo = fileNo; |
FileNo = fileNo; |
313 |
|
|
344 |
SamplePeriod = uint32_t(1000000000.0 / SamplesPerSecond + 0.5); |
SamplePeriod = uint32_t(1000000000.0 / SamplesPerSecond + 0.5); |
345 |
MIDIUnityNote = 64; |
MIDIUnityNote = 64; |
346 |
FineTune = 0; |
FineTune = 0; |
347 |
|
SMPTEFormat = smpte_format_no_offset; |
348 |
SMPTEOffset = 0; |
SMPTEOffset = 0; |
349 |
Loops = 0; |
Loops = 0; |
350 |
LoopID = 0; |
LoopID = 0; |
351 |
|
LoopType = loop_type_normal; |
352 |
LoopStart = 0; |
LoopStart = 0; |
353 |
LoopEnd = 0; |
LoopEnd = 0; |
354 |
LoopFraction = 0; |
LoopFraction = 0; |
404 |
|
|
405 |
// make sure 'smpl' chunk exists |
// make sure 'smpl' chunk exists |
406 |
pCkSmpl = pWaveList->GetSubChunk(CHUNK_ID_SMPL); |
pCkSmpl = pWaveList->GetSubChunk(CHUNK_ID_SMPL); |
407 |
if (!pCkSmpl) pCkSmpl = pWaveList->AddSubChunk(CHUNK_ID_SMPL, 60); |
if (!pCkSmpl) { |
408 |
|
pCkSmpl = pWaveList->AddSubChunk(CHUNK_ID_SMPL, 60); |
409 |
|
memset(pCkSmpl->LoadChunkData(), 0, 60); |
410 |
|
} |
411 |
// update 'smpl' chunk |
// update 'smpl' chunk |
412 |
uint8_t* pData = (uint8_t*) pCkSmpl->LoadChunkData(); |
uint8_t* pData = (uint8_t*) pCkSmpl->LoadChunkData(); |
413 |
SamplePeriod = uint32_t(1000000000.0 / SamplesPerSecond + 0.5); |
SamplePeriod = uint32_t(1000000000.0 / SamplesPerSecond + 0.5); |
414 |
memcpy(&pData[0], &Manufacturer, 4); |
store32(&pData[0], Manufacturer); |
415 |
memcpy(&pData[4], &Product, 4); |
store32(&pData[4], Product); |
416 |
memcpy(&pData[8], &SamplePeriod, 4); |
store32(&pData[8], SamplePeriod); |
417 |
memcpy(&pData[12], &MIDIUnityNote, 4); |
store32(&pData[12], MIDIUnityNote); |
418 |
memcpy(&pData[16], &FineTune, 4); |
store32(&pData[16], FineTune); |
419 |
memcpy(&pData[20], &SMPTEFormat, 4); |
store32(&pData[20], SMPTEFormat); |
420 |
memcpy(&pData[24], &SMPTEOffset, 4); |
store32(&pData[24], SMPTEOffset); |
421 |
memcpy(&pData[28], &Loops, 4); |
store32(&pData[28], Loops); |
422 |
|
|
423 |
// we skip 'manufByt' for now (4 bytes) |
// we skip 'manufByt' for now (4 bytes) |
424 |
|
|
425 |
memcpy(&pData[36], &LoopID, 4); |
store32(&pData[36], LoopID); |
426 |
memcpy(&pData[40], &LoopType, 4); |
store32(&pData[40], LoopType); |
427 |
memcpy(&pData[44], &LoopStart, 4); |
store32(&pData[44], LoopStart); |
428 |
memcpy(&pData[48], &LoopEnd, 4); |
store32(&pData[48], LoopEnd); |
429 |
memcpy(&pData[52], &LoopFraction, 4); |
store32(&pData[52], LoopFraction); |
430 |
memcpy(&pData[56], &LoopPlayCount, 4); |
store32(&pData[56], LoopPlayCount); |
431 |
|
|
432 |
// make sure '3gix' chunk exists |
// make sure '3gix' chunk exists |
433 |
pCk3gix = pWaveList->GetSubChunk(CHUNK_ID_3GIX); |
pCk3gix = pWaveList->GetSubChunk(CHUNK_ID_3GIX); |
447 |
} |
} |
448 |
// update '3gix' chunk |
// update '3gix' chunk |
449 |
pData = (uint8_t*) pCk3gix->LoadChunkData(); |
pData = (uint8_t*) pCk3gix->LoadChunkData(); |
450 |
memcpy(&pData[0], &iSampleGroup, 2); |
store16(&pData[0], iSampleGroup); |
451 |
} |
} |
452 |
|
|
453 |
/// Scans compressed samples for mandatory informations (e.g. actual number of total sample points). |
/// Scans compressed samples for mandatory informations (e.g. actual number of total sample points). |
1512 |
|
|
1513 |
// update '3ewa' chunk with DimensionRegion's current settings |
// update '3ewa' chunk with DimensionRegion's current settings |
1514 |
|
|
1515 |
const uint32_t chunksize = _3ewa->GetSize(); |
const uint32_t chunksize = _3ewa->GetNewSize(); |
1516 |
memcpy(&pData[0], &chunksize, 4); // unknown, always chunk size? |
store32(&pData[0], chunksize); // unknown, always chunk size? |
1517 |
|
|
1518 |
const int32_t lfo3freq = (int32_t) GIG_EXP_ENCODE(LFO3Frequency); |
const int32_t lfo3freq = (int32_t) GIG_EXP_ENCODE(LFO3Frequency); |
1519 |
memcpy(&pData[4], &lfo3freq, 4); |
store32(&pData[4], lfo3freq); |
1520 |
|
|
1521 |
const int32_t eg3attack = (int32_t) GIG_EXP_ENCODE(EG3Attack); |
const int32_t eg3attack = (int32_t) GIG_EXP_ENCODE(EG3Attack); |
1522 |
memcpy(&pData[8], &eg3attack, 4); |
store32(&pData[8], eg3attack); |
1523 |
|
|
1524 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1525 |
|
|
1526 |
memcpy(&pData[14], &LFO1InternalDepth, 2); |
store16(&pData[14], LFO1InternalDepth); |
1527 |
|
|
1528 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1529 |
|
|
1530 |
memcpy(&pData[18], &LFO3InternalDepth, 2); |
store16(&pData[18], LFO3InternalDepth); |
1531 |
|
|
1532 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1533 |
|
|
1534 |
memcpy(&pData[22], &LFO1ControlDepth, 2); |
store16(&pData[22], LFO1ControlDepth); |
1535 |
|
|
1536 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1537 |
|
|
1538 |
memcpy(&pData[26], &LFO3ControlDepth, 2); |
store16(&pData[26], LFO3ControlDepth); |
1539 |
|
|
1540 |
const int32_t eg1attack = (int32_t) GIG_EXP_ENCODE(EG1Attack); |
const int32_t eg1attack = (int32_t) GIG_EXP_ENCODE(EG1Attack); |
1541 |
memcpy(&pData[28], &eg1attack, 4); |
store32(&pData[28], eg1attack); |
1542 |
|
|
1543 |
const int32_t eg1decay1 = (int32_t) GIG_EXP_ENCODE(EG1Decay1); |
const int32_t eg1decay1 = (int32_t) GIG_EXP_ENCODE(EG1Decay1); |
1544 |
memcpy(&pData[32], &eg1decay1, 4); |
store32(&pData[32], eg1decay1); |
1545 |
|
|
1546 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1547 |
|
|
1548 |
memcpy(&pData[38], &EG1Sustain, 2); |
store16(&pData[38], EG1Sustain); |
1549 |
|
|
1550 |
const int32_t eg1release = (int32_t) GIG_EXP_ENCODE(EG1Release); |
const int32_t eg1release = (int32_t) GIG_EXP_ENCODE(EG1Release); |
1551 |
memcpy(&pData[40], &eg1release, 4); |
store32(&pData[40], eg1release); |
1552 |
|
|
1553 |
const uint8_t eg1ctl = (uint8_t) EncodeLeverageController(EG1Controller); |
const uint8_t eg1ctl = (uint8_t) EncodeLeverageController(EG1Controller); |
1554 |
memcpy(&pData[44], &eg1ctl, 1); |
pData[44] = eg1ctl; |
1555 |
|
|
1556 |
const uint8_t eg1ctrloptions = |
const uint8_t eg1ctrloptions = |
1557 |
(EG1ControllerInvert) ? 0x01 : 0x00 | |
(EG1ControllerInvert) ? 0x01 : 0x00 | |
1558 |
GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG1ControllerAttackInfluence) | |
GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG1ControllerAttackInfluence) | |
1559 |
GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG1ControllerDecayInfluence) | |
GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG1ControllerDecayInfluence) | |
1560 |
GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG1ControllerReleaseInfluence); |
GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG1ControllerReleaseInfluence); |
1561 |
memcpy(&pData[45], &eg1ctrloptions, 1); |
pData[45] = eg1ctrloptions; |
1562 |
|
|
1563 |
const uint8_t eg2ctl = (uint8_t) EncodeLeverageController(EG2Controller); |
const uint8_t eg2ctl = (uint8_t) EncodeLeverageController(EG2Controller); |
1564 |
memcpy(&pData[46], &eg2ctl, 1); |
pData[46] = eg2ctl; |
1565 |
|
|
1566 |
const uint8_t eg2ctrloptions = |
const uint8_t eg2ctrloptions = |
1567 |
(EG2ControllerInvert) ? 0x01 : 0x00 | |
(EG2ControllerInvert) ? 0x01 : 0x00 | |
1568 |
GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG2ControllerAttackInfluence) | |
GIG_EG_CTR_ATTACK_INFLUENCE_ENCODE(EG2ControllerAttackInfluence) | |
1569 |
GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG2ControllerDecayInfluence) | |
GIG_EG_CTR_DECAY_INFLUENCE_ENCODE(EG2ControllerDecayInfluence) | |
1570 |
GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG2ControllerReleaseInfluence); |
GIG_EG_CTR_RELEASE_INFLUENCE_ENCODE(EG2ControllerReleaseInfluence); |
1571 |
memcpy(&pData[47], &eg2ctrloptions, 1); |
pData[47] = eg2ctrloptions; |
1572 |
|
|
1573 |
const int32_t lfo1freq = (int32_t) GIG_EXP_ENCODE(LFO1Frequency); |
const int32_t lfo1freq = (int32_t) GIG_EXP_ENCODE(LFO1Frequency); |
1574 |
memcpy(&pData[48], &lfo1freq, 4); |
store32(&pData[48], lfo1freq); |
1575 |
|
|
1576 |
const int32_t eg2attack = (int32_t) GIG_EXP_ENCODE(EG2Attack); |
const int32_t eg2attack = (int32_t) GIG_EXP_ENCODE(EG2Attack); |
1577 |
memcpy(&pData[52], &eg2attack, 4); |
store32(&pData[52], eg2attack); |
1578 |
|
|
1579 |
const int32_t eg2decay1 = (int32_t) GIG_EXP_ENCODE(EG2Decay1); |
const int32_t eg2decay1 = (int32_t) GIG_EXP_ENCODE(EG2Decay1); |
1580 |
memcpy(&pData[56], &eg2decay1, 4); |
store32(&pData[56], eg2decay1); |
1581 |
|
|
1582 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1583 |
|
|
1584 |
memcpy(&pData[62], &EG2Sustain, 2); |
store16(&pData[62], EG2Sustain); |
1585 |
|
|
1586 |
const int32_t eg2release = (int32_t) GIG_EXP_ENCODE(EG2Release); |
const int32_t eg2release = (int32_t) GIG_EXP_ENCODE(EG2Release); |
1587 |
memcpy(&pData[64], &eg2release, 4); |
store32(&pData[64], eg2release); |
1588 |
|
|
1589 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1590 |
|
|
1591 |
memcpy(&pData[70], &LFO2ControlDepth, 2); |
store16(&pData[70], LFO2ControlDepth); |
1592 |
|
|
1593 |
const int32_t lfo2freq = (int32_t) GIG_EXP_ENCODE(LFO2Frequency); |
const int32_t lfo2freq = (int32_t) GIG_EXP_ENCODE(LFO2Frequency); |
1594 |
memcpy(&pData[72], &lfo2freq, 4); |
store32(&pData[72], lfo2freq); |
1595 |
|
|
1596 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1597 |
|
|
1598 |
memcpy(&pData[78], &LFO2InternalDepth, 2); |
store16(&pData[78], LFO2InternalDepth); |
1599 |
|
|
1600 |
const int32_t eg1decay2 = (int32_t) (EG1InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG1Decay2); |
const int32_t eg1decay2 = (int32_t) (EG1InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG1Decay2); |
1601 |
memcpy(&pData[80], &eg1decay2, 4); |
store32(&pData[80], eg1decay2); |
1602 |
|
|
1603 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1604 |
|
|
1605 |
memcpy(&pData[86], &EG1PreAttack, 2); |
store16(&pData[86], EG1PreAttack); |
1606 |
|
|
1607 |
const int32_t eg2decay2 = (int32_t) (EG2InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG2Decay2); |
const int32_t eg2decay2 = (int32_t) (EG2InfiniteSustain) ? 0x7fffffff : (int32_t) GIG_EXP_ENCODE(EG2Decay2); |
1608 |
memcpy(&pData[88], &eg2decay2, 4); |
store32(&pData[88], eg2decay2); |
1609 |
|
|
1610 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1611 |
|
|
1612 |
memcpy(&pData[94], &EG2PreAttack, 2); |
store16(&pData[94], EG2PreAttack); |
1613 |
|
|
1614 |
{ |
{ |
1615 |
if (VelocityResponseDepth > 4) throw Exception("VelocityResponseDepth must be between 0 and 4"); |
if (VelocityResponseDepth > 4) throw Exception("VelocityResponseDepth must be between 0 and 4"); |
1627 |
default: |
default: |
1628 |
throw Exception("Could not update DimensionRegion's chunk, unknown VelocityResponseCurve selected"); |
throw Exception("Could not update DimensionRegion's chunk, unknown VelocityResponseCurve selected"); |
1629 |
} |
} |
1630 |
memcpy(&pData[96], &velocityresponse, 1); |
pData[96] = velocityresponse; |
1631 |
} |
} |
1632 |
|
|
1633 |
{ |
{ |
1646 |
default: |
default: |
1647 |
throw Exception("Could not update DimensionRegion's chunk, unknown ReleaseVelocityResponseCurve selected"); |
throw Exception("Could not update DimensionRegion's chunk, unknown ReleaseVelocityResponseCurve selected"); |
1648 |
} |
} |
1649 |
memcpy(&pData[97], &releasevelocityresponse, 1); |
pData[97] = releasevelocityresponse; |
1650 |
} |
} |
1651 |
|
|
1652 |
memcpy(&pData[98], &VelocityResponseCurveScaling, 1); |
pData[98] = VelocityResponseCurveScaling; |
1653 |
|
|
1654 |
memcpy(&pData[99], &AttenuationControllerThreshold, 1); |
pData[99] = AttenuationControllerThreshold; |
1655 |
|
|
1656 |
// next 4 bytes unknown |
// next 4 bytes unknown |
1657 |
|
|
1658 |
memcpy(&pData[104], &SampleStartOffset, 2); |
store16(&pData[104], SampleStartOffset); |
1659 |
|
|
1660 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1661 |
|
|
1674 |
default: |
default: |
1675 |
throw Exception("Could not update DimensionRegion's chunk, unknown DimensionBypass selected"); |
throw Exception("Could not update DimensionRegion's chunk, unknown DimensionBypass selected"); |
1676 |
} |
} |
1677 |
memcpy(&pData[108], &pitchTrackDimensionBypass, 1); |
pData[108] = pitchTrackDimensionBypass; |
1678 |
} |
} |
1679 |
|
|
1680 |
const uint8_t pan = (Pan >= 0) ? Pan : ((-Pan) + 63); // signed 8 bit -> signed 7 bit |
const uint8_t pan = (Pan >= 0) ? Pan : ((-Pan) + 63); // signed 8 bit -> signed 7 bit |
1681 |
memcpy(&pData[109], &pan, 1); |
pData[109] = pan; |
1682 |
|
|
1683 |
const uint8_t selfmask = (SelfMask) ? 0x01 : 0x00; |
const uint8_t selfmask = (SelfMask) ? 0x01 : 0x00; |
1684 |
memcpy(&pData[110], &selfmask, 1); |
pData[110] = selfmask; |
1685 |
|
|
1686 |
// next byte unknown |
// next byte unknown |
1687 |
|
|
1690 |
if (LFO3Sync) lfo3ctrl |= 0x20; // bit 5 |
if (LFO3Sync) lfo3ctrl |= 0x20; // bit 5 |
1691 |
if (InvertAttenuationController) lfo3ctrl |= 0x80; // bit 7 |
if (InvertAttenuationController) lfo3ctrl |= 0x80; // bit 7 |
1692 |
if (VCFType == vcf_type_lowpassturbo) lfo3ctrl |= 0x40; // bit 6 |
if (VCFType == vcf_type_lowpassturbo) lfo3ctrl |= 0x40; // bit 6 |
1693 |
memcpy(&pData[112], &lfo3ctrl, 1); |
pData[112] = lfo3ctrl; |
1694 |
} |
} |
1695 |
|
|
1696 |
const uint8_t attenctl = EncodeLeverageController(AttenuationController); |
const uint8_t attenctl = EncodeLeverageController(AttenuationController); |
1697 |
memcpy(&pData[113], &attenctl, 1); |
pData[113] = attenctl; |
1698 |
|
|
1699 |
{ |
{ |
1700 |
uint8_t lfo2ctrl = LFO2Controller & 0x07; // lower 3 bits |
uint8_t lfo2ctrl = LFO2Controller & 0x07; // lower 3 bits |
1701 |
if (LFO2FlipPhase) lfo2ctrl |= 0x80; // bit 7 |
if (LFO2FlipPhase) lfo2ctrl |= 0x80; // bit 7 |
1702 |
if (LFO2Sync) lfo2ctrl |= 0x20; // bit 5 |
if (LFO2Sync) lfo2ctrl |= 0x20; // bit 5 |
1703 |
if (VCFResonanceController != vcf_res_ctrl_none) lfo2ctrl |= 0x40; // bit 6 |
if (VCFResonanceController != vcf_res_ctrl_none) lfo2ctrl |= 0x40; // bit 6 |
1704 |
memcpy(&pData[114], &lfo2ctrl, 1); |
pData[114] = lfo2ctrl; |
1705 |
} |
} |
1706 |
|
|
1707 |
{ |
{ |
1710 |
if (LFO1Sync) lfo1ctrl |= 0x40; // bit 6 |
if (LFO1Sync) lfo1ctrl |= 0x40; // bit 6 |
1711 |
if (VCFResonanceController != vcf_res_ctrl_none) |
if (VCFResonanceController != vcf_res_ctrl_none) |
1712 |
lfo1ctrl |= GIG_VCF_RESONANCE_CTRL_ENCODE(VCFResonanceController); |
lfo1ctrl |= GIG_VCF_RESONANCE_CTRL_ENCODE(VCFResonanceController); |
1713 |
memcpy(&pData[115], &lfo1ctrl, 1); |
pData[115] = lfo1ctrl; |
1714 |
} |
} |
1715 |
|
|
1716 |
const uint16_t eg3depth = (EG3Depth >= 0) ? EG3Depth |
const uint16_t eg3depth = (EG3Depth >= 0) ? EG3Depth |
1717 |
: uint16_t(((-EG3Depth) - 1) ^ 0xffff); /* binary complementary for negatives */ |
: uint16_t(((-EG3Depth) - 1) ^ 0xffff); /* binary complementary for negatives */ |
1718 |
memcpy(&pData[116], &eg3depth, 1); |
pData[116] = eg3depth; |
1719 |
|
|
1720 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1721 |
|
|
1722 |
const uint8_t channeloffset = ChannelOffset * 4; |
const uint8_t channeloffset = ChannelOffset * 4; |
1723 |
memcpy(&pData[120], &channeloffset, 1); |
pData[120] = channeloffset; |
1724 |
|
|
1725 |
{ |
{ |
1726 |
uint8_t regoptions = 0; |
uint8_t regoptions = 0; |
1727 |
if (MSDecode) regoptions |= 0x01; // bit 0 |
if (MSDecode) regoptions |= 0x01; // bit 0 |
1728 |
if (SustainDefeat) regoptions |= 0x02; // bit 1 |
if (SustainDefeat) regoptions |= 0x02; // bit 1 |
1729 |
memcpy(&pData[121], ®options, 1); |
pData[121] = regoptions; |
1730 |
} |
} |
1731 |
|
|
1732 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1733 |
|
|
1734 |
memcpy(&pData[124], &VelocityUpperLimit, 1); |
pData[124] = VelocityUpperLimit; |
1735 |
|
|
1736 |
// next 3 bytes unknown |
// next 3 bytes unknown |
1737 |
|
|
1738 |
memcpy(&pData[128], &ReleaseTriggerDecay, 1); |
pData[128] = ReleaseTriggerDecay; |
1739 |
|
|
1740 |
// next 2 bytes unknown |
// next 2 bytes unknown |
1741 |
|
|
1742 |
const uint8_t eg1hold = (EG1Hold) ? 0x80 : 0x00; // bit 7 |
const uint8_t eg1hold = (EG1Hold) ? 0x80 : 0x00; // bit 7 |
1743 |
memcpy(&pData[131], &eg1hold, 1); |
pData[131] = eg1hold; |
1744 |
|
|
1745 |
const uint8_t vcfcutoff = (VCFEnabled) ? 0x80 : 0x00 | /* bit 7 */ |
const uint8_t vcfcutoff = (VCFEnabled) ? 0x80 : 0x00 | /* bit 7 */ |
1746 |
(VCFCutoff & 0x7f); /* lower 7 bits */ |
(VCFCutoff & 0x7f); /* lower 7 bits */ |
1747 |
memcpy(&pData[132], &vcfcutoff, 1); |
pData[132] = vcfcutoff; |
1748 |
|
|
1749 |
memcpy(&pData[133], &VCFCutoffController, 1); |
pData[133] = VCFCutoffController; |
1750 |
|
|
1751 |
const uint8_t vcfvelscale = (VCFCutoffControllerInvert) ? 0x80 : 0x00 | /* bit 7 */ |
const uint8_t vcfvelscale = (VCFCutoffControllerInvert) ? 0x80 : 0x00 | /* bit 7 */ |
1752 |
(VCFVelocityScale & 0x7f); /* lower 7 bits */ |
(VCFVelocityScale & 0x7f); /* lower 7 bits */ |
1753 |
memcpy(&pData[134], &vcfvelscale, 1); |
pData[134] = vcfvelscale; |
1754 |
|
|
1755 |
// next byte unknown |
// next byte unknown |
1756 |
|
|
1757 |
const uint8_t vcfresonance = (VCFResonanceDynamic) ? 0x00 : 0x80 | /* bit 7 */ |
const uint8_t vcfresonance = (VCFResonanceDynamic) ? 0x00 : 0x80 | /* bit 7 */ |
1758 |
(VCFResonance & 0x7f); /* lower 7 bits */ |
(VCFResonance & 0x7f); /* lower 7 bits */ |
1759 |
memcpy(&pData[136], &vcfresonance, 1); |
pData[136] = vcfresonance; |
1760 |
|
|
1761 |
const uint8_t vcfbreakpoint = (VCFKeyboardTracking) ? 0x80 : 0x00 | /* bit 7 */ |
const uint8_t vcfbreakpoint = (VCFKeyboardTracking) ? 0x80 : 0x00 | /* bit 7 */ |
1762 |
(VCFKeyboardTrackingBreakpoint & 0x7f); /* lower 7 bits */ |
(VCFKeyboardTrackingBreakpoint & 0x7f); /* lower 7 bits */ |
1763 |
memcpy(&pData[137], &vcfbreakpoint, 1); |
pData[137] = vcfbreakpoint; |
1764 |
|
|
1765 |
const uint8_t vcfvelocity = VCFVelocityDynamicRange % 5 | |
const uint8_t vcfvelocity = VCFVelocityDynamicRange % 5 | |
1766 |
VCFVelocityCurve * 5; |
VCFVelocityCurve * 5; |
1767 |
memcpy(&pData[138], &vcfvelocity, 1); |
pData[138] = vcfvelocity; |
1768 |
|
|
1769 |
const uint8_t vcftype = (VCFType == vcf_type_lowpassturbo) ? vcf_type_lowpass : VCFType; |
const uint8_t vcftype = (VCFType == vcf_type_lowpassturbo) ? vcf_type_lowpass : VCFType; |
1770 |
memcpy(&pData[139], &vcftype, 1); |
pData[139] = vcftype; |
1771 |
|
|
1772 |
if (chunksize >= 148) { |
if (chunksize >= 148) { |
1773 |
memcpy(&pData[140], DimensionUpperLimits, 8); |
memcpy(&pData[140], DimensionUpperLimits, 8); |
1996 |
default: |
default: |
1997 |
throw gig::Exception("leverage controller number is not supported by the gig format"); |
throw gig::Exception("leverage controller number is not supported by the gig format"); |
1998 |
} |
} |
1999 |
|
break; |
2000 |
default: |
default: |
2001 |
throw gig::Exception("Unknown leverage controller type."); |
throw gig::Exception("Unknown leverage controller type."); |
2002 |
} |
} |
2114 |
// * |
// * |
2115 |
|
|
2116 |
Region::Region(Instrument* pInstrument, RIFF::List* rgnList) : DLS::Region((DLS::Instrument*) pInstrument, rgnList) { |
Region::Region(Instrument* pInstrument, RIFF::List* rgnList) : DLS::Region((DLS::Instrument*) pInstrument, rgnList) { |
|
pInfo->UseFixedLengthStrings = true; |
|
|
|
|
2117 |
// Initialization |
// Initialization |
2118 |
Dimensions = 0; |
Dimensions = 0; |
2119 |
for (int i = 0; i < 256; i++) { |
for (int i = 0; i < 256; i++) { |
2147 |
pDimensionDefinitions[i].dimension = dimension; |
pDimensionDefinitions[i].dimension = dimension; |
2148 |
pDimensionDefinitions[i].bits = bits; |
pDimensionDefinitions[i].bits = bits; |
2149 |
pDimensionDefinitions[i].zones = zones ? zones : 0x01 << bits; // = pow(2,bits) |
pDimensionDefinitions[i].zones = zones ? zones : 0x01 << bits; // = pow(2,bits) |
2150 |
pDimensionDefinitions[i].split_type = (dimension == dimension_layer || |
pDimensionDefinitions[i].split_type = __resolveSplitType(dimension); |
2151 |
dimension == dimension_samplechannel || |
pDimensionDefinitions[i].zone_size = __resolveZoneSize(pDimensionDefinitions[i]); |
|
dimension == dimension_releasetrigger || |
|
|
dimension == dimension_keyboard || |
|
|
dimension == dimension_roundrobin || |
|
|
dimension == dimension_random || |
|
|
dimension == dimension_smartmidi || |
|
|
dimension == dimension_roundrobinkeyboard) ? split_type_bit |
|
|
: split_type_normal; |
|
|
pDimensionDefinitions[i].zone_size = |
|
|
(pDimensionDefinitions[i].split_type == split_type_normal) ? 128.0 / pDimensionDefinitions[i].zones |
|
|
: 0; |
|
2152 |
Dimensions++; |
Dimensions++; |
2153 |
|
|
2154 |
// if this is a layer dimension, remember the amount of layers |
// if this is a layer dimension, remember the amount of layers |
2174 |
if (file->pWavePoolTable) pDimensionRegions[i]->pSample = GetSampleFromWavePool(wavepoolindex); |
if (file->pWavePoolTable) pDimensionRegions[i]->pSample = GetSampleFromWavePool(wavepoolindex); |
2175 |
} |
} |
2176 |
GetSample(); // load global region sample reference |
GetSample(); // load global region sample reference |
2177 |
|
} else { |
2178 |
|
DimensionRegions = 0; |
2179 |
|
for (int i = 0 ; i < 8 ; i++) { |
2180 |
|
pDimensionDefinitions[i].dimension = dimension_none; |
2181 |
|
pDimensionDefinitions[i].bits = 0; |
2182 |
|
pDimensionDefinitions[i].zones = 0; |
2183 |
|
} |
2184 |
} |
} |
2185 |
|
|
2186 |
// make sure there is at least one dimension region |
// make sure there is at least one dimension region |
2203 |
* @throws gig::Exception if samples cannot be dereferenced |
* @throws gig::Exception if samples cannot be dereferenced |
2204 |
*/ |
*/ |
2205 |
void Region::UpdateChunks() { |
void Region::UpdateChunks() { |
2206 |
|
// in the gig format we don't care about the Region's sample reference |
2207 |
|
// but we still have to provide some existing one to not corrupt the |
2208 |
|
// file, so to avoid the latter we simply always assign the sample of |
2209 |
|
// the first dimension region of this region |
2210 |
|
pSample = pDimensionRegions[0]->pSample; |
2211 |
|
|
2212 |
// first update base class's chunks |
// first update base class's chunks |
2213 |
DLS::Region::UpdateChunks(); |
DLS::Region::UpdateChunks(); |
2214 |
|
|
2226 |
if (!_3lnk) { |
if (!_3lnk) { |
2227 |
const int _3lnkChunkSize = (pFile->pVersion && pFile->pVersion->major == 3) ? 1092 : 172; |
const int _3lnkChunkSize = (pFile->pVersion && pFile->pVersion->major == 3) ? 1092 : 172; |
2228 |
_3lnk = pCkRegion->AddSubChunk(CHUNK_ID_3LNK, _3lnkChunkSize); |
_3lnk = pCkRegion->AddSubChunk(CHUNK_ID_3LNK, _3lnkChunkSize); |
2229 |
|
memset(_3lnk->LoadChunkData(), 0, _3lnkChunkSize); |
2230 |
|
|
2231 |
|
// move 3prg to last position |
2232 |
|
pCkRegion->MoveSubChunk(pCkRegion->GetSubList(LIST_TYPE_3PRG), 0); |
2233 |
} |
} |
2234 |
|
|
2235 |
// update dimension definitions in '3lnk' chunk |
// update dimension definitions in '3lnk' chunk |
2236 |
uint8_t* pData = (uint8_t*) _3lnk->LoadChunkData(); |
uint8_t* pData = (uint8_t*) _3lnk->LoadChunkData(); |
2237 |
memcpy(&pData[0], &DimensionRegions, 4); |
store32(&pData[0], DimensionRegions); |
2238 |
for (int i = 0; i < iMaxDimensions; i++) { |
for (int i = 0; i < iMaxDimensions; i++) { |
2239 |
pData[4 + i * 8] = (uint8_t) pDimensionDefinitions[i].dimension; |
pData[4 + i * 8] = (uint8_t) pDimensionDefinitions[i].dimension; |
2240 |
pData[5 + i * 8] = pDimensionDefinitions[i].bits; |
pData[5 + i * 8] = pDimensionDefinitions[i].bits; |
2259 |
} |
} |
2260 |
if (iWaveIndex < 0) throw gig::Exception("Could not update gig::Region, could not find DimensionRegion's sample"); |
if (iWaveIndex < 0) throw gig::Exception("Could not update gig::Region, could not find DimensionRegion's sample"); |
2261 |
} |
} |
2262 |
memcpy(&pData[iWavePoolOffset + i * 4], &iWaveIndex, 4); |
store32(&pData[iWavePoolOffset + i * 4], iWaveIndex); |
2263 |
} |
} |
2264 |
} |
} |
2265 |
|
|
2387 |
// assign definition of new dimension |
// assign definition of new dimension |
2388 |
pDimensionDefinitions[Dimensions] = *pDimDef; |
pDimensionDefinitions[Dimensions] = *pDimDef; |
2389 |
|
|
2390 |
|
// auto correct certain dimension definition fields (where possible) |
2391 |
|
pDimensionDefinitions[Dimensions].split_type = |
2392 |
|
__resolveSplitType(pDimensionDefinitions[Dimensions].dimension); |
2393 |
|
pDimensionDefinitions[Dimensions].zone_size = |
2394 |
|
__resolveZoneSize(pDimensionDefinitions[Dimensions]); |
2395 |
|
|
2396 |
// create new dimension region(s) for this new dimension |
// create new dimension region(s) for this new dimension |
2397 |
for (int i = 1 << iCurrentBits; i < 1 << iNewBits; i++) { |
for (int i = 1 << iCurrentBits; i < 1 << iNewBits; i++) { |
2398 |
//TODO: maybe we should copy existing dimension regions if possible instead of simply creating new ones with default values |
//TODO: maybe we should copy existing dimension regions if possible instead of simply creating new ones with default values |
2609 |
// * |
// * |
2610 |
|
|
2611 |
Instrument::Instrument(File* pFile, RIFF::List* insList, progress_t* pProgress) : DLS::Instrument((DLS::File*)pFile, insList) { |
Instrument::Instrument(File* pFile, RIFF::List* insList, progress_t* pProgress) : DLS::Instrument((DLS::File*)pFile, insList) { |
2612 |
pInfo->UseFixedLengthStrings = true; |
static const DLS::Info::FixedStringLength fixedStringLengths[] = { |
2613 |
|
{ CHUNK_ID_INAM, 64 }, |
2614 |
|
{ CHUNK_ID_ISFT, 12 }, |
2615 |
|
{ 0, 0 } |
2616 |
|
}; |
2617 |
|
pInfo->FixedStringLengths = fixedStringLengths; |
2618 |
|
|
2619 |
// Initialization |
// Initialization |
2620 |
for (int i = 0; i < 128; i++) RegionKeyTable[i] = NULL; |
for (int i = 0; i < 128; i++) RegionKeyTable[i] = NULL; |
2621 |
|
EffectSend = 0; |
2622 |
|
Attenuation = 0; |
2623 |
|
FineTune = 0; |
2624 |
|
PitchbendRange = 0; |
2625 |
|
PianoReleaseMode = false; |
2626 |
|
DimensionKeyRange.low = 0; |
2627 |
|
DimensionKeyRange.high = 0; |
2628 |
|
|
2629 |
// Loading |
// Loading |
2630 |
RIFF::List* lart = insList->GetSubList(LIST_TYPE_LART); |
RIFF::List* lart = insList->GetSubList(LIST_TYPE_LART); |
2703 |
if (!_3ewg) _3ewg = lart->AddSubChunk(CHUNK_ID_3EWG, 12); |
if (!_3ewg) _3ewg = lart->AddSubChunk(CHUNK_ID_3EWG, 12); |
2704 |
// update '3ewg' RIFF chunk |
// update '3ewg' RIFF chunk |
2705 |
uint8_t* pData = (uint8_t*) _3ewg->LoadChunkData(); |
uint8_t* pData = (uint8_t*) _3ewg->LoadChunkData(); |
2706 |
memcpy(&pData[0], &EffectSend, 2); |
store16(&pData[0], EffectSend); |
2707 |
memcpy(&pData[2], &Attenuation, 4); |
store32(&pData[2], Attenuation); |
2708 |
memcpy(&pData[6], &FineTune, 2); |
store16(&pData[6], FineTune); |
2709 |
memcpy(&pData[8], &PitchbendRange, 2); |
store16(&pData[8], PitchbendRange); |
2710 |
const uint8_t dimkeystart = (PianoReleaseMode) ? 0x01 : 0x00 | |
const uint8_t dimkeystart = (PianoReleaseMode) ? 0x01 : 0x00 | |
2711 |
DimensionKeyRange.low << 1; |
DimensionKeyRange.low << 1; |
2712 |
memcpy(&pData[10], &dimkeystart, 1); |
pData[10] = dimkeystart; |
2713 |
memcpy(&pData[11], &DimensionKeyRange.high, 1); |
pData[11] = DimensionKeyRange.high; |
2714 |
} |
} |
2715 |
|
|
2716 |
/** |
/** |
2797 |
} |
} |
2798 |
|
|
2799 |
Group::~Group() { |
Group::~Group() { |
2800 |
|
// remove the chunk associated with this group (if any) |
2801 |
|
if (pNameChunk) pNameChunk->GetParent()->DeleteSubChunk(pNameChunk); |
2802 |
} |
} |
2803 |
|
|
2804 |
/** @brief Update chunks with current group settings. |
/** @brief Update chunks with current group settings. |
2805 |
* |
* |
2806 |
* Apply current Group field values to the respective. You have to call |
* Apply current Group field values to the respective chunks. You have |
2807 |
* File::Save() to make changes persistent. |
* to call File::Save() to make changes persistent. |
2808 |
|
* |
2809 |
|
* Usually there is absolutely no need to call this method explicitly. |
2810 |
|
* It will be called automatically when File::Save() was called. |
2811 |
*/ |
*/ |
2812 |
void Group::UpdateChunks() { |
void Group::UpdateChunks() { |
2813 |
// make sure <3gri> and <3gnl> list chunks exist |
// make sure <3gri> and <3gnl> list chunks exist |
2814 |
RIFF::List* _3gri = pFile->pRIFF->GetSubList(LIST_TYPE_3GRI); |
RIFF::List* _3gri = pFile->pRIFF->GetSubList(LIST_TYPE_3GRI); |
2815 |
if (!_3gri) _3gri = pFile->pRIFF->AddSubList(LIST_TYPE_3GRI); |
if (!_3gri) { |
2816 |
|
_3gri = pFile->pRIFF->AddSubList(LIST_TYPE_3GRI); |
2817 |
|
pFile->pRIFF->MoveSubChunk(_3gri, pFile->pRIFF->GetSubChunk(CHUNK_ID_PTBL)); |
2818 |
|
} |
2819 |
RIFF::List* _3gnl = _3gri->GetSubList(LIST_TYPE_3GNL); |
RIFF::List* _3gnl = _3gri->GetSubList(LIST_TYPE_3GNL); |
2820 |
if (!_3gnl) _3gnl = pFile->pRIFF->AddSubList(LIST_TYPE_3GNL); |
if (!_3gnl) _3gnl = _3gri->AddSubList(LIST_TYPE_3GNL); |
2821 |
// now store the name of this group as <3gnm> chunk as subchunk of the <3gnl> list chunk |
// now store the name of this group as <3gnm> chunk as subchunk of the <3gnl> list chunk |
2822 |
::SaveString(CHUNK_ID_3GNM, pNameChunk, _3gnl, Name, String("Unnamed Group"), true, 64); |
::SaveString(CHUNK_ID_3GNM, pNameChunk, _3gnl, Name, String("Unnamed Group"), true, 64); |
2823 |
} |
} |
2893 |
// *************** File *************** |
// *************** File *************** |
2894 |
// * |
// * |
2895 |
|
|
2896 |
|
const DLS::Info::FixedStringLength File::FixedStringLengths[] = { |
2897 |
|
{ CHUNK_ID_IARL, 256 }, |
2898 |
|
{ CHUNK_ID_IART, 128 }, |
2899 |
|
{ CHUNK_ID_ICMS, 128 }, |
2900 |
|
{ CHUNK_ID_ICMT, 1024 }, |
2901 |
|
{ CHUNK_ID_ICOP, 128 }, |
2902 |
|
{ CHUNK_ID_ICRD, 128 }, |
2903 |
|
{ CHUNK_ID_IENG, 128 }, |
2904 |
|
{ CHUNK_ID_IGNR, 128 }, |
2905 |
|
{ CHUNK_ID_IKEY, 128 }, |
2906 |
|
{ CHUNK_ID_IMED, 128 }, |
2907 |
|
{ CHUNK_ID_INAM, 128 }, |
2908 |
|
{ CHUNK_ID_IPRD, 128 }, |
2909 |
|
{ CHUNK_ID_ISBJ, 128 }, |
2910 |
|
{ CHUNK_ID_ISFT, 128 }, |
2911 |
|
{ CHUNK_ID_ISRC, 128 }, |
2912 |
|
{ CHUNK_ID_ISRF, 128 }, |
2913 |
|
{ CHUNK_ID_ITCH, 128 }, |
2914 |
|
{ 0, 0 } |
2915 |
|
}; |
2916 |
|
|
2917 |
File::File() : DLS::File() { |
File::File() : DLS::File() { |
2918 |
pGroups = NULL; |
pGroups = NULL; |
2919 |
pInfo->UseFixedLengthStrings = true; |
pInfo->FixedStringLengths = FixedStringLengths; |
2920 |
|
pInfo->ArchivalLocation = String(256, ' '); |
2921 |
|
|
2922 |
|
// add some mandatory chunks to get the file chunks in right |
2923 |
|
// order (INFO chunk will be moved to first position later) |
2924 |
|
pRIFF->AddSubChunk(CHUNK_ID_VERS, 8); |
2925 |
|
pRIFF->AddSubChunk(CHUNK_ID_COLH, 4); |
2926 |
} |
} |
2927 |
|
|
2928 |
File::File(RIFF::File* pRIFF) : DLS::File(pRIFF) { |
File::File(RIFF::File* pRIFF) : DLS::File(pRIFF) { |
2929 |
pGroups = NULL; |
pGroups = NULL; |
2930 |
pInfo->UseFixedLengthStrings = true; |
pInfo->FixedStringLengths = FixedStringLengths; |
2931 |
} |
} |
2932 |
|
|
2933 |
File::~File() { |
File::~File() { |
2969 |
// create new Sample object and its respective 'wave' list chunk |
// create new Sample object and its respective 'wave' list chunk |
2970 |
RIFF::List* wave = wvpl->AddSubList(LIST_TYPE_WAVE); |
RIFF::List* wave = wvpl->AddSubList(LIST_TYPE_WAVE); |
2971 |
Sample* pSample = new Sample(this, wave, 0 /*arbitrary value, we update offsets when we save*/); |
Sample* pSample = new Sample(this, wave, 0 /*arbitrary value, we update offsets when we save*/); |
2972 |
|
|
2973 |
|
// add mandatory chunks to get the chunks in right order |
2974 |
|
wave->AddSubChunk(CHUNK_ID_FMT, 16); |
2975 |
|
wave->AddSubList(LIST_TYPE_INFO); |
2976 |
|
|
2977 |
pSamples->push_back(pSample); |
pSamples->push_back(pSample); |
2978 |
return pSample; |
return pSample; |
2979 |
} |
} |
3002 |
void File::LoadSamples(progress_t* pProgress) { |
void File::LoadSamples(progress_t* pProgress) { |
3003 |
// Groups must be loaded before samples, because samples will try |
// Groups must be loaded before samples, because samples will try |
3004 |
// to resolve the group they belong to |
// to resolve the group they belong to |
3005 |
LoadGroups(); |
if (!pGroups) LoadGroups(); |
3006 |
|
|
3007 |
if (!pSamples) pSamples = new SampleList; |
if (!pSamples) pSamples = new SampleList; |
3008 |
|
|
3116 |
__ensureMandatoryChunksExist(); |
__ensureMandatoryChunksExist(); |
3117 |
RIFF::List* lstInstruments = pRIFF->GetSubList(LIST_TYPE_LINS); |
RIFF::List* lstInstruments = pRIFF->GetSubList(LIST_TYPE_LINS); |
3118 |
RIFF::List* lstInstr = lstInstruments->AddSubList(LIST_TYPE_INS); |
RIFF::List* lstInstr = lstInstruments->AddSubList(LIST_TYPE_INS); |
3119 |
|
|
3120 |
|
// add mandatory chunks to get the chunks in right order |
3121 |
|
lstInstr->AddSubList(LIST_TYPE_INFO); |
3122 |
|
|
3123 |
Instrument* pInstrument = new Instrument(this, lstInstr); |
Instrument* pInstrument = new Instrument(this, lstInstr); |
3124 |
|
|
3125 |
|
lstInstr->AddSubChunk(CHUNK_ID_INSH, 12); |
3126 |
|
|
3127 |
|
// this string is needed for the gig to be loadable in GSt: |
3128 |
|
pInstrument->pInfo->Software = "Endless Wave"; |
3129 |
|
|
3130 |
pInstruments->push_back(pInstrument); |
pInstruments->push_back(pInstrument); |
3131 |
return pInstrument; |
return pInstrument; |
3132 |
} |
} |
3283 |
} |
} |
3284 |
} |
} |
3285 |
|
|
3286 |
|
/** |
3287 |
|
* Apply all the gig file's current instruments, samples, groups and settings |
3288 |
|
* to the respective RIFF chunks. You have to call Save() to make changes |
3289 |
|
* persistent. |
3290 |
|
* |
3291 |
|
* Usually there is absolutely no need to call this method explicitly. |
3292 |
|
* It will be called automatically when File::Save() was called. |
3293 |
|
* |
3294 |
|
* @throws Exception - on errors |
3295 |
|
*/ |
3296 |
|
void File::UpdateChunks() { |
3297 |
|
RIFF::Chunk* info = pRIFF->GetSubList(LIST_TYPE_INFO); |
3298 |
|
|
3299 |
|
// first update base class's chunks |
3300 |
|
DLS::File::UpdateChunks(); |
3301 |
|
|
3302 |
|
if (!info) { |
3303 |
|
// INFO was added by Resource::UpdateChunks - make sure it |
3304 |
|
// is placed first in file |
3305 |
|
info = pRIFF->GetSubList(LIST_TYPE_INFO); |
3306 |
|
RIFF::Chunk* first = pRIFF->GetFirstSubChunk(); |
3307 |
|
if (first != info) { |
3308 |
|
pRIFF->MoveSubChunk(info, first); |
3309 |
|
} |
3310 |
|
} |
3311 |
|
|
3312 |
|
// update group's chunks |
3313 |
|
if (pGroups) { |
3314 |
|
std::list<Group*>::iterator iter = pGroups->begin(); |
3315 |
|
std::list<Group*>::iterator end = pGroups->end(); |
3316 |
|
for (; iter != end; ++iter) { |
3317 |
|
(*iter)->UpdateChunks(); |
3318 |
|
} |
3319 |
|
} |
3320 |
|
} |
3321 |
|
|
3322 |
|
|
3323 |
|
|
3324 |
// *************** Exception *************** |
// *************** Exception *************** |