/[svn]/libgig/trunk/src/SF.cpp
ViewVC logotype

Diff of /libgig/trunk/src/SF.cpp

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

revision 2099 by persson, Sun Jan 10 12:58:51 2010 UTC revision 2100 by persson, Sun May 30 11:39:36 2010 UTC
# Line 21  Line 21 
21   *   MA  02111-1307  USA                                                   *   *   MA  02111-1307  USA                                                   *
22   ***************************************************************************/   ***************************************************************************/
23    
 #include <vector>  
   
24  #include "RIFF.h"  #include "RIFF.h"
25    
26  #include "SF.h"  #include "SF.h"
# Line 659  namespace sf2 { Line 657  namespace sf2 {
657          return regions[idx];          return regions[idx];
658      }      }
659    
660      std::vector<Region*> InstrumentBase::GetRegionsOnKey(int key, uint8_t vel) {      Query::Query(InstrumentBase& instrument) : instrument(instrument) {
661          std::vector<Region*> v;          i = 0;
662          for (int i = 0; i < GetRegionCount(); i++) {      }
663              Region* r = GetRegion(i);  
664              if (      Region* Query::next() {
665                  ((r->loKey  == NONE && r->hiKey  == NONE) || (key >= r->loKey && key <= r->hiKey)) &&          while (i < instrument.GetRegionCount()) {
666                  ((r->minVel == NONE && r->maxVel == NONE) || (vel >= r->minVel && vel <= r->maxVel))              Region* r = instrument.GetRegion(i++);
667              ) {              if (((r->loKey  == NONE && r->hiKey  == NONE) || (key >= r->loKey && key <= r->hiKey)) &&
668                  v.push_back(r);                  ((r->minVel == NONE && r->maxVel == NONE) || (vel >= r->minVel && vel <= r->maxVel))) {
669                    return r;
670              }              }
671          }          }
672            return 0;
         return v;  
673      }      }
674    
675      Instrument::Instrument(sf2::File* pFile, RIFF::Chunk* ck) : InstrumentBase(pFile) {      Instrument::Instrument(sf2::File* pFile, RIFF::Chunk* ck) : InstrumentBase(pFile) {

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

  ViewVC Help
Powered by ViewVC