summaryrefslogtreecommitdiff
path: root/arm-wt-22k
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2020-04-21 08:03:36 -0700
committerMarco Nelissen <marcone@google.com>2020-04-21 08:03:36 -0700
commit34ba4804f643549b8ac74e5f56bfe64db3234447 (patch)
tree789f50f4187d4d7abced40c7e55b932e04be1903 /arm-wt-22k
parentc1aa8d1ad866aff14a2424179aa209bba806f799 (diff)
downloadsonivox-34ba4804f643549b8ac74e5f56bfe64db3234447.tar.gz
Remove unused code
Bug: 151448144 Test: build Change-Id: Ie0730a527ccb05b238014624ce32244b5757e708
Diffstat (limited to 'arm-wt-22k')
-rw-r--r--arm-wt-22k/lib_src/eas_voicemgt.c200
1 files changed, 0 insertions, 200 deletions
diff --git a/arm-wt-22k/lib_src/eas_voicemgt.c b/arm-wt-22k/lib_src/eas_voicemgt.c
index 1e20e2b..a2987ae 100644
--- a/arm-wt-22k/lib_src/eas_voicemgt.c
+++ b/arm-wt-22k/lib_src/eas_voicemgt.c
@@ -3017,206 +3017,6 @@ EAS_I32 VMActiveVoices (S_SYNTH *pSynth)
}
/*----------------------------------------------------------------------------
- * VMSetSynthPolyphony()
- *----------------------------------------------------------------------------
- * Purpose:
- * Set the synth to a new polyphony value. Value must be >= 1 and
- * <= MAX_SYNTH_VOICES. This function will pin the polyphony at those limits
- *
- * Inputs:
- * pVoiceMgr pointer to synthesizer data
- * polyphonyCount desired polyphony count
- * synth synthesizer number (0 = onboard, 1 = DSP)
- *
- * Outputs:
- * Returns error code
- *
- * Side Effects:
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT VMSetSynthPolyphony (S_VOICE_MGR *pVoiceMgr, EAS_I32 synth, EAS_I32 polyphonyCount)
-{
- EAS_INT i;
- EAS_INT activeVoices;
-
- /* lower limit */
- if (polyphonyCount < 1)
- polyphonyCount = 1;
-
- /* split architecture */
-#if defined(_SECONDARY_SYNTH) || defined(EAS_SPLIT_WT_SYNTH)
- if (synth == EAS_MCU_SYNTH)
- {
- if (polyphonyCount > NUM_PRIMARY_VOICES)
- polyphonyCount = NUM_PRIMARY_VOICES;
- if (pVoiceMgr->maxPolyphonyPrimary == polyphonyCount)
- return EAS_SUCCESS;
- pVoiceMgr->maxPolyphonyPrimary = (EAS_U16) polyphonyCount;
- }
- else if (synth == EAS_DSP_SYNTH)
- {
- if (polyphonyCount > NUM_SECONDARY_VOICES)
- polyphonyCount = NUM_SECONDARY_VOICES;
- if (pVoiceMgr->maxPolyphonySecondary == polyphonyCount)
- return EAS_SUCCESS;
- pVoiceMgr->maxPolyphonySecondary = (EAS_U16) polyphonyCount;
- }
- else
- return EAS_ERROR_PARAMETER_RANGE;
-
- /* setting for SP-MIDI */
- pVoiceMgr->maxPolyphony = pVoiceMgr->maxPolyphonyPrimary + pVoiceMgr->maxPolyphonySecondary;
-
- /* standard architecture */
-#else
- if (synth != EAS_MCU_SYNTH)
- return EAS_ERROR_PARAMETER_RANGE;
-
- /* pin desired value to possible limits */
- if (polyphonyCount > MAX_SYNTH_VOICES)
- polyphonyCount = MAX_SYNTH_VOICES;
-
- /* set polyphony, if value is different than current value */
- if (pVoiceMgr->maxPolyphony == polyphonyCount)
- return EAS_SUCCESS;
-
- pVoiceMgr->maxPolyphony = (EAS_U16) polyphonyCount;
-#endif
-
- /* if SPMIDI enabled, update channel masking based on new polyphony */
- for (i = 0; i < MAX_VIRTUAL_SYNTHESIZERS; i++)
- {
- if (pVoiceMgr->pSynth[i])
- {
- if (pVoiceMgr->pSynth[i]->synthFlags & SYNTH_FLAG_SP_MIDI_ON)
- VMMIPUpdateChannelMuting(pVoiceMgr, pVoiceMgr->pSynth[i]);
- else
- pVoiceMgr->pSynth[i]->poolAlloc[0] = (EAS_U8) polyphonyCount;
- }
- }
-
- /* are we under polyphony limit? */
- if (pVoiceMgr->activeVoices <= polyphonyCount)
- return EAS_SUCCESS;
-
- /* count the number of active voices */
- activeVoices = 0;
- for (i = 0; i < MAX_SYNTH_VOICES; i++)
- {
-
- /* is voice active? */
- if ((pVoiceMgr->voices[i].voiceState != eVoiceStateFree) && (pVoiceMgr->voices[i].voiceState != eVoiceStateMuting))
- activeVoices++;
- }
-
- /* we may have to mute voices to reach new target */
- while (activeVoices > polyphonyCount)
- {
- S_SYNTH *pSynth;
- S_SYNTH_VOICE *pVoice;
- EAS_I32 currentPriority, bestPriority;
- EAS_INT bestCandidate;
-
- /* find the lowest priority voice */
- bestPriority = bestCandidate = -1;
- for (i = 0; i < MAX_SYNTH_VOICES; i++)
- {
-
- pVoice = &pVoiceMgr->voices[i];
-
- /* ignore free and muting voices */
- if ((pVoice->voiceState == eVoiceStateFree) || (pVoice->voiceState == eVoiceStateMuting))
- continue;
-
- pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
-
- /* if voice is stolen or just started, reduce the likelihood it will be stolen */
- if (( pVoice->voiceState == eVoiceStateStolen) || (pVoice->voiceFlags & VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET))
- {
- /* include velocity */
- currentPriority = 128 - pVoice->nextVelocity;
-
- /* include channel priority */
- currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
- }
- else
- {
- /* include age */
- currentPriority = (EAS_I32) pVoice->age << NOTE_AGE_STEAL_WEIGHT;
-
- /* include note gain -higher gain is lower steal value */
- /*lint -e{704} use shift for performance */
- currentPriority += ((32768 >> (12 - NOTE_GAIN_STEAL_WEIGHT)) + 256) -
- ((EAS_I32) pVoice->gain >> (12 - NOTE_GAIN_STEAL_WEIGHT));
-
- /* include channel priority */
- currentPriority += pSynth->channels[GET_CHANNEL(pVoice->channel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
- }
-
- /* include synth priority */
- currentPriority += pSynth->priority << SYNTH_PRIORITY_WEIGHT;
-
- /* is this the best choice so far? */
- if (currentPriority > bestPriority)
- {
- bestPriority = currentPriority;
- bestCandidate = i;
- }
- }
-
- /* shutdown best candidate */
- if (bestCandidate < 0)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "VMSetPolyphony: Unable to reduce polyphony\n"); */ }
- break;
- }
-
- /* shut down this voice */
- /*lint -e{771} pSynth is initialized if bestCandidate >= 0 */
- VMMuteVoice(pVoiceMgr, bestCandidate);
- activeVoices--;
- }
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- * VMGetSynthPolyphony()
- *----------------------------------------------------------------------------
- * Purpose:
- * Returns the current polyphony setting
- *
- * Inputs:
- * pVoiceMgr pointer to synthesizer data
- * synth synthesizer number (0 = onboard, 1 = DSP)
- *
- * Outputs:
- * Returns actual polyphony value set, as pinned by limits
- *
- * Side Effects:
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT VMGetSynthPolyphony (S_VOICE_MGR *pVoiceMgr, EAS_I32 synth, EAS_I32 *pPolyphonyCount)
-{
-
-#if defined(_SECONDARY_SYNTH) || defined(EAS_SPLIT_WT_SYNTH)
- if (synth == EAS_MCU_SYNTH)
- *pPolyphonyCount = pVoiceMgr->maxPolyphonyPrimary;
- else if (synth == EAS_DSP_SYNTH)
- *pPolyphonyCount = pVoiceMgr->maxPolyphonySecondary;
- else
- return EAS_ERROR_PARAMETER_RANGE;
-#else
- if (synth != EAS_MCU_SYNTH)
- return EAS_ERROR_PARAMETER_RANGE;
- *pPolyphonyCount = pVoiceMgr->maxPolyphony;
-#endif
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
* VMSetPolyphony()
*----------------------------------------------------------------------------
* Purpose: