141 |
if (pEventGenerator) delete pEventGenerator; |
if (pEventGenerator) delete pEventGenerator; |
142 |
if (pVoiceStealingQueue) delete pVoiceStealingQueue; |
if (pVoiceStealingQueue) delete pVoiceStealingQueue; |
143 |
if (pSysexBuffer) delete pSysexBuffer; |
if (pSysexBuffer) delete pSysexBuffer; |
144 |
|
if (pGlobalEvents) delete pGlobalEvents; |
145 |
|
if (InstrumentChangeQueue) delete InstrumentChangeQueue; |
146 |
|
if (InstrumentChangeReplyQueue) delete InstrumentChangeReplyQueue; |
147 |
|
if (pDimRegionsInUse) delete[] pDimRegionsInUse; |
148 |
Unregister(); |
Unregister(); |
149 |
} |
} |
150 |
|
|
526 |
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted |
527 |
#endif |
#endif |
528 |
|
|
529 |
|
uint vc = 0; |
530 |
|
uint sc = 0; |
531 |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first(); |
532 |
RTList<uint>::Iterator end = pEngineChannel->pActiveKeys->end(); |
RTList<uint>::Iterator end = pEngineChannel->pActiveKeys->end(); |
533 |
while (iuiKey != end) { // iterate through all active keys |
while (iuiKey != end) { // iterate through all active keys |
539 |
for (; itVoice != itVoicesEnd; ++itVoice) { // iterate through all voices on this key |
for (; itVoice != itVoicesEnd; ++itVoice) { // iterate through all voices on this key |
540 |
// now render current voice |
// now render current voice |
541 |
itVoice->Render(Samples); |
itVoice->Render(Samples); |
542 |
if (itVoice->IsActive()) ActiveVoiceCountTemp++; // still active |
if (itVoice->IsActive()) { // still active |
543 |
else { // voice reached end, is now inactive |
ActiveVoiceCountTemp++; |
544 |
|
vc++; |
545 |
|
|
546 |
|
if (itVoice->PlaybackState == Voice::playback_state_disk) { |
547 |
|
if ((itVoice->DiskStreamRef).State == Stream::state_active) sc++; |
548 |
|
} |
549 |
|
} else { // voice reached end, is now inactive |
550 |
FreeVoice(pEngineChannel, itVoice); // remove voice from the list of active voices |
FreeVoice(pEngineChannel, itVoice); // remove voice from the list of active voices |
551 |
} |
} |
552 |
} |
} |
553 |
} |
} |
554 |
|
|
555 |
|
pEngineChannel->SetVoiceCount(vc); |
556 |
|
pEngineChannel->SetDiskStreamCount(sc); |
557 |
} |
} |
558 |
|
|
559 |
/** |
/** |
579 |
LaunchVoice(pEngineChannel, itVoiceStealEvent, itVoiceStealEvent->Param.Note.Layer, itVoiceStealEvent->Param.Note.ReleaseTrigger, false, false); |
LaunchVoice(pEngineChannel, itVoiceStealEvent, itVoiceStealEvent->Param.Note.Layer, itVoiceStealEvent->Param.Note.ReleaseTrigger, false, false); |
580 |
if (itNewVoice) { |
if (itNewVoice) { |
581 |
itNewVoice->Render(Samples); |
itNewVoice->Render(Samples); |
582 |
if (itNewVoice->IsActive()) ActiveVoiceCountTemp++; // still active |
if (itNewVoice->IsActive()) { // still active |
583 |
else { // voice reached end, is now inactive |
ActiveVoiceCountTemp++; |
584 |
|
pEngineChannel->SetVoiceCount(pEngineChannel->GetVoiceCount() + 1); |
585 |
|
|
586 |
|
if (itNewVoice->PlaybackState == Voice::playback_state_disk) { |
587 |
|
if (itNewVoice->DiskStreamRef.State == Stream::state_active) { |
588 |
|
pEngineChannel->SetDiskStreamCount(pEngineChannel->GetDiskStreamCount() + 1); |
589 |
|
} |
590 |
|
} |
591 |
|
} else { // voice reached end, is now inactive |
592 |
FreeVoice(pEngineChannel, itNewVoice); // remove voice from the list of active voices |
FreeVoice(pEngineChannel, itNewVoice); // remove voice from the list of active voices |
593 |
} |
} |
594 |
} |
} |
1395 |
// workaround, so we won't have hanging notes |
// workaround, so we won't have hanging notes |
1396 |
ReleaseAllVoices(pEngineChannel, itControlChangeEvent); |
ReleaseAllVoices(pEngineChannel, itControlChangeEvent); |
1397 |
} |
} |
1398 |
|
// to avoid other MIDI CC #6 messages to be misenterpreted as RPN controller data |
1399 |
|
pEngineChannel->ResetMidiRpnController(); |
1400 |
break; |
break; |
1401 |
} |
} |
1402 |
case 7: { // volume |
case 7: { // volume |
1547 |
FxSend* pFxSend = pEngineChannel->GetFxSend(iFxSend); |
FxSend* pFxSend = pEngineChannel->GetFxSend(iFxSend); |
1548 |
if (pFxSend->MidiController() == itControlChangeEvent->Param.CC.Controller) |
if (pFxSend->MidiController() == itControlChangeEvent->Param.CC.Controller) |
1549 |
pFxSend->SetLevel(itControlChangeEvent->Param.CC.Value); |
pFxSend->SetLevel(itControlChangeEvent->Param.CC.Value); |
1550 |
|
pFxSend->SetInfoChanged(true); |
1551 |
} |
} |
1552 |
} |
} |
1553 |
} |
} |
1744 |
} |
} |
1745 |
|
|
1746 |
String Engine::Version() { |
String Engine::Version() { |
1747 |
String s = "$Revision: 1.74 $"; |
String s = "$Revision: 1.78 $"; |
1748 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
1749 |
} |
} |
1750 |
|
|