From 93048304a2e9be1dcc1dbd400b06472c6519f912 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 15 Nov 2022 23:45:11 +0000 Subject: remove the comments --- audioin/src/ofApp.h | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'audioin/src') diff --git a/audioin/src/ofApp.h b/audioin/src/ofApp.h index 3ac6b39..8965aef 100644 --- a/audioin/src/ofApp.h +++ b/audioin/src/ofApp.h @@ -22,37 +22,7 @@ public: if (data){ //delete[] data; //why is this throwing an error } - } -/* -if the size is 1000 and the num is 600 -1st frame: writePoint=0 -memcpy(&data[0],input,min(600,1000-0)) --> we copied the whole 600 starting at 0 and ending at 599 -2nd frame: writePoint=600 -memcpy(&data[600],input, min(600,1000-600)) --> we copied 400 starting at 600 and ending at 999 -yes (1000-600<600) - so - memcpy(data,&input[1000-600],600-(1000-600)) - -> we copied 200 starting at input:400 and ending at 599 to the start of data - writePoint=600-(1000-600) -3rd frame: writePoint=200 -memcpy(&data[200],input, min(600,1000-200)) --> we copied the whole 600 starting at 200 and ending at 799 -4th frame: writePoint=800 -memcpy(&data[800],input, min(600,1000-800)) --> we copied 200 starting at 800 and ending at 999 -yes (1000-800<600) - so - memcpy(data,&input[1000-800],600-(1000-800)) - -> we copied 400 starting at input:200 and ending at 599 to the start of data - writePoint=600-(1000-800) -5th frame: writePoint=400 -memcpy(&data[400],input, min(600,1000-400)) --> we copied the whole 600 starting at 400 and ending at 999 - -back to square one. 5*600=3000 -*/ + } void add(float * input, int num){ memcpy(&data[writePoint],input,min(num,size-writePoint)*sizeof(float)); if (size-writePoint this should be data[0] !? -800: return data[1000-(800-800)->1000] -> this should be data[999] -*/ float operator [] (int i) const { return data[(writePoint>i?writePoint-i:size-(i-writePoint))-1]; } -- cgit v1.2.3