hekeus@0: /* hekeus@0: * Voice.cpp hekeus@0: * MelodyTriangle hekeus@0: * hekeus@0: * Created by Henrik Ekeus on 12/01/2012. hekeus@0: * Copyright 2012 Queen Mary University of London. All rights reserved. hekeus@0: * hekeus@0: */ hekeus@0: hekeus@0: #include "Voice.h" hekeus@0: hekeus@0: Voice::Voice(int id, int x, int y){ hekeus@0: this->id=id; hekeus@0: posx=x; hekeus@0: posy=y; hekeus@0: isActive=true; hekeus@0: radius=15; hekeus@0: inTriangle=false; hekeus@0: octave=0; hekeus@0: highlight=false; hekeus@0: } hekeus@0: hekeus@0: Voice::Voice(){} hekeus@0: hekeus@0: void Voice::draw(){ hekeus@0: ofSetColor(255,0,0); hekeus@0: hekeus@0: if (isActive){ hekeus@0: hekeus@0: ofFill(); hekeus@0: }else { hekeus@0: ofNoFill(); hekeus@0: } hekeus@0: ofCircle(posx, posy, radius); hekeus@0: if (highlight){ hekeus@0: ofNoFill(); hekeus@0: ofSetColor(255, 255, 255); hekeus@0: ofCircle(posx, posy, radius); hekeus@0: } hekeus@0: } hekeus@0: hekeus@0: bool Voice::isInVoice(int x, int y){ hekeus@0: if (ofDist(x, y, posx, posy)<=radius){ hekeus@0: return true; hekeus@0: }else { hekeus@0: return false; hekeus@0: } hekeus@0: hekeus@0: } hekeus@0: