Lines Matching refs:pVoice
177 void InitVoice (S_SYNTH_VOICE *pVoice) in InitVoice() argument
179 pVoice->channel = UNASSIGNED_SYNTH_CHANNEL; in InitVoice()
180 pVoice->nextChannel = UNASSIGNED_SYNTH_CHANNEL; in InitVoice()
181 pVoice->note = pVoice->nextNote = DEFAULT_KEY_NUMBER; in InitVoice()
182 pVoice->velocity = pVoice->nextVelocity = DEFAULT_VELOCITY; in InitVoice()
183 pVoice->regionIndex = DEFAULT_REGION_INDEX; in InitVoice()
184 pVoice->age = DEFAULT_AGE; in InitVoice()
185 pVoice->voiceFlags = DEFAULT_VOICE_FLAGS; in InitVoice()
186 pVoice->voiceState = DEFAULT_VOICE_STATE; in InitVoice()
195 static void IncVoicePoolCount (S_VOICE_MGR *pVoiceMgr, S_SYNTH_VOICE *pVoice) in IncVoicePoolCount() argument
201 if (pVoice->voiceState == eVoiceStateMuting) in IncVoicePoolCount()
204 if (pVoice->voiceState == eVoiceStateStolen) in IncVoicePoolCount()
206 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in IncVoicePoolCount()
207 pool = pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool; in IncVoicePoolCount()
211 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in IncVoicePoolCount()
212 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool; in IncVoicePoolCount()
228 static void DecVoicePoolCount (S_VOICE_MGR *pVoiceMgr, S_SYNTH_VOICE *pVoice) in DecVoicePoolCount() argument
234 if (pVoice->voiceState == eVoiceStateMuting) in DecVoicePoolCount()
237 if (pVoice->voiceState == eVoiceStateStolen) in DecVoicePoolCount()
239 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in DecVoicePoolCount()
240 pool = pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool; in DecVoicePoolCount()
244 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in DecVoicePoolCount()
245 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool; in DecVoicePoolCount()
615 S_SYNTH_VOICE *pVoice; in VMMuteVoice() local
618 pVoice = &pVoiceMgr->voices[voiceNum]; in VMMuteVoice()
619 if ((pVoice->voiceState == eVoiceStateMuting) || (pVoice->voiceState == eVoiceStateFree)) in VMMuteVoice()
623 DecVoicePoolCount(pVoiceMgr, pVoice); in VMMuteVoice()
625 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMMuteVoice()
626 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMMuteVoice()
627 pVoice->voiceState = eVoiceStateMuting; in VMMuteVoice()
639 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMReleaseVoice() local
642 if (( pVoice->voiceState == eVoiceStateMuting) || in VMReleaseVoice()
643 (pVoice->voiceState == eVoiceStateFree) || in VMReleaseVoice()
644 (pVoice->voiceState == eVoiceStateRelease)) in VMReleaseVoice()
648 if (pVoice->voiceState == eVoiceStateStolen) in VMReleaseVoice()
653 pVoice->voiceState = eVoiceStateRelease; in VMReleaseVoice()
983 S_SYNTH_VOICE *pVoice; in VMAllNotesOff() local
1001 pVoice = &pVoiceMgr->voices[voiceNum]; in VMAllNotesOff()
1002 if (pVoice->voiceState != eVoiceStateFree) in VMAllNotesOff()
1004 if (((pVoice->voiceState != eVoiceStateStolen) && (channel == pVoice->channel)) || in VMAllNotesOff()
1005 ((pVoice->voiceState == eVoiceStateStolen) && (channel == pVoice->nextChannel))) in VMAllNotesOff()
1008 … GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMAllNotesOff()
1009 pVoice->voiceState = eVoiceStateMuting; in VMAllNotesOff()
1142 S_SYNTH_VOICE *pVoice; in VMReleaseAllDeferredNoteOffs() local
1162 pVoice = &pVoiceMgr->voices[voiceNum]; in VMReleaseAllDeferredNoteOffs()
1163 if (channel == pVoice->channel) in VMReleaseAllDeferredNoteOffs()
1167 if (pVoice->voiceFlags & VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF) in VMReleaseAllDeferredNoteOffs()
1173 pVoice->voiceFlags &= ~VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF; in VMReleaseAllDeferredNoteOffs()
1273 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMStolenVoice() local
1276 DecVoicePoolCount(pVoiceMgr, pVoice); in VMStolenVoice()
1279 …GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)], &pVo… in VMStolenVoice()
1280 pVoice->voiceState = eVoiceStateStolen; in VMStolenVoice()
1283 pVoice->nextChannel = VSynthToChannel(pSynth, channel); in VMStolenVoice()
1284 pVoice->nextNote = note; in VMStolenVoice()
1285 pVoice->nextVelocity = velocity; in VMStolenVoice()
1286 pVoice->nextRegionIndex = regionIndex; in VMStolenVoice()
1289 IncVoicePoolCount(pVoiceMgr, pVoice); in VMStolenVoice()
1292 pVoice->voiceFlags &= in VMStolenVoice()
1298 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age); in VMStolenVoice()
1301 pVoice->age = pVoiceMgr->age++; in VMStolenVoice()
1318 static void VMFreeVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice) in VMFreeVoice() argument
1322 if (pVoice->voiceState == eVoiceStateFree) in VMFreeVoice()
1330 DecVoicePoolCount(pVoiceMgr, pVoice); in VMFreeVoice()
1340 InitVoice(pVoice); in VMFreeVoice()
1347 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age); in VMFreeVoice()
1368 S_SYNTH_VOICE *pVoice; in VMRetargetStolenVoice() local
1373 pVoice = &pVoiceMgr->voices[voiceNum]; in VMRetargetStolenVoice()
1374 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMRetargetStolenVoice()
1375 pMIDIChannel = &pSynth->channels[pVoice->channel & 15]; in VMRetargetStolenVoice()
1376 pNextSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in VMRetargetStolenVoice()
1395 if (pVoice->channel != pVoice->nextChannel) in VMRetargetStolenVoice()
1405 pVoice->channel = pVoice->nextChannel; in VMRetargetStolenVoice()
1406 pMIDIChannel = &pNextSynth->channels[pVoice->channel & 15]; in VMRetargetStolenVoice()
1409 pVoice->note = pVoice->nextNote; in VMRetargetStolenVoice()
1410 pVoice->velocity = pVoice->nextVelocity; in VMRetargetStolenVoice()
1411 pVoice->nextChannel = UNASSIGNED_SYNTH_CHANNEL; in VMRetargetStolenVoice()
1412 pVoice->regionIndex = pVoice->nextRegionIndex; in VMRetargetStolenVoice()
1415 flags = pVoice->voiceFlags; in VMRetargetStolenVoice()
1421 pVoice->voiceState = eVoiceStateStart; in VMRetargetStolenVoice()
1424 …Mgr, pNextSynth, &pVoiceMgr->voices[voiceNum], GetAdjustedVoiceNum(voiceNum), pVoice->regionIndex); in VMRetargetStolenVoice()
1432 pVoice->voiceFlags |= VOICE_FLAG_DEFER_MIDI_NOTE_OFF; in VMRetargetStolenVoice()
1676 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMStartVoice() local
1703 IncVoicePoolCount(pVoiceMgr, pVoice); in VMStartVoice()
3117 S_SYNTH_VOICE *pVoice; in VMSetSynthPolyphony() local
3126 pVoice = &pVoiceMgr->voices[i]; in VMSetSynthPolyphony()
3129 … if ((pVoice->voiceState == eVoiceStateFree) || (pVoice->voiceState == eVoiceStateMuting)) in VMSetSynthPolyphony()
3132 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMSetSynthPolyphony()
3135 …if (( pVoice->voiceState == eVoiceStateStolen) || (pVoice->voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNT… in VMSetSynthPolyphony()
3138 currentPriority = 128 - pVoice->nextVelocity; in VMSetSynthPolyphony()
3141 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STE… in VMSetSynthPolyphony()
3146 currentPriority = (EAS_I32) pVoice->age << NOTE_AGE_STEAL_WEIGHT; in VMSetSynthPolyphony()
3151 ((EAS_I32) pVoice->gain >> (12 - NOTE_GAIN_STEAL_WEIGHT)); in VMSetSynthPolyphony()
3154 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->channel)].pool << CHANNEL_PRIORITY_STEAL_W… in VMSetSynthPolyphony()
3287 S_SYNTH_VOICE *pVoice; in VMSetPolyphony() local
3295 pVoice = &pVoiceMgr->voices[i]; in VMSetPolyphony()
3298 if (GET_VSYNTH(pVoice->nextChannel) != pSynth->vSynthNum) in VMSetPolyphony()
3302 …if (( pVoice->voiceState == eVoiceStateStolen) || (pVoice->voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNT… in VMSetPolyphony()
3305 currentPriority = 128 - pVoice->nextVelocity; in VMSetPolyphony()
3308 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STE… in VMSetPolyphony()
3313 currentPriority = (EAS_I32) pVoice->age << NOTE_AGE_STEAL_WEIGHT; in VMSetPolyphony()
3318 ((EAS_I32) pVoice->gain >> (12 - NOTE_GAIN_STEAL_WEIGHT)); in VMSetPolyphony()
3321 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STE… in VMSetPolyphony()
3850 S_SYNTH_VOICE *pVoice; in VMSanityCheck() local
3871 pVoice = &pEASData->pVoiceMgr->voices[i]; in VMSanityCheck()
3872 if (pVoice->voiceState != eVoiceStateFree) in VMSanityCheck()
3874 vSynthNum = GET_VSYNTH(pVoice->channel); in VMSanityCheck()
3883 switch (pVoice->voiceState) in VMSanityCheck()
3891 vSynthNum = GET_VSYNTH(pVoice->nextChannel); in VMSanityCheck()
3901 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool]++; in VMSanityCheck()
3908 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++; in VMSanityCheck()
3914 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++; in VMSanityCheck()