Skip to content

Commit

Permalink
appears to be working
Browse files Browse the repository at this point in the history
  • Loading branch information
BlindElephants committed Mar 3, 2016
1 parent b6e224a commit a06c291
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 85 deletions.
158 changes: 94 additions & 64 deletions Field_Cuts_6_SCORE.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.

This file was deleted.

1 change: 1 addition & 0 deletions addons.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ofxAnimatable
ofxGaussian
ofxGui
ofxNetwork
ofxOsc
Expand Down
34 changes: 34 additions & 0 deletions src/fc_scoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fc_scoreManager::fc_scoreManager() {
c.triggerAtTime = currentTime;

int _t = (int)ofRandom(3);

if(_t == 0) {
c.targetName = MEG;
} else if(_t == 1) {
Expand All @@ -44,6 +45,9 @@ fc_scoreManager::fc_scoreManager() {
} else if(_sd == 1){
c.sourceDevice = PACK;
}



}
}

Expand All @@ -66,4 +70,34 @@ void fc_scoreManager::draw(float _x, float _y, float _w, float _h) {
ofDrawRectangle(_x, _y, ofMap(scoreTimer, 0, scoreLength, 0, _w), _h);

font.drawString(ofToString(scoreTimer) + " / " + ofToString(scoreLength), _x + 8, _y + _h + 16);
}

void fc_scoreManager::addConditionInOrder(conditionEvent _c) {
if(conditionEvents.size() == 0) {
conditionEvents.push_back(_c);
} else if(_c.triggerAtTime > conditionEvents[conditionEvents.size()-1].triggerAtTime) {
conditionEvents.push_back(_c);
} else {
for(int i = 0 ; i < conditionEvents.size() ; i ++ ) {
if(_c.triggerAtTime > conditionEvents[i].triggerAtTime) {
conditionEvents.insert(conditionEvents.begin() + (i + 1), _c);
break;
}
}
}
}

void fc_scoreManager::addTriggerLimitingEventInOrder(triggerLimitingEvent _t) {
if(triggerLimitingEvents.size() == 0) {
triggerLimitingEvents.push_back(_t);
} else if(_t.triggerAtTime > triggerLimitingEvents[triggerLimitingEvents.size() - 1].triggerAtTime) {
triggerLimitingEvents.push_back(_t);
} else {
for(int i = 0 ; i < triggerLimitingEvents.size() ; i ++ ) {
if(_t.triggerAtTime > triggerLimitingEvents[i].triggerAtTime) {
triggerLimitingEvents.insert(triggerLimitingEvents.begin() + (i + 1), _t);
break;
}
}
}
}
48 changes: 32 additions & 16 deletions src/fc_scoreManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,18 @@
#define fc_scoreManager_hpp

#include "ofMain.h"
#include "ofxGaussian.h"

#include "fc_condition.hpp"
#include "fc_performer.hpp"

enum DeviceType {
WRIST, PACK
};


class fc_scoreManager {
public:
fc_scoreManager();

void toggleRun();
void update();
void draw(float _x, float _y, float _w, float _h);

void makeConditionEventRandom();
void makeConditionEventRandomAbs();
void makeConditionEventRandomDel();


private:
bool runScore;
float scoreTimer = 0;
float scoreLength = 60 * 35;
ofTrueTypeFont font;

struct conditionEvent {
float triggerAtTime;
Expand All @@ -55,8 +42,37 @@ class fc_scoreManager {
float setRecovery;
};

fc_scoreManager();

void toggleRun();
void update();
void draw(float _x, float _y, float _w, float _h);

// void makeConditionEventRandom();
// void makeConditionEventRandomAbs();
// void makeConditionEventRandomDel();
//
// void addConditionEventToScore(conditionEvent _c);
// void addTriggerLimitingEventToScore(triggerLimitingEvent _t);

void addConditionInOrder(conditionEvent _c);
void addTriggerLimitingEventInOrder(triggerLimitingEvent _t);


private:
bool runScore;
float scoreTimer = 0;
float scoreLength = 60 * 35;
ofTrueTypeFont font;



struct

vector < conditionEvent > conditionEvents;
vector < triggerLimitingEvent > triggerLimitingEvents;


};

#endif /* fc_scoreManager_hpp */

0 comments on commit a06c291

Please sign in to comment.