88 |
|
|
89 |
void FxSend::SetDestinationEffect(int iChain, int iChainPos) throw (Exception) { |
void FxSend::SetDestinationEffect(int iChain, int iChainPos) throw (Exception) { |
90 |
AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice(); |
AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice(); |
91 |
if (iChain < 0 || iChain >= pDevice->SendEffectChainCount()) |
bool chainFound = false; |
92 |
throw Exception( |
if (iChain != -1) { |
93 |
|
if (pDevice->SendEffectChainByID(iChain) != NULL) chainFound = true; |
94 |
|
if (!chainFound) throw Exception( |
95 |
"Could not assign FX Send to send effect chain " + |
"Could not assign FX Send to send effect chain " + |
96 |
ToString(iChain) + ": effect chain doesn't exist." |
ToString(iChain) + ": effect chain doesn't exist." |
97 |
); |
); |
98 |
if (iChainPos < 0 || iChainPos >= pDevice->SendEffectChain(iChain)->EffectCount()) |
} |
99 |
|
if (chainFound && (iChainPos < 0 || iChainPos >= pDevice->SendEffectChainByID(iChain)->EffectCount())) |
100 |
throw Exception( |
throw Exception( |
101 |
"Could not assign FX Send to send effect chain position " + |
"Could not assign FX Send to send effect chain position " + |
102 |
ToString(iChainPos) + " of send effect chain " + ToString(iChain) + |
ToString(iChainPos) + " of send effect chain " + ToString(iChain) + |
103 |
": effect chain position out of bounds." |
": effect chain position out of bounds." |
104 |
); |
); |
105 |
iDestinationEffectChain = iChain; |
iDestinationEffectChain = iChain; |
106 |
iDestinationEffectChainPos = iChainPos; |
iDestinationEffectChainPos = (iChain == -1 ? -1 : iChainPos); |
107 |
} |
} |
108 |
|
|
109 |
// TODO: to be removed |
// TODO: to be removed |