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

Diff of /linuxsampler/trunk/src/engines/sfz/sfz.h

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

revision 2229 by iliev, Thu Aug 4 19:02:36 2011 UTC revision 2230 by iliev, Fri Aug 5 17:59:10 2011 UTC
# Line 86  namespace sfz Line 86  namespace sfz
86            
87      class CC {      class CC {
88          public:          public:
89              uint8_t Controller;  ///< MIDI controller number.              uint8_t   Controller;  ///< MIDI controller number.
90              float   Influence;   ///< Controller Value.              short int Curve;
91                float     Influence;   ///< Controller Value.
92                            
93              CC() { CC(0, 0.0f); }              CC(uint8_t Controller = 0, float Influence = 0.0f, short int Curve = -1) {
                       
             CC(uint8_t Controller, float Influence) {  
94                  this->Controller = Controller;                  this->Controller = Controller;
95                  this->Influence = Influence;                  this->Influence  = Influence;
96                    this->Curve      = Curve;
97              }              }
98                                            
99              CC(const CC& cc) { Copy(cc); }              CC(const CC& cc) { Copy(cc); }
# Line 101  namespace sfz Line 101  namespace sfz
101                                            
102              void Copy(const CC& cc) {              void Copy(const CC& cc) {
103                  Controller = cc.Controller;                  Controller = cc.Controller;
104                  Influence = cc.Influence;                  Influence  = cc.Influence;
105                    Curve      = cc.Curve;
106              }              }
107      };      };
108    
# Line 476  namespace sfz Line 477  namespace sfz
477    
478          // low frequency oscillators          // low frequency oscillators
479          LinuxSampler::ArrayList<LFO> lfos;          LinuxSampler::ArrayList<LFO> lfos;
480            
481            LinuxSampler::ArrayList<CC> volume_oncc;
482            LinuxSampler::ArrayList<CC> volume_curvecc; // used only as temporary buffer during the parsing - values are then moved to volume_oncc
483      };      };
484    
485      class Query {      class Query {
# Line 542  namespace sfz Line 546  namespace sfz
546          Instrument* pInstrument;          Instrument* pInstrument;
547          int seq_counter;          int seq_counter;
548      };      };
549        
550        class Curve {
551            public:
552                float v[128];
553                Curve() { for (int i = 0; i < 128; i++) v[i] = 0; }
554                Curve(const Curve& curve) { Copy(curve); }
555                void operator=(const Curve& curve) { Copy(curve); }
556                void Copy(const Curve& curve) { for (int i = 0; i < 128; i++) v[i] = curve.v[i]; }
557        };
558    
559      /////////////////////////////////////////////////////////////      /////////////////////////////////////////////////////////////
560      // class Instrument      // class Instrument
# Line 562  namespace sfz Line 575  namespace sfz
575    
576          /// List of Regions belonging to this Instrument          /// List of Regions belonging to this Instrument
577          std::vector<Region*> regions;          std::vector<Region*> regions;
578            ::LinuxSampler::ArrayList<Curve> curves;
579    
580          friend class File;          friend class File;
581          friend class Query;          friend class Query;
# Line 618  namespace sfz Line 632  namespace sfz
632          EG& eg(int x);          EG& eg(int x);
633          EGNode& egnode(int x, int y);          EGNode& egnode(int x, int y);
634          LFO& lfo(int x);          LFO& lfo(int x);
635            void copyCurves(LinuxSampler::ArrayList<CC>& curves, LinuxSampler::ArrayList<CC>& dest);
636    
637          std::string currentDir;          std::string currentDir;
638          /// Pointer to the Instrument belonging to this file          /// Pointer to the Instrument belonging to this file
639          Instrument* _instrument;          Instrument* _instrument;
640    
641          // state variables          // state variables
642          enum section_t { UNKNOWN, GROUP, REGION, CONTROL };          enum section_t { UNKNOWN, GROUP, REGION, CONTROL, CURVE };
643          section_t _current_section;          section_t _current_section;
644          Region* _current_region;          Region* _current_region;
645          Group* _current_group;          Group* _current_group;
646            Curve* _current_curve;
647          Definition* pCurDef;          Definition* pCurDef;
648    
649          // control header directives          // control header directives

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

  ViewVC Help
Powered by ViewVC