28 |
|
|
29 |
#include <map> |
#include <map> |
30 |
|
|
31 |
|
#define DEFAULT_FX_SEND_LEVEL 0.0f |
32 |
|
|
33 |
namespace LinuxSampler { |
namespace LinuxSampler { |
34 |
|
|
35 |
FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception) { |
FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception) { |
40 |
const int iDestination = iChanOffset + i; |
const int iDestination = iChanOffset + i; |
41 |
Routing.push_back(iDestination); |
Routing.push_back(iDestination); |
42 |
} |
} |
43 |
MidiFxSendController = MidiCtrl; |
SetMidiController(MidiCtrl); |
44 |
sName = Name; |
sName = Name; |
45 |
|
|
46 |
// create an EngineChannel unique ID for this FxSend instance |
// create an EngineChannel unique ID for this FxSend instance |
72 |
} |
} |
73 |
__done: |
__done: |
74 |
|
|
75 |
fLevel = 0.3f; // default FX send level |
fLevel = DEFAULT_FX_SEND_LEVEL; |
76 |
} |
} |
77 |
|
|
78 |
int FxSend::DestinationChannel(int SrcChan) { |
int FxSend::DestinationChannel(int SrcChan) { |
125 |
fLevel = float(iMidiValue & 0x7f) / 127.0f; |
fLevel = float(iMidiValue & 0x7f) / 127.0f; |
126 |
} |
} |
127 |
|
|
128 |
|
void FxSend::Reset() { |
129 |
|
fLevel = DEFAULT_FX_SEND_LEVEL; |
130 |
|
} |
131 |
|
|
132 |
uint8_t FxSend::MidiController() { |
uint8_t FxSend::MidiController() { |
133 |
return MidiFxSendController; |
return MidiFxSendController; |
134 |
} |
} |
135 |
|
|
136 |
void FxSend::SetMidiController(uint8_t MidiCtrl) throw (Exception) { |
void FxSend::SetMidiController(uint8_t MidiCtrl) throw (Exception) { |
137 |
if (MidiCtrl & 0x7f) |
if (MidiCtrl >> 7) |
138 |
throw Exception("Invalid MIDI controller"); |
throw Exception("Invalid MIDI controller " + ToString((int)MidiCtrl)); |
139 |
MidiFxSendController = MidiCtrl; |
MidiFxSendController = MidiCtrl; |
140 |
} |
} |
141 |
|
|