/[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 2115 by persson, Thu Aug 12 15:36:15 2010 UTC revision 2175 by persson, Mon Apr 25 08:12:36 2011 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2008 Anders Dahnielson <anders@dahnielson.com>          *   *   Copyright (C) 2008 Anders Dahnielson <anders@dahnielson.com>          *
6   *   Copyright (C) 2009 - 2010 Anders Dahnielson and Grigor Iliev          *   *   Copyright (C) 2009 - 2011 Anders Dahnielson and Grigor Iliev          *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 149  namespace sfz Line 149  namespace sfz
149      }      }
150    
151      bool Region::HasLoop() {      bool Region::HasLoop() {
152          bool b = loop_mode == ::sfz::LOOP_CONTINUOUS || loop_mode == ::sfz::LOOP_SUSTAIN; // TODO: ONE_SHOT mode          bool b = loop_mode == ::sfz::LOOP_UNSET ? pSample->GetLoops() :
153                (loop_mode == ::sfz::LOOP_CONTINUOUS || loop_mode == ::sfz::LOOP_SUSTAIN);
154          return b && GetLoopStart() && GetLoopEnd() && GetLoopEnd() > GetLoopStart();          return b && GetLoopStart() && GetLoopEnd() && GetLoopEnd() > GetLoopStart();
155      }      }
156    
157      uint Region::GetLoopStart() {      uint Region::GetLoopStart() {
158          return (!loop_start) ? 0 : *loop_start; // TODO: use sample loop when loop_start not defined          return (!loop_start) ? pSample->GetLoopStart() : *loop_start;
159      }      }
160    
161      uint Region::GetLoopEnd() {      uint Region::GetLoopEnd() {
162          return (!loop_end) ? 0 : *loop_end; // TODO: use sample loop when loop_end not defined          return (!loop_end) ? pSample->GetLoopEnd() : *loop_end;
163      }      }
164    
165      uint Region::GetLoopCount() {      uint Region::GetLoopCount() {
# Line 284  namespace sfz Line 285  namespace sfz
285          end.unset();          end.unset();
286          loop_crossfade.unset();          loop_crossfade.unset();
287          offset.unset(); offset_random.unset();          offset.unset(); offset_random.unset();
288          loop_mode = NO_LOOP;          loop_mode = LOOP_UNSET;
289          loop_start.unset(); loop_end.unset();          loop_start.unset(); loop_end.unset();
290          sync_beats.unset(); sync_offset.unset();          sync_beats.unset(); sync_offset.unset();
291    
# Line 411  namespace sfz Line 412  namespace sfz
412              eq2_gain_oncc.set(i, 0);              eq2_gain_oncc.set(i, 0);
413              eq3_gain_oncc.set(i, 0);              eq3_gain_oncc.set(i, 0);
414          }          }
415            cutoff_cc = 0;
416    
417          eg.clear();          eg.clear();
418    
# Line 573  namespace sfz Line 575  namespace sfz
575          region->fil_type = fil_type;          region->fil_type = fil_type;
576          region->cutoff = cutoff;          region->cutoff = cutoff;
577          region->cutoff_oncc = cutoff_oncc;          region->cutoff_oncc = cutoff_oncc;
578            region->cutoff_cc = cutoff_cc;
579          region->cutoff_smoothcc = cutoff_smoothcc;          region->cutoff_smoothcc = cutoff_smoothcc;
580          region->cutoff_stepcc = cutoff_stepcc;          region->cutoff_stepcc = cutoff_stepcc;
581          region->cutoff_curvecc = cutoff_curvecc;          region->cutoff_curvecc = cutoff_curvecc;
# Line 1169  namespace sfz Line 1172  namespace sfz
1172              else if ("xfout_hi" == key_cc) pCurDef->xfout_hicc.set(num_cc, ToInt(value));              else if ("xfout_hi" == key_cc) pCurDef->xfout_hicc.set(num_cc, ToInt(value));
1173    
1174              // filter              // filter
1175              else if ("cutoff_on"  == key_cc || "cutoff_" == key_cc) pCurDef->cutoff_oncc.set(num_cc, ToInt(value));              else if ("cutoff_on"  == key_cc || "cutoff_" == key_cc) {
1176              else if ("cutoff2_on" == key_cc) pCurDef->cutoff2_oncc.set(num_cc, ToInt(value));                  pCurDef->cutoff_oncc.set(num_cc, ToInt(value));
1177                    pCurDef->cutoff_cc = num_cc;
1178                } else if ("cutoff2_on" == key_cc) pCurDef->cutoff2_oncc.set(num_cc, ToInt(value));
1179              else if ("cutoff_smooth"  == key_cc) pCurDef->cutoff_smoothcc.set(num_cc, ToInt(value));              else if ("cutoff_smooth"  == key_cc) pCurDef->cutoff_smoothcc.set(num_cc, ToInt(value));
1180              else if ("cutoff2_smooth" == key_cc) pCurDef->cutoff2_smoothcc.set(num_cc, ToInt(value));              else if ("cutoff2_smooth" == key_cc) pCurDef->cutoff2_smoothcc.set(num_cc, ToInt(value));
1181              else if ("cutoff_step"  == key_cc) pCurDef->cutoff_stepcc.set(num_cc, ToInt(value));              else if ("cutoff_step"  == key_cc) pCurDef->cutoff_stepcc.set(num_cc, ToInt(value));

Legend:
Removed from v.2115  
changed lines
  Added in v.2175

  ViewVC Help
Powered by ViewVC