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

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

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

revision 2216 by iliev, Mon Jul 11 17:52:01 2011 UTC revision 2217 by iliev, Tue Jul 26 15:51:30 2011 UTC
# Line 34  namespace LinuxSampler { Line 34  namespace LinuxSampler {
34              uint CurrentStep; // The current time step              uint CurrentStep; // The current time step
35    
36          public:          public:
37                ArrayList<SignalUnit*> Units; // A list of all signal units in this rack
38    
39              SignalUnitRack(): CurrentStep(0) { }              SignalUnitRack(): CurrentStep(0) { }
40              uint GetCurrentStep() { return CurrentStep; }              uint GetCurrentStep() { return CurrentStep; }
41    
             /**  
              * Will be called to increment the time with one sample point.  
              * Each unit should recalculate its current level on every call of this function.  
              */  
             virtual void Increment() = 0;  
               
             virtual void ProcessCCEvent(RTList<Event>::Iterator& itEvent) = 0;  
               
             /** Initializes and triggers the rack. */  
             virtual void Trigger() = 0;  
               
             /**  
              * When the rack belongs to a voice, this method is  
              * called when the voice enter the release stage.  
              */  
             virtual void EnterReleaseStage() = 0;  
               
             /**  
              * When the rack belongs to a voice, this method is  
              * called when the voice is of type which ignore note off.  
              */  
             virtual void CancelRelease() = 0;  
               
42              virtual EndpointSignalUnit* GetEndpointUnit() = 0;              virtual EndpointSignalUnit* GetEndpointUnit() = 0;
     };  
       
     template <class O /* The signal unit rack's owner */>  
     class SignalUnitRackBase: public SignalUnitRack {  
         protected:  
             O* pOwner; // The owner to which this rack belongs.  
   
         public:  
             ArrayList<SignalUnitBase<O>*> Units; // A list of all signal units in this rack  
               
             SignalUnitRackBase(O* Owner) {  
                 pOwner = Owner;  
             }  
43                            
44              /**              /**
45               * Will be called to increment the time with one sample point.               * Will be called to increment the time with one sample point.
# Line 98  namespace LinuxSampler { Line 64  namespace LinuxSampler {
64              virtual void Trigger() {              virtual void Trigger() {
65                  CurrentStep = 0;                  CurrentStep = 0;
66                  for (int i = 0; i < Units.size(); i++) {                  for (int i = 0; i < Units.size(); i++) {
                     Units[i]->SetOwner(pOwner);  
67                      Units[i]->Trigger();                      Units[i]->Trigger();
68                  }                  }
69              }              }
70                            
71                /**
72                 * When the rack belongs to a voice, this method is
73                 * called when the voice enter the release stage.
74                 */
75              virtual void EnterReleaseStage() {              virtual void EnterReleaseStage() {
76                  for (int i = 0; i < Units.size(); i++) {                  for (int i = 0; i < Units.size(); i++) {
77                      Units[i]->EnterReleaseStage();                      Units[i]->EnterReleaseStage();
78                  }                  }
79              }              }
80                            
81                /**
82                 * When the rack belongs to a voice, this method is
83                 * called when the voice is of type which ignore note off.
84                 */
85              virtual void CancelRelease() {              virtual void CancelRelease() {
86                  for (int i = 0; i < Units.size(); i++) {                  for (int i = 0; i < Units.size(); i++) {
87                      Units[i]->CancelRelease();                      Units[i]->CancelRelease();

Legend:
Removed from v.2216  
changed lines
  Added in v.2217

  ViewVC Help
Powered by ViewVC