/[svn]/linuxsampler/trunk/src/drivers/DeviceParameter.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/DeviceParameter.cpp

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

revision 1296 by iliev, Wed Aug 15 17:43:34 2007 UTC revision 1305 by iliev, Mon Aug 27 07:51:28 2007 UTC
# Line 605  namespace LinuxSampler { Line 605  namespace LinuxSampler {
605      void DeviceCreationParameterInt::SetValue(String val) throw (Exception) {      void DeviceCreationParameterInt::SetValue(String val) throw (Exception) {
606          if (Fix()) throw Exception("Device parameter is read only");          if (Fix()) throw Exception("Device parameter is read only");
607          int i = __parse_int(val);          int i = __parse_int(val);
608          //if (RangeMinAsInt() && i < *RangeMinAsInt()) throw Exception("Invalid device parameter value: too small");  
609          //if (RangeMaxAsInt() && i > *RangeMaxAsInt()) throw Exception("Invalid device parameter value: too big");          std::map<String,String> emptyMap;
610          /*if (PossibilitiesAsInt()) {          if (RangeMinAsInt(emptyMap) && i < *RangeMinAsInt(emptyMap)) {
611                throw Exception("Invalid device parameter value: too small");
612            }
613            if (RangeMaxAsInt(emptyMap) && i > *RangeMaxAsInt(emptyMap)) {
614                throw Exception("Invalid device parameter value: too big");
615            }
616    
617            if (PossibilitiesAsInt(emptyMap).size()) {
618              bool valid = false;              bool valid = false;
619              std::vector<int>* pPossibilities = PossibilitiesAsInt();              std::vector<int> possibilities = PossibilitiesAsInt(emptyMap);
620              std::vector<int>::iterator iter  = pPossibilities->begin();              std::vector<int>::iterator iter  = possibilities.begin();
621              while (iter != pPossibilities->end()) {              while (iter != possibilities.end()) {
622                  if (i == *iter) {                  if (i == *iter) {
623                      valid = true;                      valid = true;
624                      break;                      break;
# Line 619  namespace LinuxSampler { Line 626  namespace LinuxSampler {
626                  iter++;                  iter++;
627              }              }
628              if (!valid) throw Exception("Invalid Device parameter value: not in set of possible values");              if (!valid) throw Exception("Invalid Device parameter value: not in set of possible values");
629          }*/          }
630          SetValue(i);          SetValue(i);
631      }      }
632    

Legend:
Removed from v.1296  
changed lines
  Added in v.1305

  ViewVC Help
Powered by ViewVC