Mercurial > hg > wabletios
comparison scanpath.mm @ 1:1d1bf0aac99e
This version was the first submitted to the app store.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Thu, 22 Nov 2012 12:15:19 +0000 |
parents | c667dfe12d47 |
children | d346ddc50f70 |
comparison
equal
deleted
inserted
replaced
0:c667dfe12d47 | 1:1d1bf0aac99e |
---|---|
140 //---------------------------------------------------------------- | 140 //---------------------------------------------------------------- |
141 void ScanPath::updateWavetables(){ | 141 void ScanPath::updateWavetables(){ |
142 // swap old , new | 142 // swap old , new |
143 double * temp; | 143 double * temp; |
144 | 144 |
145 // TODO THRED MUTEX HERE!?? | |
146 | |
145 switch(scanMode){ | 147 switch(scanMode){ |
146 case DISPLACEMENT: | 148 case DISPLACEMENT: |
147 // now fill with new values | 149 // now fill with new values |
148 for(int i = 0; i < numElements; i++){ | 150 for(int i = 0; i < numElements; i++){ |
149 | 151 |
169 default: | 171 default: |
170 break; | 172 break; |
171 | 173 |
172 | 174 |
173 } | 175 } |
176 | |
177 // END THREAD MUTEX | |
174 | 178 |
175 // reset the interp between frames | 179 // reset the interp between frames |
176 if(audioAccessing){ | 180 if(audioAccessing){ |
177 cout << "buffers swapped while update!\n"; | 181 cout << "buffers swapped while update!\n"; |
178 } | 182 } |
205 | 209 |
206 audioAccessing = true; | 210 audioAccessing = true; |
207 if (updateAccessing){ | 211 if (updateAccessing){ |
208 cout << "update is accessing while audio is\n"; | 212 cout << "update is accessing while audio is\n"; |
209 } | 213 } |
214 | |
215 // TODO THRED MUTEX HERE!?? | |
216 | |
210 double oldsample = (1 - frac) * wavetableOld[n0] + frac * wavetableOld[n1]; | 217 double oldsample = (1 - frac) * wavetableOld[n0] + frac * wavetableOld[n1]; |
211 | 218 |
212 double newsample = (1 - frac) * wavetableNew[n0] + frac * wavetableNew[n1]; | 219 double newsample = (1 - frac) * wavetableNew[n0] + frac * wavetableNew[n1]; |
213 | 220 |
221 // END THREAD MUTEX | |
214 audioAccessing = false; | 222 audioAccessing = false; |
215 | 223 |
216 frameInterpolator += framesPerSample; | 224 frameInterpolator += framesPerSample; |
217 if(frameInterpolator >= 1.0){ | 225 if(frameInterpolator >= 1.0){ |
218 //cout << "frame interp > 1\n"; | 226 //cout << "frame interp > 1\n"; |