From: <pst...@us...> - 2010-04-25 03:07:03
|
Revision: 745 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=745&view=rev Author: pstieber Date: 2010-04-25 03:06:57 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Made cosmetic changes. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/SampleCommand.cpp Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2010-04-05 03:53:42 UTC (rev 744) +++ trunk/jazz/src/Command.cpp 2010-04-25 03:06:57 UTC (rev 745) @@ -631,7 +631,7 @@ k = (tKeyOn *)pEvent->Copy(); //little hack, if clock is -1000 it means set startclock from the first event. - if(startClock==-1000) + if (startClock==-1000) { startClock = k->GetClock(); } Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2010-04-05 03:53:42 UTC (rev 744) +++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:06:57 UTC (rev 745) @@ -157,8 +157,14 @@ { register int loc1,loc2; float frac = ((float)(nsample)/(*tab)) * *(tab+1); - if(frac < 0) return(array[0]); - if(frac >= *(tab+1)) return(array[(int)*(tab+1)]); + if (frac < 0) + { + return(array[0]); + } + if (frac >= *(tab+1)) + { + return(array[(int)*(tab+1)]); + } loc1 = (int)frac; loc2 = loc1+1; frac = frac - (float)loc1; @@ -171,23 +177,34 @@ void tCMixCmd::setline(const float *p, short n_args,int length,float *array) { - double increm; - int i,j,k,points; + double increm; + int i,j,k,points; - increm = (double)(p[n_args - 2] - p[0])/(double)length; - for(j=0,i=0; j < (n_args-2); j += 2) { - points = (int)((double)(p[j+2] - p[j]) / increm +.5); - if(p[j+2] != p[j]) { - if(points <= 0) points = 1; - for(k=0; k < points; k++) { - array[i++] = ((float)k/(float)points) - * (p[j+3] - p[j+1]) + p[j+1]; - if(i == length) return; - } - } + increm = (double)(p[n_args - 2] - p[0])/(double)length; + for(j=0,i=0; j < (n_args-2); j += 2) + { + points = (int)((double)(p[j+2] - p[j]) / increm +.5); + if (p[j+2] != p[j]) + { + if (points <= 0) + { + points = 1; } - i--; - while(++i < length) array[i] = array[i-1]; + for (k=0; k < points; k++) + { + array[i++] = ((float)k/(float)points) * (p[j+3] - p[j+1]) + p[j+1]; + if (i == length) + { + return; + } + } + } + } + i--; + while(++i < length) + { + array[i] = array[i-1]; + } } @@ -395,12 +412,18 @@ k = (k+1) % reinit; samplenum1 = (float)i + (float)j * interval; - if(!sinp.GetSample(samplenum1, in)) break; + if (!sinp.GetSample(samplenum1, in)) + { + break; + } x = wintable[(int)(((float)j/reinit) * wlen)]; val1 = in[inchan] * x; samplenum2 = (float)(i) + (float)(k-off) * interval; - if(!sinp.GetSample(samplenum2, in)) break; + if (!sinp.GetSample(samplenum2, in)) + { + break; + } x = wintable[(int)(((float)k/reinit) * wlen)]; val2 = in[inchan] * x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |