#include "testApp.h"

//--------------------------------------------------------------

void testApp::setup(){	 
	
	ofBackground(255,255,255);
	printf("testApp::setup\n");

	sphinxController.sphinxSetup("sphinx_use_wsj.cfg", 44100, 0);
	
}

//--------------------------------------------------------------
void testApp::draw(){
	
	
	//theo - recognise some commands
	//theo - and do some silly stuff!
	
	string temp = current;
	
	if(temp.size() > 90)
	temp.erase(temp.begin(), temp.begin()+1);
	
	ofSetColor(0x000000);
	ofDrawBitmapString(temp, 10, 10);
	
}


//-------------------------------------------------------------
void testApp::decoded(string hypothesis) {
	current = hypothesis;
}

//-------------------------------------------------------------
void testApp::keyPressed(int key){
	if(key == 's'){
		sphinxController.bRecordAudio = true;
	}
}

void testApp::keyReleased(int key){}
void testApp::mouseMoved(int x, int y ){}
void testApp::mouseDragged(int x, int y, int button){}
void testApp::mousePressed(int x, int y, int button){}
void testApp::mouseReleased(){}
