Mercurial > hg > screen-ui
view src/Voice.cpp @ 12:317637282293
Compressed keyboard handling code, added calibration key 'c'.
author | samer |
---|---|
date | Mon, 30 Jan 2012 00:00:15 +0000 |
parents | a8f71b5bdb0e |
children | 9e31c0507e65 |
line wrap: on
line source
/* * 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=12; inTriangle=false; octave=0; highlight=false; } Voice::Voice(){} void Voice::draw(){ ofSetColor(200,0,0); if (isActive){ ofFill(); } else { ofNoFill(); } ofCircle(posx, posy, radius); if (highlight) ofSetColor(255, 192, 192); ofNoFill(); ofCircle(posx, posy, radius); } bool Voice::isInVoice(int x, int y){ if (ofDist(x, y, posx, posy)<=radius){ return true; }else { return false; } }