comparison src/Voice.cpp @ 32:06a2fdb333ca

Added visibilty control for tokens; removed token highlight when keyboard disabled.
author samer
date Wed, 15 Feb 2012 10:14:04 +0000
parents 417deb31dd4e
children
comparison
equal deleted inserted replaced
31:417deb31dd4e 32:06a2fdb333ca
10 #include "Voice.h" 10 #include "Voice.h"
11 11
12 inline static double min(double x,double y) { return (x<y) ? x : y; } 12 inline static double min(double x,double y) { return (x<y) ? x : y; }
13 13
14 Voice::Voice(int id): 14 Voice::Voice(int id):
15 isActive(true), inTriangle(false), octave(0), amplitude(0.5), 15 isActive(true), inTriangle(false), isVisible(true),
16 status(pending), id(id), posx(0), posy(0), truex(-1), truey(-1) {} 16 octave(0), amplitude(0.5), status(pending), id(id),
17 posx(0), posy(0), truex(-1), truey(-1) {}
17 18
18 void Voice::draw(bool highlight){ 19 void Voice::draw(bool highlight){
20 if (!isVisible) return;
21
19 int r,g,b; 22 int r,g,b;
20 switch (status) { 23 switch (status) {
21 case clear: r=1; g=1; b=0; break; 24 case clear: r=1; g=1; b=0; break;
22 default: r=1; g=0; b=0; break; 25 default: r=1; g=0; b=0; break;
23 } 26 }
32 ofFill(); 35 ofFill();
33 ofCircle(posx, posy, RADIUS); 36 ofCircle(posx, posy, RADIUS);
34 ofNoFill(); 37 ofNoFill();
35 if (highlight) ofSetColor(230, 230, 230); 38 if (highlight) ofSetColor(230, 230, 230);
36 ofCircle(posx, posy, RADIUS); 39 ofCircle(posx, posy, RADIUS);
37
38 } 40 }
39 41
40 void Voice::draw_alt(bool highlight){ 42 void Voice::draw_alt(bool highlight){
43 if (!isVisible) return;
44
41 int r,g,b; 45 int r,g,b;
42 switch (status) { 46 switch (status) {
43 case clear: r=1; g=1; b=0; break; 47 case clear: r=1; g=1; b=0; break;
44 default: r=1; g=0; b=0; break; 48 default: r=1; g=0; b=0; break;
45 } 49 }