aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/xsample/source/main.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-11-19 23:15:44 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-11-19 23:15:44 +0000
commit0f576ee67600ceb2a435fb26b036551ffde8bb74 (patch)
treefa4cdf924a6569339f9d100477a3005f3718fb58 /externals/grill/xsample/source/main.cpp
parent21859fabaa92215068d7176e504ac0d59d4301a5 (diff)
*** empty log message ***
svn path=/trunk/; revision=3981
Diffstat (limited to 'externals/grill/xsample/source/main.cpp')
-rw-r--r--externals/grill/xsample/source/main.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/externals/grill/xsample/source/main.cpp b/externals/grill/xsample/source/main.cpp
index df0c1456..c62df461 100644
--- a/externals/grill/xsample/source/main.cpp
+++ b/externals/grill/xsample/source/main.cpp
@@ -49,7 +49,7 @@ void xsample::setup(t_classid c)
}
xsample::xsample():
- update(xsc_all),
+ update(xsc_all),wrap(false),
#if FLEXT_SYS == FLEXT_SYS_MAX
unitmode(xsu_ms), // Max/MSP defaults to milliseconds
#else
@@ -168,12 +168,18 @@ void xsample::DoUpdate(unsigned int flags)
if(flags&xsc_range && buf.Ok()) {
const int f = buf.Frames();
-
- if(curmin < 0) curmin = 0;
- else if(curmin > f) curmin = f;
-
- if(curmax > f) curmax = f;
- else if(curmax < curmin) curmax = curmin;
+
+ if(!wrap) {
+ // normalize bounds
+ if(curmin < 0) curmin = 0;
+ else if(curmin > f) curmin = f;
+
+ if(curmax > f) curmax = f;
+ else if(curmax < curmin) curmax = curmin;
+ }
+ else
+ // don't normalize
+ if(curmax < curmin) curmax = curmin;
}
if(flags&xsc_units) {