Skip to content

Commit

Permalink
Merge branch 'master' of github.com:HalfdanJ/PeopleCounter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Jongejan committed Jun 12, 2011
2 parents 33f7195 + dae1901 commit 3cc6434
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
25 changes: 15 additions & 10 deletions PeopleCounterServer/src/gui.cpp
Expand Up @@ -12,12 +12,18 @@ void Gui::setup(){
playAudio = 1;
addPerson = 1;

gui.addTitle("Analyzer");

gui.addTitle("Debug");
gui.addButton("Add person", addPerson);


gui.addTitle("Analyzer").setNewColumn(true);
gui.addSlider("Depth threshold", depthThreshold, 0, 255);
gui.addSlider("Blur", blur, 0, 30);//.setNewColumn(true);
gui.addSlider("Merge distance", analyzerMergeDist,0,100);
gui.addSlider("Blur", blur, 0, 30);
gui.addSlider("Merge distance", analyzerMergeDist,0,100);
gui.addSlider("Blob min size", minBlobSize,0,640*480);
gui.addSlider("Blob max size", maxBlobSize,0,640*480);
gui.addSlider("Blob max size", maxBlobSize,0,640*480).setNewColumn(true);


gui.addTitle("Clients").setNewColumn(true);
for(int i=0;i<NUM_CLIENTS;i++){
Expand All @@ -27,7 +33,11 @@ void Gui::setup(){
gui.addSlider("Client"+ofToString(i)+"OffsetY", clientOffsetY[i], -100, 100);//.setNewColumn(true);

}


gui.addPage("Speech synth");
gui.addToggle("Play audio", playAudio);


gui.addPage("Cropping");
topCrop = 0;
gui.addSlider("ClientTopCrop", topCrop, 0, 640);//.setNewColumn(true);
Expand All @@ -41,11 +51,6 @@ void Gui::setup(){
gui.addSlider("Client"+ofToString(i)+"RightCrop", rightCrop[i], 0, 640);//.setNewColumn(true);
}

gui.addTitle("Speech synth").setNewColumn(true);
gui.addToggle("Play audio", playAudio);

gui.addButton("Add person", addPerson);

gui.loadFromXML();
gui.show();
}
Expand Down
29 changes: 18 additions & 11 deletions PeopleCounterServer/src/synth.cpp
@@ -1,5 +1,9 @@
#include "synth.h"


string welcomeMsg[4] = { " Hi jerk" , " I love you!", " Didn't think I would see you here", " Welcome to Roskilde Festival" };


void Synth::setup(Analyzer * analyzeRef, Gui * guiRef){

analyzer = analyzeRef;
Expand All @@ -9,14 +13,10 @@ void Synth::setup(Analyzer * analyzeRef, Gui * guiRef){

synth.initSynthesizer();

string messages[] = {"Welcome to Roskilde Festival",
"Hi jerk", "Hi you, remember me?",
"I love you!",
"Didn't think I would see you again."};


voices = synth.getListOfVoices();

lastMsgTime = -10;

if(voices.size() > 0)
{
std::map<std::string, int>::iterator iter;
Expand All @@ -26,21 +26,28 @@ void Synth::setup(Analyzer * analyzeRef, Gui * guiRef){
}
}

analyzer->count += 1;

}

void Synth::update(){

if (analyzer->count > count) {

diff = analyzer->count - count;
count = analyzer->count;

say("hi visitor number" + ofToString(count), "Whisper");
if (ofGetElapsedTimef() - lastMsgTime > 3) {
// wait for old msg to finish

count = analyzer->count;
// + welcomeMsg[2]

say("Hi visitor number" + ofToString(count), "Whisper");

lastMsgTime = ofGetElapsedTimef();
}



}

}


Expand Down
6 changes: 5 additions & 1 deletion PeopleCounterServer/src/synth.h
Expand Up @@ -18,8 +18,12 @@ class Synth {

map< string, int > voices;

float lastMsgTime;

vector< string > messages;
int shortmsgtime;
int longmsgtime;

string message;

int count;
int diff;
Expand Down

0 comments on commit 3cc6434

Please sign in to comment.