From 0f576ee67600ceb2a435fb26b036551ffde8bb74 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 19 Nov 2005 23:15:44 +0000 Subject: *** empty log message *** svn path=/trunk/; revision=3981 --- externals/grill/xsample/source/main.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'externals/grill/xsample/source/main.cpp') 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) { -- cgit v1.2.1