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

Diff of /linuxsampler/trunk/src/engines/sfz/sfz.cpp

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

revision 2231 by iliev, Sun Aug 7 14:27:24 2011 UTC revision 2232 by iliev, Mon Aug 8 13:40:04 2011 UTC
# Line 324  namespace sfz Line 324  namespace sfz
324          volume = 0;          volume = 0;
325          volume_oncc.clear();          volume_oncc.clear();
326          volume_curvecc.clear();          volume_curvecc.clear();
327            volume_smoothcc.clear();
328          pan = 0;          pan = 0;
329          width = 100;          width = 100;
330          position = 0;          position = 0;
# Line 606  namespace sfz Line 607  namespace sfz
607          region->volume = volume;          region->volume = volume;
608          region->volume_oncc = volume_oncc;          region->volume_oncc = volume_oncc;
609          region->volume_curvecc = volume_curvecc;          region->volume_curvecc = volume_curvecc;
610            region->volume_smoothcc = volume_smoothcc;
611          region->pan = pan;          region->pan = pan;
612          region->width = width;          region->width = width;
613          region->position = position;          region->position = position;
# Line 967  namespace sfz Line 969  namespace sfz
969              Region* r = _instrument->regions[k];              Region* r = _instrument->regions[k];
970                            
971              copyCurves(r->volume_curvecc, r->volume_oncc);              copyCurves(r->volume_curvecc, r->volume_oncc);
972                copySmoothValues(r->volume_smoothcc, r->volume_oncc);
973                            
974              r->volume_curvecc.clear();              r->volume_curvecc.clear();
975                r->volume_smoothcc.clear();
976          }          }
977      }      }
978    
# Line 993  namespace sfz Line 997  namespace sfz
997              }              }
998          }          }
999      }      }
1000        
1001        void File::copySmoothValues(LinuxSampler::ArrayList<CC>& smooths, LinuxSampler::ArrayList<CC>& dest) {
1002            for (int i = 0; i < smooths.size(); i++) {
1003                for (int j = 0; j < dest.size(); j++) {
1004                    if (smooths[i].Controller == dest[j].Controller) {
1005                        dest[j].Smooth = smooths[i].Smooth;
1006                    }
1007                }
1008            }
1009        }
1010    
1011      void      void
1012      File::push_header(std::string token)      File::push_header(std::string token)
# Line 1467  namespace sfz Line 1481  namespace sfz
1481              else if ("amplfo_freq" == key_cc) pCurDef->amplfo_freqcc.add( CC(num_cc, check(key, -200.0f, 200.0f, ToFloat(value))) );              else if ("amplfo_freq" == key_cc) pCurDef->amplfo_freqcc.add( CC(num_cc, check(key, -200.0f, 200.0f, ToFloat(value))) );
1482              else if ("volume_on" == key_cc) pCurDef->volume_oncc.add( CC(num_cc, check(key, -100.0f, 100.0f, ToFloat(value))) );              else if ("volume_on" == key_cc) pCurDef->volume_oncc.add( CC(num_cc, check(key, -100.0f, 100.0f, ToFloat(value))) );
1483              else if ("volume_curve" == key_cc) pCurDef->volume_curvecc.add( CC(num_cc, 0, check(key, 0, 30000, ToInt(value))) );              else if ("volume_curve" == key_cc) pCurDef->volume_curvecc.add( CC(num_cc, 0, check(key, 0, 30000, ToInt(value))) );
1484                else if ("volume_smooth" == key_cc) pCurDef->volume_smoothcc.add( CC(num_cc, 0, -1, check(key, 0.0f, 100000.0f /* max? */, ToFloat(value))) );
1485              else std::cerr << "The opcode '" << key << "' is unsupported by libsfz!" << std::endl;              else std::cerr << "The opcode '" << key << "' is unsupported by libsfz!" << std::endl;
1486          }          }
1487    

Legend:
Removed from v.2231  
changed lines
  Added in v.2232

  ViewVC Help
Powered by ViewVC