We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af48f6c commit 8b5a7e4Copy full SHA for 8b5a7e4
src/AudioTools/Buffers.h
@@ -257,6 +257,21 @@ class RingBuffer : public BaseBuffer<T> {
257
return _aucBuffer[_iTail];
258
}
259
260
+ virtual int peekArray(T*data, int n){
261
+ if (isEmpty()) return -1;
262
+ int result = 0;
263
+ int count = _numElems;
264
+ int tail = _iTail;
265
+ for (int j=0;j<n;j++){
266
+ data[j] = _aucBuffer[tail];
267
+ tail = nextIndex(tail);
268
+ count--;
269
+ result++;
270
+ if (count==0)break;
271
+ }
272
+ return result;
273
274
+
275
// checks if the buffer is full
276
virtual bool isFull() { return available() == max_size; }
277
0 commit comments