Mercurial > hg > opencollidoscope
diff CollidoscopeApp/include/Oscilloscope.h @ 2:dd889fff8423
added some comments
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Mon, 11 Jul 2016 17:03:40 +0200 |
parents | 02467299402e |
children | 75b744078d66 |
line wrap: on
line diff
--- a/CollidoscopeApp/include/Oscilloscope.h Fri Jul 08 11:39:18 2016 +0200 +++ b/CollidoscopeApp/include/Oscilloscope.h Mon Jul 11 17:03:40 2016 +0200 @@ -4,16 +4,28 @@ #include "DrawInfo.h" + + +/** + * The oscilloscope that oscillates when Collidoscope is played + */ class Oscilloscope { public: + /** + * Constructor, accepts as argument the number of points that make up the oscilloscope line + */ Oscilloscope( size_t numPoints ): mNumPoints( numPoints ), mLine( std::vector<ci::vec2>( numPoints, ci::vec2() ) ) {} + /** + * Sets the value of a point of the oscilloscope. The value is passed as an audio coordinate [-1.0, 1.0]. + * A reference to DrawInfo is passed to calculate the graphic coordinate of the point based on the audio value passed. + */ void setPoint( int index, float audioVal, const DrawInfo &di ){ if ( audioVal > 1.0f ){ @@ -45,6 +57,9 @@ } + /** + * Draws this oscilloscope as a cinder::PolyLine2f + */ void draw() { ci::gl::color(1.0f, 1.0f, 1.0f);