/[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 2100 by persson, Sat May 15 09:02:31 2010 UTC revision 2101 by persson, Sun May 30 11:40:31 2010 UTC
# Line 404  namespace sfz Line 404  namespace sfz
404          LinuxSampler::ArrayList<EG> eg;          LinuxSampler::ArrayList<EG> eg;
405      };      };
406    
407        class Query {
408        public:
409            Query(const Instrument& instrument);
410            Region* next();
411            uint8_t chan;        // MIDI channel
412            uint8_t key;         // MIDI note      TODO: or controller
413            uint8_t vel;         // MIDI velocity
414            int bend;            // MIDI pitch bend
415            uint8_t bpm;         // host BPM
416            uint8_t chanaft;     // MIDI channel pressure
417            uint8_t polyaft;     // MIDI polyphonic aftertouch
418            uint8_t prog;        // MIDI program change
419            float rand;          // generated random number
420            trigger_t trig;      // how it was triggered
421            uint8_t* cc;         // all 128 CC values
422            float timer;         // time since previous region in the group was triggered
423            bool* sw;            // state of region key switches, 128 possible values
424            uint8_t last_sw_key; // last key pressed in the key switch range
425            uint8_t prev_sw_key; // previous note value
426        private:
427            std::vector<Region*>::const_iterator i;
428            std::vector<Region*>::const_iterator regions_end;
429        };
430    
431      /////////////////////////////////////////////////////////////      /////////////////////////////////////////////////////////////
432      // class Region      // class Region
433    
# Line 429  namespace sfz Line 453  namespace sfz
453          uint GetLoopCount();          uint GetLoopCount();
454    
455          /// Return true if region is triggered by key          /// Return true if region is triggered by key
456          bool OnKey(uint8_t chan, uint8_t key, uint8_t vel,          bool OnKey(const Query& q);
                int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft,  
                uint8_t prog, float rand, trigger_t trig, uint8_t* cc,  
                float timer, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);  
457    
458          /// Return true if region is triggered by control change          /// Return true if region is triggered by control change
459          bool OnControl(uint8_t chan, uint8_t cont, uint8_t val,          bool OnControl(uint8_t chan, uint8_t cont, uint8_t val,
# Line 441  namespace sfz Line 462  namespace sfz
462                     float timer, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);                     float timer, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);
463    
464          /// Return an articulation for the current state          /// Return an articulation for the current state
465           Articulation* GetArticulation(int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft, uint8_t* cc);          Articulation* GetArticulation(int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft, uint8_t* cc);
466    
467          // unique region id          // unique region id
468          int id;          int id;
# Line 464  namespace sfz Line 485  namespace sfz
485          std::string GetName() { return name; }          std::string GetName() { return name; }
486          SampleManager* GetSampleManager() { return pSampleManager; }          SampleManager* GetSampleManager() { return pSampleManager; }
487    
         /**  
          * @returns All regions that are triggered by key  
          */  
         std::vector<Region*> GetRegionsOnKey (  
             uint8_t chan, uint8_t key, uint8_t vel,  
             int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft,  
             uint8_t prog, float rand, trigger_t trig, uint8_t* cc,  
             float timer, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key  
         );  
   
488          bool DestroyRegion(Region* pRegion);          bool DestroyRegion(Region* pRegion);
489          bool HasKeyBinding(uint8_t key);          bool HasKeyBinding(uint8_t key);
490          bool HasKeySwitchBinding(uint8_t key);          bool HasKeySwitchBinding(uint8_t key);

Legend:
Removed from v.2100  
changed lines
  Added in v.2101

  ViewVC Help
Powered by ViewVC