
#ifndef  _MIDI_VIZ_GEOMETRIZER_H_
#define  _MIDI_VIZ_GEOMETRIZER_H_

#include <GL/gl.h>
#include <math.h>
#include "MidiEvent.h"
#include <iostream>

#include "NoteColorLookupTable.h"

using namespace std;

#define MV_PI 3.1428571
#define MV_PI_RAD  MV_PI/180.0

class MidiVizGeometrizer {

public:
        
        MidiVizGeometrizer();
        ~MidiVizGeometrizer();

	void drawAll();
        void drawAllFigures();
        void drawAllVolumoids();
        void drawCircle(float scale); // scale between 0 and 1
        void drawFigure();
        void drawVolumoid();
        void frame();

        void processMidiEvent(MidiEvent event);
        void setActiveColor(int activeNoteIndex);
	
	void setPosition(float x, float y, float z ){
	  position[0] = x;
	  position[1] = y;
	  position[2] = z;
	}
	
	void setRotation(float x, float y, float z){
	  rotation[0] = x;
	  rotation[1] = y;
	  rotation[2] = z;
	}
	
	void setScale(float x, float y, float z){
	  scale[0] = x;
	  scale[1] = y;
	  scale[2] = z;
	}

private:
        int numNotes;
        int numOctaves;
        float noteValues[128];
        float keyTotals[12];
        float octaveTotals[12];
        int highNote, lowNote;

        int activeNotes[128];
        NoteColorLookupTable note_color_table;                          

        float activeColor[3];

        float angle[3];
        float deltaAngle[3];
        
        float noteAngles[128][2];
        float deltaNoteAngles[128][2];
        
	float position[3];
	float rotation[3];
	float scale[3];
	
	float rotate_angle_delta[3];
	float rotate_angle[3];


};

#endif


