Lines Matching refs:pVoiceMgr
195 static void IncVoicePoolCount (S_VOICE_MGR *pVoiceMgr, S_SYNTH_VOICE *pVoice) in IncVoicePoolCount() argument
206 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in IncVoicePoolCount()
211 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in IncVoicePoolCount()
228 static void DecVoicePoolCount (S_VOICE_MGR *pVoiceMgr, S_SYNTH_VOICE *pVoice) in DecVoicePoolCount() argument
239 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in DecVoicePoolCount()
244 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in DecVoicePoolCount()
269 S_VOICE_MGR *pVoiceMgr; in VMInitialize() local
274 pVoiceMgr = EAS_CMEnumData(EAS_CM_SYNTH_DATA); in VMInitialize()
276 pVoiceMgr = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_VOICE_MGR)); in VMInitialize()
277 if (!pVoiceMgr) in VMInitialize()
282 EAS_HWMemSet(pVoiceMgr, 0, sizeof(S_VOICE_MGR)); in VMInitialize()
285 pVoiceMgr->pGlobalEAS = (S_EAS*) &easSoundLib; in VMInitialize()
286 pVoiceMgr->maxPolyphony = (EAS_U16) MAX_SYNTH_VOICES; in VMInitialize()
289 pVoiceMgr->maxPolyphonyPrimary = NUM_PRIMARY_VOICES; in VMInitialize()
290 pVoiceMgr->maxPolyphonySecondary = NUM_SECONDARY_VOICES; in VMInitialize()
294 pVoiceMgr->maxWorkLoad = 0; in VMInitialize()
298 InitVoice(&pVoiceMgr->voices[i]); in VMInitialize()
302 pPrimarySynth->pfInitialize(pVoiceMgr); in VMInitialize()
307 pSecondarySynth->pfInitialize(pVoiceMgr); in VMInitialize()
310 pEASData->pVoiceMgr = pVoiceMgr; in VMInitialize()
337 if (pEASData->pVoiceMgr->pSynth[0] != NULL) in VMInitMIDI()
352 if (pEASData->pVoiceMgr->pSynth[virtualSynthNum] == NULL) in VMInitMIDI()
371 if ((result = VMSetEASLib(pSynth, pEASData->pVoiceMgr->pGlobalEAS)) != EAS_SUCCESS) in VMInitMIDI()
379 if (pEASData->pVoiceMgr->pGlobalDLS) in VMInitMIDI()
381 pSynth->pDLS = pEASData->pVoiceMgr->pGlobalDLS; in VMInitMIDI()
391 pSynth->poolAlloc[0] = (EAS_U8) pEASData->pVoiceMgr->maxPolyphony; in VMInitMIDI()
393 VMInitializeAllChannels(pEASData->pVoiceMgr, pSynth); in VMInitMIDI()
396 pEASData->pVoiceMgr->pSynth[virtualSynthNum] = pSynth; in VMInitMIDI()
440 void VMReset (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_BOOL force) in VMReset() argument
450 pVoiceMgr->activeVoices -= pSynth->numActiveVoices; in VMReset()
452 VMInitializeAllVoices(pVoiceMgr, pSynth->vSynthNum); in VMReset()
455 VMMuteAllVoices(pVoiceMgr, pSynth); in VMReset()
466 VMInitializeAllChannels(pVoiceMgr, pSynth); in VMReset()
471 if (pSynth->maxPolyphony < pVoiceMgr->maxPolyphony) in VMReset()
472 pSynth->poolAlloc[0] = (EAS_U8) pVoiceMgr->maxPolyphony; in VMReset()
497 void VMInitializeAllChannels (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMInitializeAllChannels() argument
523 VMProgramChange(pVoiceMgr, pSynth, (EAS_U8) i, DEFAULT_SYNTH_PROGRAM_NUMBER); in VMInitializeAllChannels()
586 void VMInitializeAllVoices (S_VOICE_MGR *pVoiceMgr, EAS_INT vSynthNum) in VMInitializeAllVoices() argument
593 if (pVoiceMgr->voices[i].voiceState != eVoiceStateStolen) in VMInitializeAllVoices()
595 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == vSynthNum) in VMInitializeAllVoices()
596 InitVoice(&pVoiceMgr->voices[i]); in VMInitializeAllVoices()
600 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == vSynthNum) in VMInitializeAllVoices()
601 InitVoice(&pVoiceMgr->voices[i]); in VMInitializeAllVoices()
612 void VMMuteVoice (S_VOICE_MGR *pVoiceMgr, EAS_I32 voiceNum) in VMMuteVoice() argument
618 pVoice = &pVoiceMgr->voices[voiceNum]; 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()
637 void VMReleaseVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum) in VMReleaseVoice() argument
639 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMReleaseVoice()
649 VMMuteVoice(pVoiceMgr, voiceNum); in VMReleaseVoice()
652 …GetSynthPtr(voiceNum)->pfReleaseVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAdjusted… in VMReleaseVoice()
686 void VMSetMIPEntry (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 priority, EAS_U… in VMSetMIPEntry() argument
709 void VMMIPUpdateChannelMuting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMMIPUpdateChannelMuting() argument
725 maxPolyphony = pVoiceMgr->maxPolyphony; in VMMIPUpdateChannelMuting()
746 if (pVoiceMgr->voices[i].voiceState == eVoiceStateFree) in VMMIPUpdateChannelMuting()
750 if (pVoiceMgr->voices[i].voiceState != eVoiceStateStolen) in VMMIPUpdateChannelMuting()
752 vSynthNum = GET_VSYNTH(pVoiceMgr->voices[i].channel); in VMMIPUpdateChannelMuting()
753 channel = GET_CHANNEL(pVoiceMgr->voices[i].channel); in VMMIPUpdateChannelMuting()
757 vSynthNum = GET_VSYNTH(pVoiceMgr->voices[i].nextChannel); in VMMIPUpdateChannelMuting()
758 channel = GET_CHANNEL(pVoiceMgr->voices[i].nextChannel); in VMMIPUpdateChannelMuting()
772 if (pVoiceMgr->voices[i].voiceState == eVoiceStateStolen) in VMMIPUpdateChannelMuting()
773 pVoiceMgr->voices[i].voiceState = eVoiceStateMuting; in VMMIPUpdateChannelMuting()
776 else if (pVoiceMgr->voices[i].voiceState != eVoiceStateMuting) in VMMIPUpdateChannelMuting()
778 VMReleaseVoice(pVoiceMgr, pSynth, i); in VMMIPUpdateChannelMuting()
800 void VMUpdateMIPTable (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMUpdateMIPTable() argument
854 VMMIPUpdateChannelMuting (pVoiceMgr, pSynth); in VMUpdateMIPTable()
874 void VMMuteAllVoices (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMMuteAllVoices() argument
885 if (pVoiceMgr->voices[i].voiceState == eVoiceStateStolen) in VMMuteAllVoices()
887 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == pSynth->vSynthNum) in VMMuteAllVoices()
888 VMMuteVoice(pVoiceMgr, i); in VMMuteAllVoices()
891 else if (pSynth->vSynthNum == GET_VSYNTH(pVoiceMgr->voices[i].channel)) in VMMuteAllVoices()
892 VMMuteVoice(pVoiceMgr, i); in VMMuteAllVoices()
915 void VMReleaseAllVoices (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMReleaseAllVoices() argument
924 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, (EAS_U8) i); in VMReleaseAllVoices()
933 switch (pVoiceMgr->voices[i].voiceState) in VMReleaseAllVoices()
938 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == pSynth->vSynthNum) in VMReleaseAllVoices()
939 VMReleaseVoice(pVoiceMgr, pSynth, i); in VMReleaseAllVoices()
943 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == pSynth->vSynthNum) in VMReleaseAllVoices()
944 VMMuteVoice(pVoiceMgr, i); in VMReleaseAllVoices()
980 void VMAllNotesOff (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMAllNotesOff() argument
995 pVoiceMgr->workload += WORKLOAD_AMOUNT_SMALL_INCREMENT; in VMAllNotesOff()
1001 pVoice = &pVoiceMgr->voices[voiceNum]; in VMAllNotesOff()
1008 … GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMAllNotesOff()
1033 void VMDeferredStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMDeferredStopNote() argument
1044 if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_DEFER_MIDI_NOTE_OFF) in VMDeferredStopNote()
1047 if (pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStolen) in VMDeferredStopNote()
1074 if (0 != pVoiceMgr->voices[voiceNum].gain) in VMDeferredStopNote()
1084 pVoiceMgr->voices[voiceNum].voiceFlags ^= in VMDeferredStopNote()
1094 channel = pVoiceMgr->voices[voiceNum].channel & 15; in VMDeferredStopNote()
1099 …GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->ch… in VMDeferredStopNote()
1104 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMDeferredStopNote()
1140 void VMReleaseAllDeferredNoteOffs (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMReleaseAllDeferredNoteOffs() argument
1155 pVoiceMgr->workload += WORKLOAD_AMOUNT_SMALL_INCREMENT; in VMReleaseAllDeferredNoteOffs()
1162 pVoice = &pVoiceMgr->voices[voiceNum]; in VMReleaseAllDeferredNoteOffs()
1170 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMReleaseAllDeferredNoteOffs()
1201 void VMCatchNotesForSustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMCatchNotesForSustainPedal() argument
1214 pVoiceMgr->workload += WORKLOAD_AMOUNT_SMALL_INCREMENT; in VMCatchNotesForSustainPedal()
1220 if (channel == pVoiceMgr->voices[voiceNum].channel) in VMCatchNotesForSustainPedal()
1222 if (eVoiceStateRelease == pVoiceMgr->voices[voiceNum].voiceState) in VMCatchNotesForSustainPedal()
1223 …GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->ch… in VMCatchNotesForSustainPedal()
1243 void VMUpdateAllNotesAge (S_VOICE_MGR *pVoiceMgr, EAS_U16 age) in VMUpdateAllNotesAge() argument
1249 if (age - pVoiceMgr->voices[i].age > 0) in VMUpdateAllNotesAge()
1250 pVoiceMgr->voices[i].age++; in VMUpdateAllNotesAge()
1271 static void VMStolenVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum, EAS_U8 channe… in VMStolenVoice() argument
1273 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMStolenVoice()
1276 DecVoicePoolCount(pVoiceMgr, pVoice); in VMStolenVoice()
1279 …GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)], &pVo… in VMStolenVoice()
1289 IncVoicePoolCount(pVoiceMgr, pVoice); 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
1330 DecVoicePoolCount(pVoiceMgr, pVoice); in VMFreeVoice()
1338 pVoiceMgr->activeVoices--; in VMFreeVoice()
1347 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age); in VMFreeVoice()
1364 static EAS_BOOL VMRetargetStolenVoice (S_VOICE_MGR *pVoiceMgr, EAS_I32 voiceNum) in VMRetargetStolenVoice() argument
1373 pVoice = &pVoiceMgr->voices[voiceNum]; in VMRetargetStolenVoice()
1374 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMRetargetStolenVoice()
1376 pNextSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in VMRetargetStolenVoice()
1390 VMFreeVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum]); in VMRetargetStolenVoice()
1418 pVoiceMgr->workload += WORKLOAD_AMOUNT_START_NOTE; in VMRetargetStolenVoice()
1424 …GetSynthPtr(voiceNum)->pfStartVoice(pVoiceMgr, pNextSynth, &pVoiceMgr->voices[voiceNum], GetAdjust… in VMRetargetStolenVoice()
1447 void VMCheckKeyGroup (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U16 keyGroup, EAS_U8 channel) in VMCheckKeyGroup() argument
1453 pVoiceMgr->workload += WORKLOAD_AMOUNT_KEY_GROUP; in VMCheckKeyGroup()
1459 if (pVoiceMgr->voices[voiceNum].voiceState != eVoiceStateStolen) in VMCheckKeyGroup()
1462 if (channel == pVoiceMgr->voices[voiceNum].channel) in VMCheckKeyGroup()
1465 pRegion = GetRegionPtr(pSynth, pVoiceMgr->voices[voiceNum].regionIndex); in VMCheckKeyGroup()
1473 … if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET) in VMCheckKeyGroup()
1474 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MUTE; in VMCheckKeyGroup()
1478 VMMuteVoice(pVoiceMgr, voiceNum); in VMCheckKeyGroup()
1487 if (channel == pVoiceMgr->voices[voiceNum].nextChannel) in VMCheckKeyGroup()
1490 pRegion = GetRegionPtr(pSynth, pVoiceMgr->voices[voiceNum].nextRegionIndex); in VMCheckKeyGroup()
1498 … if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET) in VMCheckKeyGroup()
1499 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MUTE; in VMCheckKeyGroup()
1503 VMMuteVoice(pVoiceMgr, voiceNum); in VMCheckKeyGroup()
1535 EAS_BOOL VMCheckPolyphonyLimiting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 … in VMCheckPolyphonyLimiting() argument
1543 pVoiceMgr->workload += WORKLOAD_AMOUNT_POLY_LIMIT; in VMCheckPolyphonyLimiting()
1554 if (pVoiceMgr->voices[voiceNum].voiceState != eVoiceStateStolen) in VMCheckPolyphonyLimiting()
1558 …if ((channel == pVoiceMgr->voices[voiceNum].channel) && (note == pVoiceMgr->voices[voiceNum].note)) in VMCheckPolyphonyLimiting()
1561 age = pVoiceMgr->age - pVoiceMgr->voices[voiceNum].age; in VMCheckPolyphonyLimiting()
1576 …if ((channel == pVoiceMgr->voices[voiceNum].nextChannel) && (note == pVoiceMgr->voices[voiceNum].n… in VMCheckPolyphonyLimiting()
1594 VMStolenVoice(pVoiceMgr, pSynth, oldestVoiceNum, channel, note, velocity, regionIndex); in VMCheckPolyphonyLimiting()
1610 void VMStartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 vel… in VMStartVoice() argument
1646 pVoiceMgr->workload+= WORKLOAD_AMOUNT_START_NOTE; in VMStartVoice()
1655 VMCheckKeyGroup(pVoiceMgr, pSynth, keyGroup, channel); in VMStartVoice()
1660 …if (VMCheckPolyphonyLimiting(pVoiceMgr, pSynth, channel, note, velocity, regionIndex, lowVoice, hi… in VMStartVoice()
1666 if ((pSynth->maxPolyphony == 0) || (pVoiceMgr->maxPolyphony < pSynth->maxPolyphony)) in VMStartVoice()
1667 maxSynthPoly = pVoiceMgr->maxPolyphony; in VMStartVoice()
1672 if ((pVoiceMgr->activeVoices < pVoiceMgr->maxPolyphony) && in VMStartVoice()
1674 (EAS_SUCCESS == VMFindAvailableVoice(pVoiceMgr, &voiceNum, lowVoice, highVoice))) in VMStartVoice()
1676 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMStartVoice()
1683 pVoiceMgr->activeVoices++; in VMStartVoice()
1692 pVoiceMgr->voices[voiceNum].channel = VSynthToChannel(pSynth, channel); in VMStartVoice()
1693 pVoiceMgr->voices[voiceNum].note = note; in VMStartVoice()
1694 pVoiceMgr->voices[voiceNum].velocity = velocity; in VMStartVoice()
1697 pVoiceMgr->voices[voiceNum].age = pVoiceMgr->age++; in VMStartVoice()
1700 pVoiceMgr->voices[voiceNum].voiceState = eVoiceStateStart; in VMStartVoice()
1703 IncVoicePoolCount(pVoiceMgr, pVoice); in VMStartVoice()
1707 …GetSynthPtr(voiceNum)->pfStartVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAdjustedVo… in VMStartVoice()
1712 … if (VMStealVoice(pVoiceMgr, pSynth, &voiceNum, channel, note, lowVoice, highVoice) == EAS_SUCCESS) in VMStartVoice()
1713 VMStolenVoice(pVoiceMgr, pSynth, voiceNum, channel, note, velocity, regionIndex); in VMStartVoice()
1747 void VMStartNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velo… in VMStartNote() argument
1809 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex); in VMStartNote()
1833 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex); in VMStartNote()
1868 void VMStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 veloc… in VMStopNote() argument
1889 pVoiceMgr->workload += WORKLOAD_AMOUNT_STOP_NOTE; in VMStopNote()
1897 if (eVoiceStateStolen != pVoiceMgr->voices[voiceNum].voiceState) in VMStopNote()
1901 …if ((channel == pVoiceMgr->voices[voiceNum].channel) && (note == pVoiceMgr->voices[voiceNum].note)) in VMStopNote()
1911 … pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF; in VMStopNote()
1916 if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET) in VMStopNote()
1921 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MIDI_NOTE_OFF; in VMStopNote()
1927 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMStopNote()
1933 …else if ((channel == pVoiceMgr->voices[voiceNum].nextChannel) && (note == pVoiceMgr->voices[voiceN… in VMStopNote()
1940 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MIDI_NOTE_OFF; in VMStopNote()
1960 EAS_RESULT VMFindAvailableVoice (S_VOICE_MGR *pVoiceMgr, EAS_INT *pVoiceNumber, EAS_I32 lowVoice, E… in VMFindAvailableVoice() argument
1968 if ( pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateFree) in VMFindAvailableVoice()
2013 EAS_RESULT VMStealVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_INT *pVoiceNumber, EAS_U8 cha… in VMStealVoice() argument
2030 pCurrVoice = &pVoiceMgr->voices[voiceNum]; in VMStealVoice()
2039 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->nextChannel)]; in VMStealVoice()
2045 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->channel)]; in VMStealVoice()
2109 if (pVoiceMgr->voices[bestCandidate].voiceState == eVoiceStateStolen) in VMStealVoice()
2213 void VMControlChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 controller, E… in VMControlChange() argument
2288 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, channel); in VMControlChange()
2312 VMCatchNotesForSustainPedal(pVoiceMgr, pSynth, channel); in VMControlChange()
2381 VMAllNotesOff(pVoiceMgr, pSynth, channel); in VMControlChange()
2513 void VMUpdateStaticChannelParameters (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMUpdateStaticChannelParameters() argument
2528 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2530 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2532 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2552 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2554 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2556 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2687 void VMProgramChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 program) in VMProgramChange() argument
2790 EAS_I32 VMAddSamples (S_VOICE_MGR *pVoiceMgr, EAS_I32 *pMixBuffer, EAS_I32 numSamples) in VMAddSamples() argument
2810 …if ((pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStolen) && (pVoiceMgr->voices[voiceNum].… in VMAddSamples()
2811 VMRetargetStolenVoice(pVoiceMgr, voiceNum); in VMAddSamples()
2814 pSynth = pVoiceMgr->pSynth[pVoiceMgr->voices[voiceNum].channel >> 4]; in VMAddSamples()
2817 if (pVoiceMgr->voices[voiceNum].voiceState != eVoiceStateFree) in VMAddSamples()
2819 …done = GetSynthPtr(voiceNum)->pfUpdateVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAd… in VMAddSamples()
2826 if (pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStolen) in VMAddSamples()
2827 pVoiceMgr->voices[voiceNum].gain = 0; in VMAddSamples()
2831 VMFreeVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum]); in VMAddSamples()
2835 if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_DEFER_MUTE) in VMAddSamples()
2837 …pVoiceMgr->voices[voiceNum].voiceFlags &= ~(VOICE_FLAG_DEFER_MUTE | VOICE_FLAG_DEFER_MIDI_NOTE_OFF… in VMAddSamples()
2838 VMMuteVoice(pVoiceMgr, voiceNum); in VMAddSamples()
2842 if (pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStart) in VMAddSamples()
2843 pVoiceMgr->voices[voiceNum].voiceState = eVoiceStatePlay; in VMAddSamples()
2866 EAS_RESULT VMRender (S_VOICE_MGR *pVoiceMgr, EAS_I32 numSamples, EAS_I32 *pMixBuffer, EAS_I32 *pVoi… in VMRender() argument
2873 SanityCheck(pVoiceMgr); in VMRender()
2880 if (pVoiceMgr->pSynth[i] != NULL) in VMRender()
2881 VMUpdateStaticChannelParameters(pVoiceMgr, pVoiceMgr->pSynth[i]); in VMRender()
2885 *pVoicesRendered = VMAddSamples(pVoiceMgr, pMixBuffer, numSamples); in VMRender()
2896 pSynth = pVoiceMgr->pSynth[i]; in VMRender()
2902 VMDeferredStopNote(pVoiceMgr, pSynth); in VMRender()
2916 VMInitializeAllChannels(pVoiceMgr, pSynth); in VMRender()
2917 VMInitializeAllVoices(pVoiceMgr, pSynth->vSynthNum); in VMRender()
2930 SanityCheck(pVoiceMgr); in VMRender()
2951 void VMInitWorkload (S_VOICE_MGR *pVoiceMgr) in VMInitWorkload() argument
2953 pVoiceMgr->workload = 0; in VMInitWorkload()
2971 void VMSetWorkload (S_VOICE_MGR *pVoiceMgr, EAS_I32 maxWorkLoad) in VMSetWorkload() argument
2973 pVoiceMgr->maxWorkLoad = maxWorkLoad; in VMSetWorkload()
2991 EAS_BOOL VMCheckWorkload (S_VOICE_MGR *pVoiceMgr) in VMCheckWorkload() argument
2993 if (pVoiceMgr->maxWorkLoad > 0) in VMCheckWorkload()
2994 return (EAS_BOOL) (pVoiceMgr->workload >= pVoiceMgr->maxWorkLoad); in VMCheckWorkload()
3038 EAS_RESULT VMSetSynthPolyphony (S_VOICE_MGR *pVoiceMgr, EAS_I32 synth, EAS_I32 polyphonyCount) in VMSetSynthPolyphony() argument
3053 if (pVoiceMgr->maxPolyphonyPrimary == polyphonyCount) in VMSetSynthPolyphony()
3055 pVoiceMgr->maxPolyphonyPrimary = (EAS_U16) polyphonyCount; in VMSetSynthPolyphony()
3061 if (pVoiceMgr->maxPolyphonySecondary == polyphonyCount) in VMSetSynthPolyphony()
3063 pVoiceMgr->maxPolyphonySecondary = (EAS_U16) polyphonyCount; in VMSetSynthPolyphony()
3069 pVoiceMgr->maxPolyphony = pVoiceMgr->maxPolyphonyPrimary + pVoiceMgr->maxPolyphonySecondary; in VMSetSynthPolyphony()
3081 if (pVoiceMgr->maxPolyphony == polyphonyCount) in VMSetSynthPolyphony()
3084 pVoiceMgr->maxPolyphony = (EAS_U16) polyphonyCount; in VMSetSynthPolyphony()
3090 if (pVoiceMgr->pSynth[i]) in VMSetSynthPolyphony()
3092 if (pVoiceMgr->pSynth[i]->synthFlags & SYNTH_FLAG_SP_MIDI_ON) in VMSetSynthPolyphony()
3093 VMMIPUpdateChannelMuting(pVoiceMgr, pVoiceMgr->pSynth[i]); in VMSetSynthPolyphony()
3095 pVoiceMgr->pSynth[i]->poolAlloc[0] = (EAS_U8) polyphonyCount; in VMSetSynthPolyphony()
3100 if (pVoiceMgr->activeVoices <= polyphonyCount) in VMSetSynthPolyphony()
3109 …if ((pVoiceMgr->voices[i].voiceState != eVoiceStateFree) && (pVoiceMgr->voices[i].voiceState != eV… in VMSetSynthPolyphony()
3126 pVoice = &pVoiceMgr->voices[i]; in VMSetSynthPolyphony()
3132 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMSetSynthPolyphony()
3177 VMMuteVoice(pVoiceMgr, bestCandidate); in VMSetSynthPolyphony()
3201 EAS_RESULT VMGetSynthPolyphony (S_VOICE_MGR *pVoiceMgr, EAS_I32 synth, EAS_I32 *pPolyphonyCount) in VMGetSynthPolyphony() argument
3206 *pPolyphonyCount = pVoiceMgr->maxPolyphonyPrimary; in VMGetSynthPolyphony()
3208 *pPolyphonyCount = pVoiceMgr->maxPolyphonySecondary; in VMGetSynthPolyphony()
3214 *pPolyphonyCount = pVoiceMgr->maxPolyphony; in VMGetSynthPolyphony()
3238 EAS_RESULT VMSetPolyphony (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 polyphonyCount) in VMSetPolyphony() argument
3258 if (polyphonyCount > pVoiceMgr->maxPolyphony) in VMSetPolyphony()
3259 polyphonyCount = pVoiceMgr->maxPolyphony; in VMSetPolyphony()
3263 VMMIPUpdateChannelMuting(pVoiceMgr, pSynth); in VMSetPolyphony()
3276 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) != pSynth->vSynthNum) in VMSetPolyphony()
3280 …if ((pVoiceMgr->voices[i].voiceState != eVoiceStateFree) && (pVoiceMgr->voices[i].voiceState != eV… in VMSetPolyphony()
3295 pVoice = &pVoiceMgr->voices[i]; in VMSetPolyphony()
3340 VMMuteVoice(pVoiceMgr, bestCandidate); in VMSetPolyphony()
3366 EAS_RESULT VMGetPolyphony (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 *pPolyphonyCount) in VMGetPolyphony() argument
3391 EAS_RESULT VMSetPriority (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 priority) in VMSetPriority() argument
3416 EAS_RESULT VMGetPriority (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 *pPriority) in VMGetPriority() argument
3523 EAS_RESULT VMSetGlobalEASLib (S_VOICE_MGR *pVoiceMgr, EAS_SNDLIB_HANDLE pEAS) in VMSetGlobalEASLib() argument
3531 pVoiceMgr->pGlobalEAS = pEAS; in VMSetGlobalEASLib()
3583 if (pEASData->pVoiceMgr->pGlobalDLS) in VMSetGlobalDLSLib()
3584 DLSCleanup(pEASData->hwInstData, pEASData->pVoiceMgr->pGlobalDLS); in VMSetGlobalDLSLib()
3586 pEASData->pVoiceMgr->pGlobalDLS = pDLS; in VMSetGlobalDLSLib()
3708 VMReset(pEASData->pVoiceMgr, pSynth, EAS_TRUE); in VMMIDIShutdown()
3715 pEASData->pVoiceMgr->pSynth[vSynthNum] = NULL; in VMMIDIShutdown()
3738 if (pEASData->pVoiceMgr == NULL) in VMShutdown()
3743 if (pEASData->pVoiceMgr->pGlobalDLS) in VMShutdown()
3745 DLSCleanup(pEASData->hwInstData, pEASData->pVoiceMgr->pGlobalDLS); in VMShutdown()
3746 pEASData->pVoiceMgr->pGlobalDLS = NULL; in VMShutdown()
3752 EAS_HWFree(pEASData->hwInstData, pEASData->pVoiceMgr); in VMShutdown()
3753 pEASData->pVoiceMgr = NULL; in VMShutdown()
3815 pVoiceMgr->numVoiceStarts = 0; in VMStartFrame()
3818 return pFrameInterface->pfStartFrame(pEASData->pVoiceMgr->pFrameBuffer); in VMStartFrame()
3839 …return pFrameInterface->pfEndFrame(pEASData->pVoiceMgr->pFrameBuffer, pEASData->pMixBuffer, pEASDa… in VMEndFrame()
3871 pVoice = &pEASData->pVoiceMgr->voices[i]; in VMSanityCheck()
3881 pSynth = pEASData->pVoiceMgr->pSynth[vSynthNum]; in VMSanityCheck()
3898 pSynth = pEASData->pVoiceMgr->pSynth[vSynthNum]; in VMSanityCheck()
3937 if (pEASData->pVoiceMgr->activeVoices != activeVoices) in VMSanityCheck()
3947 if (pEASData->pVoiceMgr->pSynth[i] == NULL) in VMSanityCheck()
3951 if (pEASData->pVoiceMgr->pSynth[i]->numActiveVoices > MAX_SYNTH_VOICES) in VMSanityCheck()
3958 if (poolCount[i][j] != pEASData->pVoiceMgr->pSynth[i]->poolCount[j]) in VMSanityCheck()