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

Diff of /linuxsampler/trunk/src/engines/sfz/SfzSignalUnitRack.cpp

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

revision 2230 by iliev, Fri Aug 5 17:59:10 2011 UTC revision 2232 by iliev, Mon Aug 8 13:40:04 2011 UTC
# Line 256  namespace LinuxSampler { namespace sfz { Line 256  namespace LinuxSampler { namespace sfz {
256      void CCUnit::Trigger() {      void CCUnit::Trigger() {
257          for (int i = 0; i < Ctrls.size(); i++) {          for (int i = 0; i < Ctrls.size(); i++) {
258              Ctrls[i].Value = pVoice->GetControllerValue(Ctrls[i].Controller);              Ctrls[i].Value = pVoice->GetControllerValue(Ctrls[i].Controller);
259                if (Ctrls[i].pSmoother != NULL) Ctrls[i].pSmoother->setValue(Ctrls[i].Value);
260          }          }
261          CCSignalUnit::Trigger();          CCSignalUnit::Trigger();
262      }      }
# Line 273  namespace LinuxSampler { namespace sfz { Line 274  namespace LinuxSampler { namespace sfz {
274               if (cc[i].Influence != 0) {               if (cc[i].Influence != 0) {
275                   short int curve = cc[i].Curve;                   short int curve = cc[i].Curve;
276                   if (curve >= GetCurveCount()) curve = -1;                   if (curve >= GetCurveCount()) curve = -1;
277                   AddCC(cc[i].Controller, cc[i].Influence, curve);                   AddSmoothCC(cc[i].Controller, cc[i].Influence, curve, cc[i].Smooth);
278               }               }
279           }           }
280       }       }
281            
282         void CCUnit::AddSmoothCC(uint8_t Controller, float Influence, short int Curve, float Smooth) {
283             AddCC(Controller, Influence, Curve);
284         }
285        
286       int CCUnit::GetCurveCount() {       int CCUnit::GetCurveCount() {
287           return pVoice->pRegion->GetInstrument()->curves.size();           return pVoice->pRegion->GetInstrument()->curves.size();
288       }       }
# Line 285  namespace LinuxSampler { namespace sfz { Line 290  namespace LinuxSampler { namespace sfz {
290       ::sfz::Curve* CCUnit::GetCurve(int idx) {       ::sfz::Curve* CCUnit::GetCurve(int idx) {
291           return &pVoice->pRegion->GetInstrument()->curves[idx];           return &pVoice->pRegion->GetInstrument()->curves[idx];
292       }       }
293        
294         double CCUnit::GetSampleRate() {
295            return pVoice->GetSampleRate() / CONFIG_DEFAULT_SUBFRAGMENT_SIZE;
296        }
297        
298         void SmoothCCUnit::AddSmoothCC(uint8_t Controller, float Influence, short int Curve, float Smooth) {
299             if (Smooth > 0) {
300                 Smoothers[Controller].trigger(Smooth / 1000.0f, GetSampleRate());
301                 AddCC(Controller, Influence, Curve, &Smoothers[Controller]);
302             } else {
303                 AddCC(Controller, Influence, Curve);
304             }
305         }
306    
307    
308      EndpointUnit::EndpointUnit(SfzSignalUnitRack* rack): EndpointSignalUnit(rack) {      EndpointUnit::EndpointUnit(SfzSignalUnitRack* rack): EndpointSignalUnit(rack) {

Legend:
Removed from v.2230  
changed lines
  Added in v.2232

  ViewVC Help
Powered by ViewVC