/[svn]/linuxsampler/trunk/src/engines/common/SignalUnit.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/SignalUnit.h

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

revision 2237 by iliev, Wed Aug 10 19:40:39 2011 UTC revision 2238 by iliev, Fri Aug 12 17:30:47 2011 UTC
# Line 51  namespace LinuxSampler { Line 51  namespace LinuxSampler {
51              }              }
52                            
53                            
54              T increment() {              T& increment() {
55                  if (iSize >= iCapacity) throw Exception("Array out of bounds");                  if (iSize >= iCapacity) throw Exception("Array out of bounds");
56                  return pData[iSize++];                  return pData[iSize++];
57              }              }
# Line 373  namespace LinuxSampler { Line 373  namespace LinuxSampler {
373              bool isSmoothingOut() { return currentTimeStep < timeSteps; }              bool isSmoothingOut() { return currentTimeStep < timeSteps; }
374      };      };
375            
376        
377        const int MaxCCs = 10;
378        
379      /**      /**
380       * Continuous controller signal unit.       * Continuous controller signal unit.
381       * The level of this unit corresponds to the controllers changes       * The level of this unit corresponds to the controllers changes
# Line 423  namespace LinuxSampler { Line 426  namespace LinuxSampler {
426    
427          public:          public:
428                            
429              CCSignalUnit(SignalUnitRack* rack, Listener* l = NULL): SignalUnit(rack), Ctrls(128) {              CCSignalUnit(SignalUnitRack* rack, Listener* l = NULL): SignalUnit(rack), Ctrls(MaxCCs) {
430                  pListener = l;                  pListener = l;
431                  hasSmoothCtrls = isSmoothingOut = false;                  hasSmoothCtrls = isSmoothingOut = false;
432              }              }
433                            
434              CCSignalUnit(const CCSignalUnit& Unit): SignalUnit(Unit.pRack), Ctrls(128) { Copy(Unit); }              CCSignalUnit(const CCSignalUnit& Unit): SignalUnit(Unit.pRack), Ctrls(MaxCCs) { Copy(Unit); }
435              void operator=(const CCSignalUnit& Unit) { Copy(Unit); }              void operator=(const CCSignalUnit& Unit) { Copy(Unit); }
436                            
437              void Copy(const CCSignalUnit& Unit) {              void Copy(const CCSignalUnit& Unit) {
# Line 440  namespace LinuxSampler { Line 443  namespace LinuxSampler {
443              }              }
444                            
445              void AddCC(uint8_t Controller, float Influence, short int Curve = -1, Smoother* pSmoother = NULL) {              void AddCC(uint8_t Controller, float Influence, short int Curve = -1, Smoother* pSmoother = NULL) {
446                    if(Ctrls.size() >= Ctrls.capacity()) {
447                        std::cerr << "Maximum number of CC reached" << std::endl;
448                        return;
449                    }
450                  Ctrls.add(CC(Controller, Influence, Curve, pSmoother));                  Ctrls.add(CC(Controller, Influence, Curve, pSmoother));
451                  if (pSmoother != NULL) hasSmoothCtrls = true;                  if (pSmoother != NULL) hasSmoothCtrls = true;
452              }              }
453                            
454              void RemoveAllCCs() {              virtual void RemoveAllCCs() { Ctrls.clear(); }
                 Ctrls.clear();  
             }  
455                            
456              int GetCCCount() { return Ctrls.size(); }              int GetCCCount() { return Ctrls.size(); }
457                            

Legend:
Removed from v.2237  
changed lines
  Added in v.2238

  ViewVC Help
Powered by ViewVC