From: Paul Brossier Date: Sun, 25 Oct 2015 00:34:41 +0000 (+0200) Subject: src/ofxAubioBlock.*: add toSend / received() X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=dde1f0d2b102aafb09c3ee893911417c274afacb;p=ofxAubio.git src/ofxAubioBlock.*: add toSend / received() --- diff --git a/src/ofxAubioBlock.cpp b/src/ofxAubioBlock.cpp index 8679e99..adcc3a6 100644 --- a/src/ofxAubioBlock.cpp +++ b/src/ofxAubioBlock.cpp @@ -54,3 +54,12 @@ void ofxAubioBlock::audioIn(float * input, int bufferSize, int nChannels) } } } + +bool ofxAubioBlock::received() +{ + if (toSend) { + toSend = false; + return true; + } + return false; +} diff --git a/src/ofxAubioBlock.h b/src/ofxAubioBlock.h index 2d21ebd..7e13c82 100644 --- a/src/ofxAubioBlock.h +++ b/src/ofxAubioBlock.h @@ -34,6 +34,9 @@ class ofxAubioBlock { void cleanup(); virtual void blockAudioIn() {}; + bool toSend = false; + public: void audioIn(float *input, int bufferSize, int nChannels); + bool received(); };