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()
429 void VMReset (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_BOOL force) in VMReset() argument
439 pVoiceMgr->activeVoices -= pSynth->numActiveVoices; in VMReset()
441 VMInitializeAllVoices(pVoiceMgr, pSynth->vSynthNum); in VMReset()
444 VMMuteAllVoices(pVoiceMgr, pSynth); in VMReset()
455 VMInitializeAllChannels(pVoiceMgr, pSynth); in VMReset()
460 if (pSynth->maxPolyphony < pVoiceMgr->maxPolyphony) in VMReset()
461 pSynth->poolAlloc[0] = (EAS_U8) pVoiceMgr->maxPolyphony; in VMReset()
486 void VMInitializeAllChannels (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMInitializeAllChannels() argument
512 VMProgramChange(pVoiceMgr, pSynth, (EAS_U8) i, DEFAULT_SYNTH_PROGRAM_NUMBER); in VMInitializeAllChannels()
575 void VMInitializeAllVoices (S_VOICE_MGR *pVoiceMgr, EAS_INT vSynthNum) in VMInitializeAllVoices() argument
582 if (pVoiceMgr->voices[i].voiceState != eVoiceStateStolen) in VMInitializeAllVoices()
584 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == vSynthNum) in VMInitializeAllVoices()
585 InitVoice(&pVoiceMgr->voices[i]); in VMInitializeAllVoices()
589 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == vSynthNum) in VMInitializeAllVoices()
590 InitVoice(&pVoiceMgr->voices[i]); in VMInitializeAllVoices()
601 void VMMuteVoice (S_VOICE_MGR *pVoiceMgr, EAS_I32 voiceNum) in VMMuteVoice() argument
607 pVoice = &pVoiceMgr->voices[voiceNum]; in VMMuteVoice()
612 DecVoicePoolCount(pVoiceMgr, pVoice); in VMMuteVoice()
614 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMMuteVoice()
615 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMMuteVoice()
626 void VMReleaseVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum) in VMReleaseVoice() argument
628 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMReleaseVoice()
638 VMMuteVoice(pVoiceMgr, voiceNum); in VMReleaseVoice()
641 …GetSynthPtr(voiceNum)->pfReleaseVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAdjusted… in VMReleaseVoice()
675 void VMSetMIPEntry (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 priority, EAS_U… in VMSetMIPEntry() argument
698 void VMMIPUpdateChannelMuting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMMIPUpdateChannelMuting() argument
714 maxPolyphony = pVoiceMgr->maxPolyphony; in VMMIPUpdateChannelMuting()
735 if (pVoiceMgr->voices[i].voiceState == eVoiceStateFree) in VMMIPUpdateChannelMuting()
739 if (pVoiceMgr->voices[i].voiceState != eVoiceStateStolen) in VMMIPUpdateChannelMuting()
741 vSynthNum = GET_VSYNTH(pVoiceMgr->voices[i].channel); in VMMIPUpdateChannelMuting()
742 channel = GET_CHANNEL(pVoiceMgr->voices[i].channel); in VMMIPUpdateChannelMuting()
746 vSynthNum = GET_VSYNTH(pVoiceMgr->voices[i].nextChannel); in VMMIPUpdateChannelMuting()
747 channel = GET_CHANNEL(pVoiceMgr->voices[i].nextChannel); in VMMIPUpdateChannelMuting()
761 if (pVoiceMgr->voices[i].voiceState == eVoiceStateStolen) in VMMIPUpdateChannelMuting()
762 pVoiceMgr->voices[i].voiceState = eVoiceStateMuting; in VMMIPUpdateChannelMuting()
765 else if (pVoiceMgr->voices[i].voiceState != eVoiceStateMuting) in VMMIPUpdateChannelMuting()
767 VMReleaseVoice(pVoiceMgr, pSynth, i); in VMMIPUpdateChannelMuting()
789 void VMUpdateMIPTable (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMUpdateMIPTable() argument
843 VMMIPUpdateChannelMuting (pVoiceMgr, pSynth); in VMUpdateMIPTable()
863 void VMMuteAllVoices (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMMuteAllVoices() argument
874 if (pVoiceMgr->voices[i].voiceState == eVoiceStateStolen) in VMMuteAllVoices()
876 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == pSynth->vSynthNum) in VMMuteAllVoices()
877 VMMuteVoice(pVoiceMgr, i); in VMMuteAllVoices()
880 else if (pSynth->vSynthNum == GET_VSYNTH(pVoiceMgr->voices[i].channel)) in VMMuteAllVoices()
881 VMMuteVoice(pVoiceMgr, i); in VMMuteAllVoices()
904 void VMReleaseAllVoices (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMReleaseAllVoices() argument
913 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, (EAS_U8) i); in VMReleaseAllVoices()
922 switch (pVoiceMgr->voices[i].voiceState) in VMReleaseAllVoices()
927 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == pSynth->vSynthNum) in VMReleaseAllVoices()
928 VMReleaseVoice(pVoiceMgr, pSynth, i); in VMReleaseAllVoices()
932 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == pSynth->vSynthNum) in VMReleaseAllVoices()
933 VMMuteVoice(pVoiceMgr, i); in VMReleaseAllVoices()
969 void VMAllNotesOff (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMAllNotesOff() argument
984 pVoiceMgr->workload += WORKLOAD_AMOUNT_SMALL_INCREMENT; in VMAllNotesOff()
990 pVoice = &pVoiceMgr->voices[voiceNum]; in VMAllNotesOff()
997 … GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMAllNotesOff()
1022 void VMDeferredStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMDeferredStopNote() argument
1033 if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_DEFER_MIDI_NOTE_OFF) in VMDeferredStopNote()
1036 if (pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStolen) in VMDeferredStopNote()
1063 if (0 != pVoiceMgr->voices[voiceNum].gain) in VMDeferredStopNote()
1073 pVoiceMgr->voices[voiceNum].voiceFlags ^= in VMDeferredStopNote()
1083 channel = pVoiceMgr->voices[voiceNum].channel & 15; in VMDeferredStopNote()
1088 …GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->ch… in VMDeferredStopNote()
1093 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMDeferredStopNote()
1129 void VMReleaseAllDeferredNoteOffs (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMReleaseAllDeferredNoteOffs() argument
1144 pVoiceMgr->workload += WORKLOAD_AMOUNT_SMALL_INCREMENT; in VMReleaseAllDeferredNoteOffs()
1151 pVoice = &pVoiceMgr->voices[voiceNum]; in VMReleaseAllDeferredNoteOffs()
1159 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMReleaseAllDeferredNoteOffs()
1190 void VMCatchNotesForSustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMCatchNotesForSustainPedal() argument
1203 pVoiceMgr->workload += WORKLOAD_AMOUNT_SMALL_INCREMENT; in VMCatchNotesForSustainPedal()
1209 if (channel == pVoiceMgr->voices[voiceNum].channel) in VMCatchNotesForSustainPedal()
1211 if (eVoiceStateRelease == pVoiceMgr->voices[voiceNum].voiceState) in VMCatchNotesForSustainPedal()
1212 …GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->ch… in VMCatchNotesForSustainPedal()
1232 void VMUpdateAllNotesAge (S_VOICE_MGR *pVoiceMgr, EAS_U16 age) in VMUpdateAllNotesAge() argument
1238 if (age - pVoiceMgr->voices[i].age > 0) in VMUpdateAllNotesAge()
1239 pVoiceMgr->voices[i].age++; in VMUpdateAllNotesAge()
1260 static void VMStolenVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum, EAS_U8 channe… in VMStolenVoice() argument
1262 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMStolenVoice()
1265 DecVoicePoolCount(pVoiceMgr, pVoice); in VMStolenVoice()
1268 …GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)], &pVo… in VMStolenVoice()
1278 IncVoicePoolCount(pVoiceMgr, pVoice); in VMStolenVoice()
1287 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age); in VMStolenVoice()
1290 pVoice->age = pVoiceMgr->age++; in VMStolenVoice()
1307 static void VMFreeVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice) in VMFreeVoice() argument
1319 DecVoicePoolCount(pVoiceMgr, pVoice); in VMFreeVoice()
1327 pVoiceMgr->activeVoices--; in VMFreeVoice()
1336 VMUpdateAllNotesAge(pVoiceMgr, pVoice->age); in VMFreeVoice()
1353 static EAS_BOOL VMRetargetStolenVoice (S_VOICE_MGR *pVoiceMgr, EAS_I32 voiceNum) in VMRetargetStolenVoice() argument
1362 pVoice = &pVoiceMgr->voices[voiceNum]; in VMRetargetStolenVoice()
1363 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMRetargetStolenVoice()
1365 pNextSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in VMRetargetStolenVoice()
1379 VMFreeVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum]); in VMRetargetStolenVoice()
1407 pVoiceMgr->workload += WORKLOAD_AMOUNT_START_NOTE; in VMRetargetStolenVoice()
1413 …GetSynthPtr(voiceNum)->pfStartVoice(pVoiceMgr, pNextSynth, &pVoiceMgr->voices[voiceNum], GetAdjust… in VMRetargetStolenVoice()
1436 void VMCheckKeyGroup (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U16 keyGroup, EAS_U8 channel) in VMCheckKeyGroup() argument
1442 pVoiceMgr->workload += WORKLOAD_AMOUNT_KEY_GROUP; in VMCheckKeyGroup()
1448 if (pVoiceMgr->voices[voiceNum].voiceState != eVoiceStateStolen) in VMCheckKeyGroup()
1451 if (channel == pVoiceMgr->voices[voiceNum].channel) in VMCheckKeyGroup()
1454 pRegion = GetRegionPtr(pSynth, pVoiceMgr->voices[voiceNum].regionIndex); in VMCheckKeyGroup()
1462 … if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET) in VMCheckKeyGroup()
1463 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MUTE; in VMCheckKeyGroup()
1467 VMMuteVoice(pVoiceMgr, voiceNum); in VMCheckKeyGroup()
1476 if (channel == pVoiceMgr->voices[voiceNum].nextChannel) in VMCheckKeyGroup()
1479 pRegion = GetRegionPtr(pSynth, pVoiceMgr->voices[voiceNum].nextRegionIndex); in VMCheckKeyGroup()
1487 … if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET) in VMCheckKeyGroup()
1488 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MUTE; in VMCheckKeyGroup()
1492 VMMuteVoice(pVoiceMgr, voiceNum); in VMCheckKeyGroup()
1524 EAS_BOOL VMCheckPolyphonyLimiting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 … in VMCheckPolyphonyLimiting() argument
1532 pVoiceMgr->workload += WORKLOAD_AMOUNT_POLY_LIMIT; in VMCheckPolyphonyLimiting()
1543 if (pVoiceMgr->voices[voiceNum].voiceState != eVoiceStateStolen) in VMCheckPolyphonyLimiting()
1547 …if ((channel == pVoiceMgr->voices[voiceNum].channel) && (note == pVoiceMgr->voices[voiceNum].note)) in VMCheckPolyphonyLimiting()
1550 age = pVoiceMgr->age - pVoiceMgr->voices[voiceNum].age; in VMCheckPolyphonyLimiting()
1565 …if ((channel == pVoiceMgr->voices[voiceNum].nextChannel) && (note == pVoiceMgr->voices[voiceNum].n… in VMCheckPolyphonyLimiting()
1583 VMStolenVoice(pVoiceMgr, pSynth, oldestVoiceNum, channel, note, velocity, regionIndex); in VMCheckPolyphonyLimiting()
1599 void VMStartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 vel… in VMStartVoice() argument
1635 pVoiceMgr->workload+= WORKLOAD_AMOUNT_START_NOTE; in VMStartVoice()
1644 VMCheckKeyGroup(pVoiceMgr, pSynth, keyGroup, channel); in VMStartVoice()
1649 …if (VMCheckPolyphonyLimiting(pVoiceMgr, pSynth, channel, note, velocity, regionIndex, lowVoice, hi… in VMStartVoice()
1655 if ((pSynth->maxPolyphony == 0) || (pVoiceMgr->maxPolyphony < pSynth->maxPolyphony)) in VMStartVoice()
1656 maxSynthPoly = pVoiceMgr->maxPolyphony; in VMStartVoice()
1661 if ((pVoiceMgr->activeVoices < pVoiceMgr->maxPolyphony) && in VMStartVoice()
1663 (EAS_SUCCESS == VMFindAvailableVoice(pVoiceMgr, &voiceNum, lowVoice, highVoice))) in VMStartVoice()
1665 S_SYNTH_VOICE *pVoice = &pVoiceMgr->voices[voiceNum]; in VMStartVoice()
1672 pVoiceMgr->activeVoices++; in VMStartVoice()
1681 pVoiceMgr->voices[voiceNum].channel = VSynthToChannel(pSynth, channel); in VMStartVoice()
1682 pVoiceMgr->voices[voiceNum].note = note; in VMStartVoice()
1683 pVoiceMgr->voices[voiceNum].velocity = velocity; in VMStartVoice()
1686 pVoiceMgr->voices[voiceNum].age = pVoiceMgr->age++; in VMStartVoice()
1689 pVoiceMgr->voices[voiceNum].voiceState = eVoiceStateStart; in VMStartVoice()
1692 IncVoicePoolCount(pVoiceMgr, pVoice); in VMStartVoice()
1696 …GetSynthPtr(voiceNum)->pfStartVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAdjustedVo… in VMStartVoice()
1701 … if (VMStealVoice(pVoiceMgr, pSynth, &voiceNum, channel, note, lowVoice, highVoice) == EAS_SUCCESS) in VMStartVoice()
1702 VMStolenVoice(pVoiceMgr, pSynth, voiceNum, channel, note, velocity, regionIndex); in VMStartVoice()
1736 void VMStartNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velo… in VMStartNote() argument
1798 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex); in VMStartNote()
1822 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex); in VMStartNote()
1857 void VMStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 veloc… in VMStopNote() argument
1878 pVoiceMgr->workload += WORKLOAD_AMOUNT_STOP_NOTE; in VMStopNote()
1886 if (eVoiceStateStolen != pVoiceMgr->voices[voiceNum].voiceState) in VMStopNote()
1890 …if ((channel == pVoiceMgr->voices[voiceNum].channel) && (note == pVoiceMgr->voices[voiceNum].note)) in VMStopNote()
1900 … pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF; in VMStopNote()
1905 if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET) in VMStopNote()
1910 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MIDI_NOTE_OFF; in VMStopNote()
1916 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMStopNote()
1922 …else if ((channel == pVoiceMgr->voices[voiceNum].nextChannel) && (note == pVoiceMgr->voices[voiceN… in VMStopNote()
1929 pVoiceMgr->voices[voiceNum].voiceFlags |= VOICE_FLAG_DEFER_MIDI_NOTE_OFF; in VMStopNote()
1949 EAS_RESULT VMFindAvailableVoice (S_VOICE_MGR *pVoiceMgr, EAS_INT *pVoiceNumber, EAS_I32 lowVoice, E… in VMFindAvailableVoice() argument
1957 if ( pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateFree) in VMFindAvailableVoice()
2002 EAS_RESULT VMStealVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_INT *pVoiceNumber, EAS_U8 cha… in VMStealVoice() argument
2019 pCurrVoice = &pVoiceMgr->voices[voiceNum]; in VMStealVoice()
2028 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->nextChannel)]; in VMStealVoice()
2034 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->channel)]; in VMStealVoice()
2098 if (pVoiceMgr->voices[bestCandidate].voiceState == eVoiceStateStolen) in VMStealVoice()
2202 void VMControlChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 controller, E… in VMControlChange() argument
2277 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, channel); in VMControlChange()
2301 VMCatchNotesForSustainPedal(pVoiceMgr, pSynth, channel); in VMControlChange()
2370 VMAllNotesOff(pVoiceMgr, pSynth, channel); in VMControlChange()
2502 void VMUpdateStaticChannelParameters (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMUpdateStaticChannelParameters() argument
2517 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2519 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2521 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2541 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2543 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2545 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2676 void VMProgramChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 program) in VMProgramChange() argument
2779 EAS_I32 VMAddSamples (S_VOICE_MGR *pVoiceMgr, EAS_I32 *pMixBuffer, EAS_I32 numSamples) in VMAddSamples() argument
2799 …if ((pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStolen) && (pVoiceMgr->voices[voiceNum].… in VMAddSamples()
2800 VMRetargetStolenVoice(pVoiceMgr, voiceNum); in VMAddSamples()
2803 pSynth = pVoiceMgr->pSynth[pVoiceMgr->voices[voiceNum].channel >> 4]; in VMAddSamples()
2806 if (pVoiceMgr->voices[voiceNum].voiceState != eVoiceStateFree) in VMAddSamples()
2808 …done = GetSynthPtr(voiceNum)->pfUpdateVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAd… in VMAddSamples()
2815 if (pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStolen) in VMAddSamples()
2816 pVoiceMgr->voices[voiceNum].gain = 0; in VMAddSamples()
2820 VMFreeVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum]); in VMAddSamples()
2824 if (pVoiceMgr->voices[voiceNum].voiceFlags & VOICE_FLAG_DEFER_MUTE) in VMAddSamples()
2826 …pVoiceMgr->voices[voiceNum].voiceFlags &= ~(VOICE_FLAG_DEFER_MUTE | VOICE_FLAG_DEFER_MIDI_NOTE_OFF… in VMAddSamples()
2827 VMMuteVoice(pVoiceMgr, voiceNum); in VMAddSamples()
2831 if (pVoiceMgr->voices[voiceNum].voiceState == eVoiceStateStart) in VMAddSamples()
2832 pVoiceMgr->voices[voiceNum].voiceState = eVoiceStatePlay; in VMAddSamples()
2855 EAS_RESULT VMRender (S_VOICE_MGR *pVoiceMgr, EAS_I32 numSamples, EAS_I32 *pMixBuffer, EAS_I32 *pVoi… in VMRender() argument
2862 SanityCheck(pVoiceMgr); in VMRender()
2869 if (pVoiceMgr->pSynth[i] != NULL) in VMRender()
2870 VMUpdateStaticChannelParameters(pVoiceMgr, pVoiceMgr->pSynth[i]); in VMRender()
2874 *pVoicesRendered = VMAddSamples(pVoiceMgr, pMixBuffer, numSamples); in VMRender()
2885 pSynth = pVoiceMgr->pSynth[i]; in VMRender()
2891 VMDeferredStopNote(pVoiceMgr, pSynth); in VMRender()
2905 VMInitializeAllChannels(pVoiceMgr, pSynth); in VMRender()
2906 VMInitializeAllVoices(pVoiceMgr, pSynth->vSynthNum); in VMRender()
2919 SanityCheck(pVoiceMgr); in VMRender()
2940 void VMInitWorkload (S_VOICE_MGR *pVoiceMgr) in VMInitWorkload() argument
2942 pVoiceMgr->workload = 0; in VMInitWorkload()
2960 void VMSetWorkload (S_VOICE_MGR *pVoiceMgr, EAS_I32 maxWorkLoad) in VMSetWorkload() argument
2962 pVoiceMgr->maxWorkLoad = maxWorkLoad; in VMSetWorkload()
2980 EAS_BOOL VMCheckWorkload (S_VOICE_MGR *pVoiceMgr) in VMCheckWorkload() argument
2982 if (pVoiceMgr->maxWorkLoad > 0) in VMCheckWorkload()
2983 return (EAS_BOOL) (pVoiceMgr->workload >= pVoiceMgr->maxWorkLoad); in VMCheckWorkload()
3027 EAS_RESULT VMSetPolyphony (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 polyphonyCount) in VMSetPolyphony() argument
3047 if (polyphonyCount > pVoiceMgr->maxPolyphony) in VMSetPolyphony()
3048 polyphonyCount = pVoiceMgr->maxPolyphony; in VMSetPolyphony()
3052 VMMIPUpdateChannelMuting(pVoiceMgr, pSynth); in VMSetPolyphony()
3065 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) != pSynth->vSynthNum) in VMSetPolyphony()
3069 …if ((pVoiceMgr->voices[i].voiceState != eVoiceStateFree) && (pVoiceMgr->voices[i].voiceState != eV… in VMSetPolyphony()
3084 pVoice = &pVoiceMgr->voices[i]; in VMSetPolyphony()
3129 VMMuteVoice(pVoiceMgr, bestCandidate); in VMSetPolyphony()
3155 EAS_RESULT VMSetPriority (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 priority) in VMSetPriority() argument
3359 VMReset(pEASData->pVoiceMgr, pSynth, EAS_TRUE); in VMMIDIShutdown()
3366 pEASData->pVoiceMgr->pSynth[vSynthNum] = NULL; in VMMIDIShutdown()
3389 if (pEASData->pVoiceMgr == NULL) in VMShutdown()
3394 if (pEASData->pVoiceMgr->pGlobalDLS) in VMShutdown()
3396 DLSCleanup(pEASData->hwInstData, pEASData->pVoiceMgr->pGlobalDLS); in VMShutdown()
3397 pEASData->pVoiceMgr->pGlobalDLS = NULL; in VMShutdown()
3403 EAS_HWFree(pEASData->hwInstData, pEASData->pVoiceMgr); in VMShutdown()
3404 pEASData->pVoiceMgr = NULL; in VMShutdown()
3466 pVoiceMgr->numVoiceStarts = 0; in VMStartFrame()
3469 return pFrameInterface->pfStartFrame(pEASData->pVoiceMgr->pFrameBuffer); in VMStartFrame()
3490 …return pFrameInterface->pfEndFrame(pEASData->pVoiceMgr->pFrameBuffer, pEASData->pMixBuffer, pEASDa… in VMEndFrame()
3522 pVoice = &pEASData->pVoiceMgr->voices[i]; in VMSanityCheck()
3532 pSynth = pEASData->pVoiceMgr->pSynth[vSynthNum]; in VMSanityCheck()
3549 pSynth = pEASData->pVoiceMgr->pSynth[vSynthNum]; in VMSanityCheck()
3588 if (pEASData->pVoiceMgr->activeVoices != activeVoices) in VMSanityCheck()
3598 if (pEASData->pVoiceMgr->pSynth[i] == NULL) in VMSanityCheck()
3602 if (pEASData->pVoiceMgr->pSynth[i]->numActiveVoices > MAX_SYNTH_VOICES) in VMSanityCheck()
3609 if (poolCount[i][j] != pEASData->pVoiceMgr->pSynth[i]->poolCount[j]) in VMSanityCheck()