Lines Matching refs:pVoice

177 void InitVoice (S_SYNTH_VOICE *pVoice)
179 pVoice->channel = UNASSIGNED_SYNTH_CHANNEL;
180 pVoice->nextChannel = UNASSIGNED_SYNTH_CHANNEL;
181 pVoice->note = pVoice->nextNote = DEFAULT_KEY_NUMBER;
182 pVoice->velocity = pVoice->nextVelocity = DEFAULT_VELOCITY;
183 pVoice->regionIndex = DEFAULT_REGION_INDEX;
184 pVoice->age = DEFAULT_AGE;
185 pVoice->voiceFlags = DEFAULT_VOICE_FLAGS;
186 pVoice->voiceState = DEFAULT_VOICE_STATE;
195 static void IncVoicePoolCount (S_VOICE_MGR *pVoiceMgr, S_SYNTH_VOICE *pVoice)
201 if (pVoice->voiceState == eVoiceStateMuting)
204 if (pVoice->voiceState == eVoiceStateStolen)
206 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)];
207 pool = pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool;
211 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
212 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool;
228 static void DecVoicePoolCount (S_VOICE_MGR *pVoiceMgr, S_SYNTH_VOICE *pVoice)
234 if (pVoice->voiceState == eVoiceStateMuting)
237 if (pVoice->voiceState == eVoiceStateStolen)
239 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)];
240 pool = pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool;
244 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
245 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool;
615 S_SYNTH_VOICE *pVoice;
618 pVoice = &pVoiceMgr->voices[voiceNum];
619 if ((pVoice->voiceState == eVoiceStateMuting) || (pVoice->voiceState == eVoiceStateFree))
623 DecVoicePoolCount(pVoiceMgr, pVoice);
625 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
626 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum));
627 pVoice->voiceState = eVoiceStateMuting;
639 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum];
642 if (( pVoice->voiceState == eVoiceStateMuting) ||
643 (pVoice->voiceState == eVoiceStateFree) ||
644 (pVoice->voiceState == eVoiceStateRelease))
648 if (pVoice->voiceState == eVoiceStateStolen)
653 pVoice->voiceState = eVoiceStateRelease;
983 S_SYNTH_VOICE *pVoice;
1001 pVoice = &pVoiceMgr->voices[voiceNum];
1002 if (pVoice->voiceState != eVoiceStateFree)
1004 if (((pVoice->voiceState != eVoiceStateStolen) && (channel == pVoice->channel)) ||
1005 ((pVoice->voiceState == eVoiceStateStolen) && (channel == pVoice->nextChannel)))
1008 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum));
1009 pVoice->voiceState = eVoiceStateMuting;
1135 * pVoice->m_sEG1.m_eState = eEnvelopeStateRelease
1136 * pVoice->m_sEG1.m_nIncrement = release increment
1137 * pVoice->m_nFlags = clear the deferred note off flag
1142 S_SYNTH_VOICE *pVoice;
1162 pVoice = &pVoiceMgr->voices[voiceNum];
1163 if (channel == pVoice->channel)
1167 if (pVoice->voiceFlags & VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF)
1173 pVoice->voiceFlags &= ~VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF;
1262 * pVoice - pointer to voice to steal
1273 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum];
1276 DecVoicePoolCount(pVoiceMgr, pVoice);
1279 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)], &pVoiceMgr->voices[voiceNum], GetAdjustedVoiceNum(voiceNum));
1280 pVoice->voiceState = eVoiceStateStolen;
1283 pVoice->nextChannel = VSynthToChannel(pSynth, channel);
1284 pVoice->nextNote = note;
1285 pVoice->nextVelocity = velocity;
1286 pVoice->nextRegionIndex = regionIndex;
1289 IncVoicePoolCount(pVoiceMgr, pVoice);
1292 pVoice->voiceFlags &=
1298 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age);
1301 pVoice->age = pVoiceMgr->age++;
1312 * pVoice - pointer to voice to free
1318 static void VMFreeVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice)
1322 if (pVoice->voiceState == eVoiceStateFree)
1330 DecVoicePoolCount(pVoiceMgr, pVoice);
1340 InitVoice(pVoice);
1343 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMFreeVoice: free voice %d\n", pVoice - pVoiceMgr->voices); */ }
1347 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age);
1358 * pVoice - pointer to voice to retarget
1368 S_SYNTH_VOICE *pVoice;
1373 pVoice = &pVoiceMgr->voices[voiceNum];
1374 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
1375 pMIDIChannel = &pSynth->channels[pVoice->channel & 15];
1376 pNextSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)];
1380 voiceNum, pVoice->channel); */ }
1383 pVoice->nextChannel, pVoice->nextNote, pVoice->nextVelocity); */ }
1395 if (pVoice->channel != pVoice->nextChannel)
1405 pVoice->channel = pVoice->nextChannel;
1406 pMIDIChannel = &pNextSynth->channels[pVoice->channel & 15];
1409 pVoice->note = pVoice->nextNote;
1410 pVoice->velocity = pVoice->nextVelocity;
1411 pVoice->nextChannel = UNASSIGNED_SYNTH_CHANNEL;
1412 pVoice->regionIndex = pVoice->nextRegionIndex;
1415 flags = pVoice->voiceFlags;
1421 pVoice->voiceState = eVoiceStateStart;
1424 GetSynthPtr(voiceNum)->pfStartVoice(pVoiceMgr, pNextSynth, &pVoiceMgr->voices[voiceNum], GetAdjustedVoiceNum(voiceNum), pVoice->regionIndex);
1432 pVoice->voiceFlags |= VOICE_FLAG_DEFER_MIDI_NOTE_OFF;
1676 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum];
1703 IncVoicePoolCount(pVoiceMgr, pVoice);
3117 S_SYNTH_VOICE *pVoice;
3126 pVoice = &pVoiceMgr->voices[i];
3129 if ((pVoice->voiceState == eVoiceStateFree) || (pVoice->voiceState == eVoiceStateMuting))
3132 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
3135 if (( pVoice->voiceState == eVoiceStateStolen) || (pVoice->voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET))
3138 currentPriority = 128 - pVoice->nextVelocity;
3141 currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
3146 currentPriority = (EAS_I32) pVoice->age << NOTE_AGE_STEAL_WEIGHT;
3151 ((EAS_I32) pVoice->gain >> (12 - NOTE_GAIN_STEAL_WEIGHT));
3154 currentPriority += pSynth->channels[GET_CHANNEL(pVoice->channel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
3287 S_SYNTH_VOICE *pVoice;
3295 pVoice = &pVoiceMgr->voices[i];
3298 if (GET_VSYNTH(pVoice->nextChannel) != pSynth->vSynthNum)
3302 if (( pVoice->voiceState == eVoiceStateStolen) || (pVoice->voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET))
3305 currentPriority = 128 - pVoice->nextVelocity;
3308 currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
3313 currentPriority = (EAS_I32) pVoice->age << NOTE_AGE_STEAL_WEIGHT;
3318 ((EAS_I32) pVoice->gain >> (12 - NOTE_GAIN_STEAL_WEIGHT));
3321 currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
3850 S_SYNTH_VOICE *pVoice;
3871 pVoice = &pEASData->pVoiceMgr->voices[i];
3872 if (pVoice->voiceState != eVoiceStateFree)
3874 vSynthNum = GET_VSYNTH(pVoice->channel);
3883 switch (pVoice->voiceState)
3891 vSynthNum = GET_VSYNTH(pVoice->nextChannel);
3901 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool]++;
3908 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++;
3914 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++;