137 |
int i = 0; |
int i = 0; |
138 |
while (::sfz::Region* region = q.next()) { |
while (::sfz::Region* region = q.next()) { |
139 |
itNoteOffEvent->Param.Note.pRegion = region; |
itNoteOffEvent->Param.Note.pRegion = region; |
140 |
LaunchVoice(pChannel, itNoteOffEvent, i, true, false, false); //FIXME: for the moment we don't perform voice stealing for release triggered samples |
LaunchVoice(pChannel, itNoteOffEvent, i, true, false, true); //FIXME: for the moment we don't perform voice stealing for release triggered samples |
141 |
i++; |
i++; |
142 |
} |
} |
143 |
} |
} |
161 |
// no need to process if sample is silent |
// no need to process if sample is silent |
162 |
if (!pRgn->GetSample() || !pRgn->GetSample()->GetTotalFrameCount()) return Pool<Voice>::Iterator(); |
if (!pRgn->GetSample() || !pRgn->GetSample()->GetTotalFrameCount()) return Pool<Voice>::Iterator(); |
163 |
|
|
164 |
// only mark the first voice of a layered voice (group) to be in a |
if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(pRgn->group, itNoteOnEvent); |
|
// key group, so the layered voices won't kill each other |
|
|
int iKeyGroup = (iLayer == 0 && !ReleaseTriggerVoice) ? pRgn->group : 0; |
|
|
if (HandleKeyGroupConflicts) pChannel->HandleKeyGroupConflicts(iKeyGroup, itNoteOnEvent, pRgn->off_mode == ::sfz::OFF_NORMAL); |
|
165 |
|
|
166 |
// allocate a new voice for the key |
// allocate a new voice for the key |
167 |
itNewVoice = pKey->pActiveVoices->allocAppend(); |
itNewVoice = pKey->pActiveVoices->allocAppend(); |
168 |
int res = InitNewVoice ( |
int res = InitNewVoice ( |
169 |
pChannel, pRgn, itNoteOnEvent, VoiceType, iLayer, |
pChannel, pRgn, itNoteOnEvent, VoiceType, iLayer, |
170 |
iKeyGroup, ReleaseTriggerVoice, VoiceStealing, itNewVoice |
pRgn->off_by, ReleaseTriggerVoice, VoiceStealing, itNewVoice |
171 |
); |
); |
172 |
if (!res) return itNewVoice; |
if (!res) return itNewVoice; |
173 |
|
|
188 |
} |
} |
189 |
|
|
190 |
String Engine::Version() { |
String Engine::Version() { |
191 |
String s = "$Revision: 1.9 $"; |
String s = "$Revision: 1.10 $"; |
192 |
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 |
193 |
} |
} |
194 |
|
|