Mercurial > hg > screen-ui
diff src/Voice.cpp @ 18:9a414ea6880d
Added colour coding of voice status.
author | samer |
---|---|
date | Tue, 31 Jan 2012 15:49:40 +0000 |
parents | 9e31c0507e65 |
children | 055d7524bae4 |
line wrap: on
line diff
--- a/src/Voice.cpp Tue Jan 31 12:52:42 2012 +0000 +++ b/src/Voice.cpp Tue Jan 31 15:49:40 2012 +0000 @@ -21,20 +21,35 @@ octave=0; highlight=false; amplitude=0.6; + status=clear; } void Voice::draw(){ - ofSetColor(200,0,0); + int r,g,b; + switch (status) { + case clear: r=1; g=0; b=0; break; + default: r=1; g=1; b=0; break; +// case pending: r=1; g=1; b=0; break; +// case waiting: r=1; g=0; b=0; break; +// case moved: r=1; g=0; b=1; break; +// default: r=0; g=1; b=0; + } - if (isActive){ - ofFill(); + if (isActive) { r=2*r; g=2*g; b=2*b; } + ofSetColor(100*r,40*g,60*b); + ofFill(); + ofCircle(posx, posy, radius); + //ofNoFill(); + //ofCircle(posx, posy, radius); + + if (highlight) { + ofSetColor(230, 230, 230); + ofNoFill(); + ofCircle(posx, posy, radius); } else { ofNoFill(); + ofCircle(posx, posy, radius); } - ofCircle(posx, posy, radius); - if (highlight) ofSetColor(255, 192, 192); - ofNoFill(); - ofCircle(posx, posy, radius); } double Voice::louder() { return amplitude=min(1,amplitude*1.125); }