annotate src/Voice.h @ 25:f4ebb87adec1

Added code to keep track of true position of voices in information space; Two voice drawing methods display both true position target position while dragging; string to Voice::status code no longer required; refactored OSC message sending code; added keys to control subdivision ratio for period and shift controls.
author samer
date Sun, 05 Feb 2012 18:13:30 +0000
parents 460c05dd74d0
children 06a2fdb333ca
rev   line source
hekeus@6 1 /*
hekeus@6 2 * Voice.h
hekeus@6 3 * MelodyTriangle
hekeus@6 4 *
hekeus@6 5 * Created by Henrik Ekeus on 12/01/2012.
hekeus@6 6 * Copyright 2012 Queen Mary University of London. All rights reserved.
hekeus@6 7 *
hekeus@6 8 */
hekeus@6 9 #include "ofMain.h"
samer@23 10 #define RADIUS 12
samer@23 11
hekeus@6 12 class Voice {
hekeus@6 13 public:
samer@22 14 Voice(int id);
hekeus@6 15
samer@18 16 enum status {
samer@18 17 clear,
samer@18 18 pending,
samer@18 19 waiting,
samer@18 20 moved
samer@18 21 };
samer@23 22
samer@23 23 bool isInVoice(int x, int y) { return (ofDist(x, y, posx, posy)<=RADIUS); };
samer@23 24 //void setPos(int x, int y) { posx=x; posy=y; status=pending; }
samer@13 25 double louder();
samer@13 26 double quieter();
samer@23 27 void draw(bool highlight);
samer@25 28 void draw_alt(bool highlight);
hekeus@6 29
samer@25 30 int id;
samer@25 31 int posx,posy;
samer@25 32 bool isActive;
samer@25 33 bool inTriangle;
samer@25 34 int octave;
samer@13 35 double amplitude;
samer@25 36 enum status status;
samer@25 37 float truex, truey;
hekeus@6 38 };