diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voice.cpp	Mon Jan 23 16:46:37 2012 +0000
@@ -0,0 +1,50 @@
+/*
+ *  Voice.cpp
+ *  MelodyTriangle
+ *
+ *  Created by Henrik Ekeus on 12/01/2012.
+ *  Copyright 2012 Queen Mary University of London. All rights reserved.
+ *
+ */
+
+#include "Voice.h"
+
+Voice::Voice(int id, int x, int y){
+	this->id=id;
+	posx=x;
+	posy=y;
+	isActive=true;
+	radius=15;
+	inTriangle=false;
+	octave=0;
+	highlight=false;
+}
+
+Voice::Voice(){}
+
+void Voice::draw(){
+	ofSetColor(255,0,0);
+	
+	if (isActive){
+		
+		ofFill();
+	}else {
+		ofNoFill();
+	}
+	ofCircle(posx, posy, radius);
+	if (highlight){
+		ofNoFill();
+		ofSetColor(255, 255, 255);
+		ofCircle(posx, posy, radius);
+	}
+}
+
+bool Voice::isInVoice(int x, int y){
+	if (ofDist(x, y, posx, posy)<=radius){
+		return true;
+	}else {
+		return false;
+	}
+
+}
+