34 |
namespace LinuxSampler { |
namespace LinuxSampler { |
35 |
|
|
36 |
FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception) |
FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception) |
37 |
: iMasterEffectChain(-1), iMasterEffect(-1), bInfoChanged(false) |
: iDestinationEffectChain(-1), iDestinationEffectChainPos(-1), bInfoChanged(false) |
38 |
{ |
{ |
39 |
this->pEngineChannel = pEngineChannel; |
this->pEngineChannel = pEngineChannel; |
40 |
AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice(); |
AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice(); |
78 |
fLevel = DEFAULT_FX_SEND_LEVEL; |
fLevel = DEFAULT_FX_SEND_LEVEL; |
79 |
} |
} |
80 |
|
|
81 |
int FxSend::DestinationMasterEffectChain() const { |
int FxSend::DestinationEffectChain() const { |
82 |
return iMasterEffectChain; |
return iDestinationEffectChain; |
83 |
} |
} |
84 |
|
|
85 |
int FxSend::DestinationMasterEffect() const { |
int FxSend::DestinationEffectChainPosition() const { |
86 |
return iMasterEffect; |
return iDestinationEffectChainPos; |
87 |
} |
} |
88 |
|
|
89 |
void FxSend::SetDestinationMasterEffect(int iChain, int iEffect) 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->MasterEffectChainCount()) |
if (iChain < 0 || iChain >= pDevice->SendEffectChainCount()) |
92 |
throw Exception( |
throw Exception( |
93 |
"Could not assign FX Send to master effect chain " + |
"Could not assign FX Send to send effect chain " + |
94 |
ToString(iChain) + ": effect chain doesn't exist." |
ToString(iChain) + ": effect chain doesn't exist." |
95 |
); |
); |
96 |
if (iEffect < 0 || iEffect >= pDevice->MasterEffectChain(iChain)->EffectCount()) |
if (iChainPos < 0 || iChainPos >= pDevice->SendEffectChain(iChain)->EffectCount()) |
97 |
throw Exception( |
throw Exception( |
98 |
"Could not assign FX Send to master effect " + |
"Could not assign FX Send to send effect chain position " + |
99 |
ToString(iEffect) + " of effect chain " + ToString(iChain) + |
ToString(iChainPos) + " of send effect chain " + ToString(iChain) + |
100 |
": effect doesn't exist." |
": effect chain position out of bounds." |
101 |
); |
); |
102 |
iMasterEffectChain = iChain; |
iDestinationEffectChain = iChain; |
103 |
iMasterEffect = iEffect; |
iDestinationEffectChainPos = iChainPos; |
104 |
|
} |
105 |
|
|
106 |
|
// TODO: to be removed |
107 |
|
int FxSend::DestinationMasterEffectChain() const { |
108 |
|
return DestinationEffectChain(); |
109 |
|
} |
110 |
|
|
111 |
|
// TODO: to be removed |
112 |
|
int FxSend::DestinationMasterEffect() const { |
113 |
|
return DestinationEffectChainPosition(); |
114 |
|
} |
115 |
|
|
116 |
|
// TODO: to be removed |
117 |
|
void FxSend::SetDestinationMasterEffect(int iChain, int iChainPos) throw (Exception) { |
118 |
|
SetDestinationEffect(iChain, iChainPos); |
119 |
} |
} |
120 |
|
|
121 |
int FxSend::DestinationChannel(int SrcChan) { |
int FxSend::DestinationChannel(int SrcChan) { |