comparison Voice.cpp @ 0:2db9be889344

Initial Commit
author Henrik Ekeus <hekeus@eecs.qmul.ac.uk>
date Mon, 23 Jan 2012 16:46:37 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2db9be889344
1 /*
2 * Voice.cpp
3 * MelodyTriangle
4 *
5 * Created by Henrik Ekeus on 12/01/2012.
6 * Copyright 2012 Queen Mary University of London. All rights reserved.
7 *
8 */
9
10 #include "Voice.h"
11
12 Voice::Voice(int id, int x, int y){
13 this->id=id;
14 posx=x;
15 posy=y;
16 isActive=true;
17 radius=15;
18 inTriangle=false;
19 octave=0;
20 highlight=false;
21 }
22
23 Voice::Voice(){}
24
25 void Voice::draw(){
26 ofSetColor(255,0,0);
27
28 if (isActive){
29
30 ofFill();
31 }else {
32 ofNoFill();
33 }
34 ofCircle(posx, posy, radius);
35 if (highlight){
36 ofNoFill();
37 ofSetColor(255, 255, 255);
38 ofCircle(posx, posy, radius);
39 }
40 }
41
42 bool Voice::isInVoice(int x, int y){
43 if (ofDist(x, y, posx, posy)<=radius){
44 return true;
45 }else {
46 return false;
47 }
48
49 }
50