/[svn]/linuxsampler/trunk/src/engines/FxSend.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/FxSend.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1017 by schoenebeck, Tue Jan 9 23:51:32 2007 UTC revision 1135 by iliev, Thu Mar 29 09:40:45 2007 UTC
# Line 28  Line 28 
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) {
# Line 38  namespace LinuxSampler { Line 40  namespace LinuxSampler {
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
# Line 70  namespace LinuxSampler { Line 72  namespace LinuxSampler {
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) {
# Line 116  namespace LinuxSampler { Line 118  namespace LinuxSampler {
118      }      }
119    
120      void FxSend::SetLevel(float f) {      void FxSend::SetLevel(float f) {
121            if(fLevel == f) return;
122          fLevel = f;          fLevel = f;
123            SetInfoChanged(true);
124      }      }
125    
126      void FxSend::SetLevel(uint8_t iMidiValue) {      void FxSend::SetLevel(uint8_t iMidiValue) {
127          fLevel = float(iMidiValue & 0x7f) / 127.0f;          fLevel = float(iMidiValue & 0x7f) / 127.0f;
128            SetInfoChanged(true);
129        }
130    
131        void FxSend::Reset() {
132            SetLevel(DEFAULT_FX_SEND_LEVEL);
133      }      }
134    
135      uint8_t FxSend::MidiController() {      uint8_t FxSend::MidiController() {
# Line 128  namespace LinuxSampler { Line 137  namespace LinuxSampler {
137      }      }
138    
139      void FxSend::SetMidiController(uint8_t MidiCtrl) throw (Exception) {      void FxSend::SetMidiController(uint8_t MidiCtrl) throw (Exception) {
140          if (MidiCtrl & 0x7f)          if (MidiCtrl >> 7)
141              throw Exception("Invalid MIDI controller");              throw Exception("Invalid MIDI controller " + ToString((int)MidiCtrl));
142          MidiFxSendController = MidiCtrl;          MidiFxSendController = MidiCtrl;
143      }      }
144    
# Line 137  namespace LinuxSampler { Line 146  namespace LinuxSampler {
146          return sName;          return sName;
147      }      }
148    
149        void FxSend::SetName(String Name) {
150            sName = Name;
151        }
152    
153      uint FxSend::Id() {      uint FxSend::Id() {
154          return iId;          return iId;
155      }      }
156    
157        void FxSend::SetInfoChanged(bool b) {
158            bInfoChanged = b;
159        }
160    
161        bool FxSend::IsInfoChanged() {
162            return bInfoChanged;
163        }
164    
165  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.1017  
changed lines
  Added in v.1135

  ViewVC Help
Powered by ViewVC