108 |
* @param pInstrument - points to the loaded instrument which provides sample wave(s) and articulation data |
* @param pInstrument - points to the loaded instrument which provides sample wave(s) and articulation data |
109 |
* @param iLayer - layer number this voice refers to (only if this is a layered sound of course) |
* @param iLayer - layer number this voice refers to (only if this is a layered sound of course) |
110 |
* @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false) |
* @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false) |
111 |
|
* @param VoiceStealing - wether the voice is allowed to steal voices for further subvoices |
112 |
* @returns 0 on success, a value < 0 if something failed |
* @returns 0 on success, a value < 0 if something failed |
113 |
*/ |
*/ |
114 |
int Voice::Trigger(Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice) { |
int Voice::Trigger(Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) { |
115 |
if (!pInstrument) { |
if (!pInstrument) { |
116 |
dmsg(1,("voice::trigger: !pInstrument\n")); |
dmsg(1,("voice::trigger: !pInstrument\n")); |
117 |
exit(EXIT_FAILURE); |
exit(EXIT_FAILURE); |
147 |
// if this is the 1st layer then spawn further voices for all the other layers |
// if this is the 1st layer then spawn further voices for all the other layers |
148 |
if (iLayer == 0) |
if (iLayer == 0) |
149 |
for (int iNewLayer = 1; iNewLayer < pRegion->pDimensionDefinitions[i].zones; iNewLayer++) |
for (int iNewLayer = 1; iNewLayer < pRegion->pDimensionDefinitions[i].zones; iNewLayer++) |
150 |
itChildVoice = pEngine->LaunchVoice(itNoteOnEvent, iNewLayer, ReleaseTriggerVoice); |
itChildVoice = pEngine->LaunchVoice(itNoteOnEvent, iNewLayer, ReleaseTriggerVoice, VoiceStealing); |
151 |
break; |
break; |
152 |
case ::gig::dimension_velocity: |
case ::gig::dimension_velocity: |
153 |
DimValues[i] = itNoteOnEvent->Param.Note.Velocity; |
DimValues[i] = itNoteOnEvent->Param.Note.Velocity; |
1057 |
* @param itKillEvent - event which caused the voice to be killed |
* @param itKillEvent - event which caused the voice to be killed |
1058 |
*/ |
*/ |
1059 |
void Voice::Kill(Pool<Event>::Iterator& itKillEvent) { |
void Voice::Kill(Pool<Event>::Iterator& itKillEvent) { |
1060 |
|
//FIXME: just two sanity checks for debugging, can be removed |
1061 |
|
if (!itKillEvent) dmsg(1,("gig::Voice::Kill(): ERROR, !itKillEvent !!!\n")); |
1062 |
|
if (itKillEvent && !itKillEvent.isValid()) dmsg(1,("gig::Voice::Kill(): ERROR, itKillEvent invalid !!!\n")); |
1063 |
|
|
1064 |
if (itTriggerEvent && itKillEvent->FragmentPos() <= itTriggerEvent->FragmentPos()) return; |
if (itTriggerEvent && itKillEvent->FragmentPos() <= itTriggerEvent->FragmentPos()) return; |
1065 |
this->itKillEvent = itKillEvent; |
this->itKillEvent = itKillEvent; |
1066 |
} |
} |