comparison 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
comparison
equal deleted inserted replaced
17:21eb7b7a5dc0 18:9a414ea6880d
19 radius=12; 19 radius=12;
20 inTriangle=false; 20 inTriangle=false;
21 octave=0; 21 octave=0;
22 highlight=false; 22 highlight=false;
23 amplitude=0.6; 23 amplitude=0.6;
24 status=clear;
24 } 25 }
25 26
26 void Voice::draw(){ 27 void Voice::draw(){
27 ofSetColor(200,0,0); 28 int r,g,b;
29 switch (status) {
30 case clear: r=1; g=0; b=0; break;
31 default: r=1; g=1; b=0; break;
32 // case pending: r=1; g=1; b=0; break;
33 // case waiting: r=1; g=0; b=0; break;
34 // case moved: r=1; g=0; b=1; break;
35 // default: r=0; g=1; b=0;
36 }
28 37
29 if (isActive){ 38 if (isActive) { r=2*r; g=2*g; b=2*b; }
30 ofFill(); 39 ofSetColor(100*r,40*g,60*b);
40 ofFill();
41 ofCircle(posx, posy, radius);
42 //ofNoFill();
43 //ofCircle(posx, posy, radius);
44
45 if (highlight) {
46 ofSetColor(230, 230, 230);
47 ofNoFill();
48 ofCircle(posx, posy, radius);
31 } else { 49 } else {
32 ofNoFill(); 50 ofNoFill();
51 ofCircle(posx, posy, radius);
33 } 52 }
34 ofCircle(posx, posy, radius);
35 if (highlight) ofSetColor(255, 192, 192);
36 ofNoFill();
37 ofCircle(posx, posy, radius);
38 } 53 }
39 54
40 double Voice::louder() { return amplitude=min(1,amplitude*1.125); } 55 double Voice::louder() { return amplitude=min(1,amplitude*1.125); }
41 double Voice::quieter() { return amplitude/=1.125; } 56 double Voice::quieter() { return amplitude/=1.125; }
42 57