/[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 2227 by iliev, Wed Aug 3 17:11:40 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 246  namespace sfz Line 247  namespace sfz
247          float level;          float level;
248          float shape;          float shape;
249          float curve;          float curve;
250            LinuxSampler::ArrayList<CC> time_oncc;
251            LinuxSampler::ArrayList<CC> level_oncc;
252            
253          EGNode();          EGNode();
254            EGNode(const EGNode& egNode) { Copy(egNode); }
255            void operator=(const EGNode& egNode) { Copy(egNode); }
256            void Copy(const EGNode& egNode);
257      };      };
258    
259      class EG      class EG
# Line 259  namespace sfz Line 266  namespace sfz
266          float amplitude;          float amplitude;
267          float cutoff;          float cutoff;
268          EG();          EG();
269            EG(const EG& eg) { Copy(eg); }
270            void operator=(const EG& eg) { Copy(eg); }
271            void Copy(const EG& eg);
272      };      };
273    
274      class LFO      class LFO
# Line 281  namespace sfz Line 291  namespace sfz
291          LinuxSampler::ArrayList<CC> pitch_oncc;          LinuxSampler::ArrayList<CC> pitch_oncc;
292                    
293          LFO();          LFO();
294            LFO(const LFO& lfo) { Copy(lfo); }
295            void operator=(const LFO& lfo) { Copy(lfo); }
296            void Copy(const LFO& lfo);
297      };      };
298    
299      // Fixed size array with copy-on-write semantics      // Fixed size array with copy-on-write semantics
# Line 442  namespace sfz Line 455  namespace sfz
455          //Deprecated (from version 1)          //Deprecated (from version 1)
456          float ampeg_delay, ampeg_start, ampeg_attack, ampeg_hold, ampeg_decay, ampeg_sustain, ampeg_release;          float ampeg_delay, ampeg_start, ampeg_attack, ampeg_hold, ampeg_decay, ampeg_sustain, ampeg_release;
457          float ampeg_vel2delay, ampeg_vel2attack, ampeg_vel2hold, ampeg_vel2decay, ampeg_vel2sustain, ampeg_vel2release;          float ampeg_vel2delay, ampeg_vel2attack, ampeg_vel2hold, ampeg_vel2decay, ampeg_vel2sustain, ampeg_vel2release;
458            LinuxSampler::ArrayList<CC> ampeg_delaycc, ampeg_startcc, ampeg_attackcc, ampeg_holdcc;
459            LinuxSampler::ArrayList<CC> ampeg_decaycc, ampeg_sustaincc, ampeg_releasecc;
460          float fileg_delay, fileg_start, fileg_attack, fileg_hold, fileg_decay, fileg_sustain, fileg_release;          float fileg_delay, fileg_start, fileg_attack, fileg_hold, fileg_decay, fileg_sustain, fileg_release;
461          float fileg_vel2delay, fileg_vel2attack, fileg_vel2hold, fileg_vel2decay, fileg_vel2sustain, fileg_vel2release;          float fileg_vel2delay, fileg_vel2attack, fileg_vel2hold, fileg_vel2decay, fileg_vel2sustain, fileg_vel2release;
462          float pitcheg_delay, pitcheg_start, pitcheg_attack, pitcheg_hold, pitcheg_decay, pitcheg_sustain, pitcheg_release;          float pitcheg_delay, pitcheg_start, pitcheg_attack, pitcheg_hold, pitcheg_decay, pitcheg_sustain, pitcheg_release;
# Line 462  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 528  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 548  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 604  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.2227  
changed lines
  Added in v.2230

  ViewVC Help
Powered by ViewVC