Thread: [Scopeapp-cvs]scopeapp/src InputSampler.h,1.5,1.6 ScopeView.h,1.9,1.10 ScopeView.m,1.13,1.14 TraceVi
Status: Alpha
Brought to you by:
narge
From: <sco...@li...> - 2002-12-05 15:08:13
|
Update of /cvsroot/scopeapp/scopeapp/src In directory sc8-pr-cvs1:/tmp/cvs-serv14147 Modified Files: InputSampler.h ScopeView.h ScopeView.m TraceView.h TraceView.m TestSampler.m Log Message: InputHandler's processData method now requires interleaved audio data rather than one array per channel Index: InputSampler.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/InputSampler.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InputSampler.h 19 Oct 2002 06:39:31 -0000 1.5 --- InputSampler.h 5 Dec 2002 15:08:10 -0000 1.6 *************** *** 35,42 **** // Process the given blocks of data from the given input sampler. ! // inData points to an array of pointers to arrays of Sample // Warning: this function must be thread-safe, as it may be called from // the sampler's thread. ! -(id) processData: (Sample**) inData length: (unsigned long) frameCount channels: (int) channelCount --- 35,42 ---- // Process the given blocks of data from the given input sampler. ! // inData points to an interleaved array of Samples. // Warning: this function must be thread-safe, as it may be called from // the sampler's thread. ! -(id) processData: (Sample*) inData length: (unsigned long) frameCount channels: (int) channelCount Index: ScopeView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ScopeView.h 29 Oct 2002 05:50:11 -0000 1.9 --- ScopeView.h 5 Dec 2002 15:08:10 -0000 1.10 *************** *** 80,84 **** -(id) updateControls; ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 80,84 ---- -(id) updateControls; ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos Index: ScopeView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/ScopeView.m,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ScopeView.m 29 Oct 2002 06:10:43 -0000 1.13 --- ScopeView.m 5 Dec 2002 15:08:10 -0000 1.14 *************** *** 65,77 **** }; - @interface ScopeView (ScopeViewInternal) - - - (id)doTriggerChannelOnData: (Sample*) inData - frameCount: (unsigned long) inFrameCount - atPosition: (unsigned long*) outTriggerPos - didTrigger: (BOOL*) outTriggered; - - @end - @implementation ScopeView --- 65,68 ---- *************** *** 352,356 **** } ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 343,347 ---- } ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos *************** *** 360,374 **** return self; } - - @end - - @implementation ScopeView (ScopeViewInternal) - - /* - - (id)doTriggerChannelOnData: (Sample*) inData - frameCount: (unsigned long) inFrameCount - atPosition: (unsigned long*) outTriggerPos - didTrigger: (BOOL*) outTriggered; - */ @end --- 351,354 ---- Index: TraceView.h =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TraceView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TraceView.h 19 Oct 2002 06:39:31 -0000 1.3 --- TraceView.h 5 Dec 2002 15:08:10 -0000 1.4 *************** *** 67,71 **** -(id) updateDisplay: (int) trace; ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 67,71 ---- -(id) updateDisplay: (int) trace; ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos Index: TraceView.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TraceView.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TraceView.m 29 Oct 2002 05:50:11 -0000 1.6 --- TraceView.m 5 Dec 2002 15:08:10 -0000 1.7 *************** *** 208,212 **** } ! -(id) processData: (Sample**) inData length: (unsigned long) frameCount channels: (int) channelCount --- 208,212 ---- } ! -(id) processData: (Sample*) inData length: (unsigned long) frameCount channels: (int) channelCount *************** *** 236,239 **** --- 236,242 ---- { unsigned long newCollectedSize; + unsigned long i; + Sample* source; + Sample* dest; if(!hasTriggered[curChannel]) *************** *** 251,258 **** { newCollectedSize = myDataWanted[curChannel]; } ! memcpy(myCollectedData[curChannel] + myDataCollected[curChannel], ! inData[curChannel] + theTriggerPoint[curChannel], ! (newCollectedSize - myDataCollected[curChannel]) ! * sizeof(Sample)); myDataCollected[curChannel] = newCollectedSize; --- 254,265 ---- { newCollectedSize = myDataWanted[curChannel]; } ! source = inData + curChannel; ! dest = myCollectedData[curChannel] + ! myDataCollected[curChannel]; ! for(i=myDataCollected[curChannel]; i < newCollectedSize; i++) ! { ! *(dest++) = *source; ! source += channelCount; ! } myDataCollected[curChannel] = newCollectedSize; *************** *** 269,273 **** } ! - (id)doTriggerOnData: (Sample*[2]) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos --- 276,280 ---- } ! - (id)doTriggerOnData: (Sample*) inData frameCount: (unsigned long) inFrameCount atPosition: (unsigned long[2]) outTriggerPos Index: TestSampler.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/TestSampler.m,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestSampler.m 19 Oct 2002 06:39:31 -0000 1.7 --- TestSampler.m 5 Dec 2002 15:08:10 -0000 1.8 *************** *** 183,187 **** { int curChannel; ! Sample* theData[myChannelCount]; unsigned long curSample; float amplitude = (float)random() / (float)INT_MAX; --- 183,187 ---- { int curChannel; ! Sample* theData; unsigned long curSample; float amplitude = (float)random() / (float)INT_MAX; *************** *** 191,203 **** if(myOwner == nil) return self; ! for(curChannel = 0; curChannel < myChannelCount; curChannel++) ! { ! theData[curChannel] = malloc(myBlockSize * sizeof(Sample)); ! for(curSample = 0; curSample < myBlockSize; curSample++) ! { ! theData[curChannel][curSample] = sin((M_PI * 2) * ((float)curSample * myFrequency / mySampleRate)) * amplitude; - // theData[curChannel][curSample] = (float)((curSample * 65537) % 19) / 19.0; } } --- 191,202 ---- if(myOwner == nil) return self; ! theData = malloc(myBlockSize * myChannelCount * sizeof(Sample)); ! ! for(curChannel = 0; curChannel < myChannelCount; curChannel++) { ! for(curSample = 0; curSample < myBlockSize; curSample++) { ! theData[(curSample * myChannelCount) + curChannel] ! = sin((M_PI * 2) * ((float)curSample * myFrequency / mySampleRate)) * amplitude; } } *************** *** 207,214 **** fromSampler: self]; ! for(curChannel = 0; curChannel < myChannelCount; curChannel++) ! { ! free(theData[curChannel]); ! } return self; --- 206,210 ---- fromSampler: self]; ! free(theData); return self; |