/[svn]/linuxsampler/trunk/src/engines/gig/InstrumentResourceManager.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/InstrumentResourceManager.cpp

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

revision 1774 by iliev, Thu Sep 11 18:11:06 2008 UTC revision 1797 by persson, Thu Dec 4 19:33:13 2008 UTC
# Line 185  namespace LinuxSampler { namespace gig { Line 185  namespace LinuxSampler { namespace gig {
185                  } else {                  } else {
186                      for (int i = low; i <= high; i++) info.KeyBindings[i] = 1;                      for (int i = low; i <= high; i++) info.KeyBindings[i] = 1;
187                  }                  }
188    
189                  pRegion = pInstrument->GetNextRegion();                  pRegion = pInstrument->GetNextRegion();
190              }              }
191                
192              if (loaded) { // retrieve keyswitching only if the instrument is fully loaded.              if (loaded) { // retrieve keyswitching only if the instrument is fully loaded.
193                  int low = pInstrument->DimensionKeyRange.low;  
194                  int high = pInstrument->DimensionKeyRange.high;                  // only return keyswitch range if keyswitching is used
195                  if (low < 0 || low > 127 || high < 0 || high > 127 || low > high) {                  bool hasKeyswitches = false;
196                      std::cerr << "Invalid keyswitch range: " << low << " - " << high << std::endl;                  for (::gig::Region* pRegion = pInstrument->GetFirstRegion() ;
197                  } else {                       pRegion && !hasKeyswitches ;
198                      for (int i = low; i <= high; i++) info.KeySwitchBindings[i] = 1;                       pRegion = pInstrument->GetNextRegion()) {
199                        for (int i = 0 ; i < pRegion->Dimensions ; i++) {
200                            if (pRegion->pDimensionDefinitions[i].dimension == ::gig::dimension_keyboard) {
201                                hasKeyswitches = true;
202                                break;
203                            }
204                        }
205                    }
206    
207                    if (hasKeyswitches) {
208                        int low = pInstrument->DimensionKeyRange.low;
209                        int high = pInstrument->DimensionKeyRange.high;
210                        if (low < 0 || low > 127 || high < 0 || high > 127 || low > high) {
211                            std::cerr << "Invalid keyswitch range: " << low << " - " << high << std::endl;
212                        } else {
213                            for (int i = low; i <= high; i++) info.KeySwitchBindings[i] = 1;
214                        }
215                  }                  }
216              }              }
217    

Legend:
Removed from v.1774  
changed lines
  Added in v.1797

  ViewVC Help
Powered by ViewVC