288 |
// free the voice object |
// free the voice object |
289 |
pKey->pActiveVoices->free(itVoice); |
pKey->pActiveVoices->free(itVoice); |
290 |
|
|
291 |
// if no other voices left and member of a key group, remove from key group |
// if member of a key group and no other non-release-trigger |
292 |
if (pKey->pActiveVoices->isEmpty() && keygroup) { |
// voices left, remove from key group |
293 |
uint** ppKeyGroup = &ActiveKeyGroups[keygroup]; |
if (keygroup) { |
294 |
if (*ppKeyGroup == &*pKey->itSelf) *ppKeyGroup = NULL; // remove key from key group |
RTListVoiceIterator it = pKey->pActiveVoices->first(); |
295 |
|
RTListVoiceIterator end = pKey->pActiveVoices->end(); |
296 |
|
for (; it != end ; ++it) { |
297 |
|
if (it->Type != V::type_release_trigger) break; |
298 |
|
} |
299 |
|
if (it == end) { |
300 |
|
uint** ppKeyGroup = &ActiveKeyGroups[keygroup]; |
301 |
|
if (*ppKeyGroup == &*pKey->itSelf) *ppKeyGroup = NULL; // remove key from key group |
302 |
|
} |
303 |
} |
} |
304 |
} |
} |
305 |
else std::cerr << "Couldn't release voice! (!itVoice)\n" << std::flush; |
else std::cerr << "Couldn't release voice! (!itVoice)\n" << std::flush; |