diff SearchMessageOrganiser.h @ 9:d5e928887f51

More refactoring. Mode for Synth value changes only sent to PD on triggering sound.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 17 Oct 2014 17:50:41 +0100
parents d59de9fd3496
children e25d2b1b185e
line wrap: on
line diff
--- a/SearchMessageOrganiser.h	Fri Oct 17 16:35:22 2014 +0100
+++ b/SearchMessageOrganiser.h	Fri Oct 17 17:50:41 2014 +0100
@@ -15,331 +15,12 @@
 class SearchMessageOrganiser : public MessageOrganiser {
 
 public:
-    
-
-
-protected:
-    
-    
-    TimeController altPlaybackController;
-    
-    TestController* testController;
-    Buttron* newTestButton;
-    //Buttron* submitButton;
-    
-    ButtonPanel* bottomPanel; // shows during test : play buttons and submit
-    Buttron* targetPlayButton; // so we can hide target in memory test. this pointer stuff is getting out of hand
-    CountdownText* countdownPanel;
-    TargetSymbol* targetSymbol;
-    Leap3DBoxGL* box3D;
-    TextPanel* scorePanel;
-    TextPanel* finishPanel;
-    AppModeChangeFunction testAppModeChange;
-    
-    //int scoreRunningTotal;
-    TimerID currentSoundPlayTimer;
-    
-    int alternationSpeed; // ms between cand and target
-    bool playingAlternating;
-    
-    bool okToGetLeapMidi;
-    
-    
-// protected methods
-    void testsFinished(){
-        panel->hide();
-        bottomPanel->hide();
-        newTestButton->hide();
-        
-        vector<int> eData;
-        eData.push_back(testController->getScoreRunningTotal());
-        eventLogger.logEvent(ALL_TESTS_COMPLETED, eData);
-        
-        // TODO set final score screen txt to testController->getScoreRunningTotal()
-        finishPanel->show();
-        
-        string user = eventLogger.getUsername();
-        stringstream s;
-        s << "Experiment completed"
-        << endl << endl
-        << "You scored: " << testController->getScoreRunningTotal() << " well done " << user << endl << endl
-        << "to retake test please close " << endl << endl
-        <<   "the app and restart with username<num test>";
-        finishPanel->setText(s.str());
-        // get test app to do something...
-        
-        eventLogger.saveSessionToFile();
-    };
-    
-    void setupNewTest(){
-        // get mapping for new test and make sure we have right controls and stuff
-        
-        
-        Test newTest = testController->goToNextTest();
-        
-        // V0.2 put details about what kind of test it is
-        vector<int> eData;
-        eData.push_back(newTest.isPractice());
-        eData.push_back(newTest.isWithHint());
-        eData.push_back(newTest.isMemoryTest());
-        eventLogger.logEvent(NEW_TEST, eData);
-        
-        
-        vector<int> mappingIDsForChangeableParams = setSynthsUpForNewTest(newTest);
-        
-        vector<UIElement*> UIElemHandles = panel->generateControls(testController->getCurrentListOfControls(), testController->getCurrentPanelType());
-        
-        mapUIToNewTestParams(UIElemHandles, mappingIDsForChangeableParams);
-        
-        countdownPanel->setTestTypeString(newTest.getTestTypeAdvanceWarning());
-        
-        
-    };
-    void startNewTest(){
-        Test t = testController->getCurrentTest();
-        
-        countdownPanel->hide();
-        panel->show();
-        panel->setActive(true);
-        if(t.isWithHint()){
-            panel->showHint(true);
-        }
-        
-        bottomPanel->show();
-        targetPlayButton->show(); // incase it was memory test
-        if (t.isMemoryTest()){
-            targetPlayButton->setLabel("Memorise!");
-        }else{
-            targetPlayButton->setLabel("Target");
-        }
-        //startAlternatingPlayback();
-        //timeController.scheduleEvent(boost::bind(&MessageOrganiser::sendSynthValuesAgain, this), 200);
-        timeController.startStopwatch();
-        eventLogger.logEvent(TEST_TIMER_STARTED);
-        
-        
-        if(t.getListOfControlTypes()[0] == LEAP3D){
-            okToGetLeapMidi = true;
-        }
-    };
-    
-    vector<int> setSynthsUpForNewTest(Test newTest){
-        targetSynth.setAllParams(newTest.getTargetValues());
-        eventLogger.logEvent(TARGET_PARAM_SET, newTest.getTargetValues()); // unless something goes wrong in setAllParams
-        
-        candidateSynth.setAllParams(newTest.getStartingCandidateValues());
-        eventLogger.logEvent(CANDIDATE_PARAM_SET,newTest.getStartingCandidateValues());
-        
-        // eventLogger.logEvent(NEW_TARGET_PARAMS, vector<int> );
-        // eventLogger.logEvent(NEW_CANDIDATE_PARAMS, vector<int> );
-        
-        vector<int> mids = candidateSynth.getMappingIDForIndices(newTest.getChangeableIndices());
-        
-        eventLogger.logEvent(CANDIDATE_CHANGEABLE_IDX, newTest.getChangeableIndices());
-        eventLogger.logEvent(CANDIDATE_MAPPING_IDS, mids);
-        
-        return mids;
-    };
-    
-    
-    // could have been cleverer. takes forever due to searching ???
-    void mapUIToNewTestParams(vector<UIElement*> elems, vector<int> mids){
-        
-        vector<UIElement*>::iterator elit;
-        vector<int> typeListLog;
-        int i = 0;
-        for(elit=elems.begin(); elit<elems.end();elit++){
-            if ( (*elit)->getType() == XYPAD){
-                if(i+1 >= mids.size()){
-                    cout << "ERROR ERROR: too many controls for mapping IDs" << endl;
-                }
-                
-                ButtronXY* theXY = (ButtronXY*)(*elit);
-                mapXYToParams(theXY, mids[i], mids[i+1]);
-                theXY->setValueAndScale(candidateSynth.getParamValueForID(mids[i]), candidateSynth.getParamValueForID(mids[i+1]));
-                theXY->setHintValue(targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i]))
-                                    ,targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i+1])));
-                i+=2;
-                typeListLog.push_back(int(XYPAD));
-            }else if ( (*elit)->getType() == SLIDER){
-                if(i >= mids.size()){
-                    
-                    cout << "ERROR ERROR: too many controls for mapping IDs: " << mids.size() << endl;
-                }
-                
-                ButtronSlider* theSlider = (ButtronSlider*)(*elit);
-                mapControlToParam((*elit), mids[i]);
-                theSlider->setValueAndScale(candidateSynth.getParamValueForID(mids[i]));
-                cout << "Hint Value " << targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i])) << endl;
-                theSlider->setHintValue(targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i])));
-                i++;
-                typeListLog.push_back(int(SLIDER));
-            }else if ( (*elit)->getType() == LEAP3D ){
-                set3Dbox((Leap3DBoxGL*)(*elit));
-                // UH
-                string nameX = candidateSynth.getNameForMappingID(mids[i]);
-                box3D->setHintValue(0,targetSynth.getParamValueFromName(nameX));
-                box3D->setValueAndScale(0, candidateSynth.getParamValueForID(mids[i]));
-                i++;
-                
-                string nameY = candidateSynth.getNameForMappingID(mids[i]);
-                box3D->setHintValue(1,targetSynth.getParamValueFromName(nameY));
-                box3D->setValueAndScale(1, candidateSynth.getParamValueForID(mids[i]));
-                i++;
-                
-                string nameZ = candidateSynth.getNameForMappingID(mids[i]);
-                box3D->setHintValue(2,targetSynth.getParamValueFromName(nameZ));
-                box3D->setValueAndScale(2, candidateSynth.getParamValueForID(mids[i]));
-                i++;
-                
-                
-                box3D->setLabels(nameX,nameY,nameZ);
-                typeListLog.push_back(int(LEAP3D));
-                
-            }else{
-                cout << "ERROR ERROR: ui type not handled my mapping function !" << endl;
-            }
-        }
-        
-        eventLogger.logEvent(CONTROL_LIST,typeListLog);
-    };
-    
-    // TODO - no, triggering playback needs to be logged
-    void startAlternatingPlayback(){
-        
-        cout << "start alt playback" << endl;
-        // use our special timer to fire off play to pd
-        // sets off timed alternating playback
-        
-        playAlternating();
-        playingAlternating = true;
-        
-    };
-    void stopAlternatingPlayback(){
-        cout << "stop alt playback" << endl;
-        // kill the alternation
-        timeController.cancelEvent(currentSoundPlayTimer);
-        playingAlternating = false;
-    };
-    
-    void playAlternating(){
-        
-        static bool alt;
-        int nextTime;
-        if (alt){
-            targetSynth.trigger();
-            // flash the target thingy
-            targetSymbol->flash();
-            nextTime = alternationSpeed*1.503; // gap after target
-        }else{
-            sendSynthValuesAgain(); // and again and again
-            candidateSynth.trigger();
-            panel->flash();
-            nextTime = alternationSpeed;
-        }
-        alt = !alt;
-        candidateSynth.setNoteLength(alternationSpeed);
-        targetSynth.setNoteLength(alternationSpeed); // could be user alterable
-        currentSoundPlayTimer = timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::playAlternating,this), nextTime);
-        
-        
-        
-    };
-    
-    void delayedShowNewTest(){
-        newTestButton->show();
-        // JUST IN CASE IT CRASHES near end...
-        //eventLogger.saveSessionToFile();
-    };
-    void submitSingleControl(){
-        // if last one
-        // submitPressed()
-        
-        // else
-        
-        // grey out that slider,
-        // activate next slider and show it's button (same button but moved!???)
-        
-    };
-    
-    
-    void submitPressed(){
-        
-        // depending on mode go to next control
-        //        if(testController->getCurrentPanelType() == SEQUENTIAL){
-        //            submitSingleControl();
-        //            return;
-        //        }
-        // otherwise do this other  - or call
-        
-        okToGetLeapMidi = false;
-        
-        TimerMillisec timeTaken = timeController.stopStopwatch();
-        vector<int> answer = candidateSynth.getAllParamValues();
-        
-        eventLogger.logEvent(SUBMIT_PRESSED, answer); //, answer, scoreRunningTotal, time taken (why not?));
-        
-        TestResult result = testController->submitAnswer(answer, timeTaken); // TODO returns all the results
-        
-        vector<int> logResult;
-        logResult.push_back(result.realDistanceToTarget*1000); // measured in milliCC !??!
-        logResult.push_back(result.timeTaken); // milliseconds
-        logResult.push_back(result.score);
-        logResult.push_back(result.targetBandHit);
-        logResult.push_back(result.timeWindowHit);
-        
-        eventLogger.logEvent(DISTANCE_TIME_SCORE, logResult);
-        
-        
-        // gui stuff - different controller?
-        panel->setActive(false);
-        panel->showHint(true); // add some encouraging feedback to hint
-        bottomPanel->hide();
-        
-        showScoreForTest(result);
-        
-        stopAlternatingPlayback();
-        
-        // was it the final sumbit?
-        if(testController->isLastTest()){
-            // thats it - show a final score screen etc
-            timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::testsFinished, this), 500);
-            return;
-        }else{
-            timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::delayedShowNewTest, this), 300);
-        }
-        
-        
-    };
-    
-    void showScoreForTest(TestResult result){
-        scorePanel->setText(result.displayText);
-        scorePanel->show();
-        
-        ofColor c;
-        if(result.targetBandHit == 1){
-            // yellow red blue
-            c = ofColor(255,255,0,255);
-        }else if(result.targetBandHit == 2){
-            c = ofColor(255,0,0,255);
-        }else if(result.targetBandHit == 3){
-            c = ofColor(45,45,255,255);
-        }else if(result.targetBandHit == 4){
-            c = ofColor(0,255,0,255);
-        }else{
-            c = ofColor(150,235,200,255);
-        }
-        scorePanel->setColor(c);
-        panel->setHintColor(c);
-    };
-    
-public:
     void init( PDSynthWrapper& cs, PDSynthWrapper& ts){
         
         testController = new TestController;
         
         MessageOrganiser::init(cs,ts);
-
+        
         currentSoundPlayTimer = -1;
         okToGetLeapMidi = false;
         
@@ -385,13 +66,8 @@
     void set3Dbox(Leap3DBoxGL* box){
         box3D = box;
     };
-    void setBottomPanel(ButtonPanel * ntb){
-        bottomPanel = ntb;
-    };
-    void setControlPanel(SliderPanel* p){
-        panel = p;
-        
-    };
+
+    
     void setCountdownPanel(CountdownText* cd){
         countdownPanel = cd;
     };
@@ -435,7 +111,7 @@
         timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::startNewTest, this), 3000);
         
     };
-
+    
     void playTargetButtonPressed(){
         
         static int numPlays = 3;
@@ -459,9 +135,7 @@
         
         return;
     }
-    void playCandidateButtonPressed(){
-        //
-    }
+
     void buttonPressCallback(int mappingID, int value){
         if(mappingID == VOLUME_CHANGE_ID){
             targetSynth.sendVolume(value);
@@ -487,7 +161,7 @@
             }
             return;
         }
-
+        
         if (mappingID == RANDOMISE_TARGET_ID){ // bleyeueurrrr
             targetSynth.randomiseParams();
             return;
@@ -568,15 +242,6 @@
         }
     }
     // called from UI
-    // OVERLOADED
-    void paramChangeCallback(int mappingID, int value){
-        candidateSynth.paramChangeCallback(mappingID, value);
-        vector<int> evtData;
-        evtData.push_back(mappingID); // or just index?
-        evtData.push_back(value);
-        
-        eventLogger.logEvent(CANDIDATE_PARAM_ADJUSTED, evtData);
-    };
     
     
     void midiFromLeap(int ctl_num, int ctl_val){
@@ -601,12 +266,325 @@
         evtData.push_back(ctl_val);
         
         eventLogger.logEvent(CANDIDATE_PARAM_ADJUSTED, evtData);
-
+        
     }
-
+    
     
     ofTrueTypeFont verdBig;
 
+
+protected:
+    
+    
+    TimeController altPlaybackController;
+    
+    TestController* testController;
+    Buttron* newTestButton;
+    //Buttron* submitButton;
+    
+
+    Buttron* targetPlayButton; // so we can hide target in memory test. this pointer stuff is getting out of hand
+    CountdownText* countdownPanel;
+    TargetSymbol* targetSymbol;
+    Leap3DBoxGL* box3D;
+    TextPanel* scorePanel;
+    TextPanel* finishPanel;
+    AppModeChangeFunction testAppModeChange;
+    
+    //int scoreRunningTotal;
+    TimerID currentSoundPlayTimer;
+    
+    int alternationSpeed; // ms between cand and target
+    bool playingAlternating;
+    
+    bool okToGetLeapMidi;
+    
+    
+// protected methods
+    void testsFinished(){
+        panel->hide();
+        bottomPanel->hide();
+        newTestButton->hide();
+        
+        vector<int> eData;
+        eData.push_back(testController->getScoreRunningTotal());
+        eventLogger.logEvent(ALL_TESTS_COMPLETED, eData);
+        
+        // TODO set final score screen txt to testController->getScoreRunningTotal()
+        finishPanel->show();
+        
+        string user = eventLogger.getUsername();
+        stringstream s;
+        s << "Experiment completed"
+        << endl << endl
+        << "You scored: " << testController->getScoreRunningTotal() << " well done " << user << endl << endl
+        << "to retake test please close " << endl << endl
+        <<   "the app and restart with username<num test>";
+        finishPanel->setText(s.str());
+        // get test app to do something...
+        
+        eventLogger.saveSessionToFile();
+    };
+    
+    void setupNewTest(){
+        // get mapping for new test and make sure we have right controls and stuff
+        
+        
+        Test newTest = testController->goToNextTest();
+        
+        // V0.2 put details about what kind of test it is
+        vector<int> eData;
+        eData.push_back(newTest.isPractice());
+        eData.push_back(newTest.isWithHint());
+        eData.push_back(newTest.isMemoryTest());
+        eventLogger.logEvent(NEW_TEST, eData);
+        
+        
+        vector<int> mappingIDsForChangeableParams = setSynthsUpForNewTest(newTest);
+        
+        vector<UIElement*> UIElemHandles = panel->generateControls(testController->getCurrentListOfControls(), testController->getCurrentPanelType());
+        
+        mapUIToNewTestParams(UIElemHandles, mappingIDsForChangeableParams);
+        
+        countdownPanel->setTestTypeString(newTest.getTestTypeAdvanceWarning());
+        
+        
+    };
+    void startNewTest(){
+        Test t = testController->getCurrentTest();
+        
+        countdownPanel->hide();
+        panel->show();
+        panel->setActive(true);
+        if(t.isWithHint()){
+            panel->showHint(true);
+        }
+        
+        bottomPanel->show();
+        targetPlayButton->show(); // incase it was memory test
+        if (t.isMemoryTest()){
+            targetPlayButton->setLabel("Memorise!");
+        }else{
+            targetPlayButton->setLabel("Target");
+        }
+
+        timeController.startStopwatch();
+        eventLogger.logEvent(TEST_TIMER_STARTED);
+        
+        
+        if(t.getListOfControlTypes()[0] == LEAP3D){
+            okToGetLeapMidi = true;
+        }
+    };
+    
+    vector<int> setSynthsUpForNewTest(Test newTest){
+        targetSynth.setAllParams(newTest.getTargetValues());
+        eventLogger.logEvent(TARGET_PARAM_SET, newTest.getTargetValues()); // unless something goes wrong in setAllParams
+        
+        candidateSynth.setAllParams(newTest.getStartingCandidateValues());
+        eventLogger.logEvent(CANDIDATE_PARAM_SET,newTest.getStartingCandidateValues());
+
+        vector<int> mids = candidateSynth.getMappingIDForIndices(newTest.getChangeableIndices());
+        
+        eventLogger.logEvent(CANDIDATE_CHANGEABLE_IDX, newTest.getChangeableIndices());
+        eventLogger.logEvent(CANDIDATE_MAPPING_IDS, mids);
+        
+        return mids;
+    };
+    
+    
+    // could have been cleverer. takes forever due to searching ???
+    void mapUIToNewTestParams(vector<UIElement*> elems, vector<int> mids){
+        
+        vector<UIElement*>::iterator elit;
+        vector<int> typeListLog;
+        int i = 0;
+        for(elit=elems.begin(); elit<elems.end();elit++){
+            if ( (*elit)->getType() == XYPAD){
+                if(i+1 >= mids.size()){
+                    cout << "ERROR ERROR: too many controls for mapping IDs" << endl;
+                }
+                
+                ButtronXY* theXY = (ButtronXY*)(*elit);
+                mapXYToParams(theXY, mids[i], mids[i+1]);
+                theXY->setValueAndScale(candidateSynth.getParamValueForID(mids[i]), candidateSynth.getParamValueForID(mids[i+1]));
+                theXY->setHintValue(targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i]))
+                                    ,targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i+1])));
+                i+=2;
+                typeListLog.push_back(int(XYPAD));
+            }else if ( (*elit)->getType() == SLIDER){
+                if(i >= mids.size()){
+                    
+                    cout << "ERROR ERROR: too many controls for mapping IDs: " << mids.size() << endl;
+                }
+                
+                ButtronSlider* theSlider = (ButtronSlider*)(*elit);
+                mapControlToParam((*elit), mids[i]);
+                theSlider->setValueAndScale(candidateSynth.getParamValueForID(mids[i]));
+                cout << "Hint Value " << targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i])) << endl;
+                theSlider->setHintValue(targetSynth.getParamValueFromName(candidateSynth.getNameForMappingID(mids[i])));
+                i++;
+                typeListLog.push_back(int(SLIDER));
+            }else if ( (*elit)->getType() == LEAP3D ){
+                set3Dbox((Leap3DBoxGL*)(*elit));
+                // UH
+                string nameX = candidateSynth.getNameForMappingID(mids[i]);
+                box3D->setHintValue(0,targetSynth.getParamValueFromName(nameX));
+                box3D->setValueAndScale(0, candidateSynth.getParamValueForID(mids[i]));
+                i++;
+                
+                string nameY = candidateSynth.getNameForMappingID(mids[i]);
+                box3D->setHintValue(1,targetSynth.getParamValueFromName(nameY));
+                box3D->setValueAndScale(1, candidateSynth.getParamValueForID(mids[i]));
+                i++;
+                
+                string nameZ = candidateSynth.getNameForMappingID(mids[i]);
+                box3D->setHintValue(2,targetSynth.getParamValueFromName(nameZ));
+                box3D->setValueAndScale(2, candidateSynth.getParamValueForID(mids[i]));
+                i++;
+                
+                
+                box3D->setLabels(nameX,nameY,nameZ);
+                typeListLog.push_back(int(LEAP3D));
+                
+            }else{
+                cout << "ERROR ERROR: ui type not handled my mapping function !" << endl;
+            }
+        }
+        
+        eventLogger.logEvent(CONTROL_LIST,typeListLog);
+    };
+    
+    // TODO - no, triggering playback needs to be logged
+    void startAlternatingPlayback(){
+        
+        cout << "start alt playback" << endl;
+        // use our special timer to fire off play to pd
+        // sets off timed alternating playback
+        
+        playAlternating();
+        playingAlternating = true;
+        
+    };
+    void stopAlternatingPlayback(){
+        cout << "stop alt playback" << endl;
+        // kill the alternation
+        timeController.cancelEvent(currentSoundPlayTimer);
+        playingAlternating = false;
+    };
+    
+    void playAlternating(){
+        
+        static bool alt;
+        int nextTime;
+        if (alt){
+            targetSynth.trigger();
+            // flash the target thingy
+            targetSymbol->flash();
+            nextTime = alternationSpeed*1.503; // gap after target
+        }else{
+            sendSynthValuesAgain(); // and again and again
+            candidateSynth.trigger();
+            panel->flash();
+            nextTime = alternationSpeed;
+        }
+        alt = !alt;
+        candidateSynth.setNoteLength(alternationSpeed);
+        targetSynth.setNoteLength(alternationSpeed); // could be user alterable
+        currentSoundPlayTimer = timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::playAlternating,this), nextTime);
+        
+        
+        
+    };
+    
+    void delayedShowNewTest(){
+        newTestButton->show();
+        // JUST IN CASE IT CRASHES near end...
+        //eventLogger.saveSessionToFile();
+    };
+    void submitSingleControl(){
+        // if last one
+        // submitPressed()
+        
+        // else
+        
+        // grey out that slider,
+        // activate next slider and show it's button (same button but moved!???)
+        
+    };
+    
+    
+    void submitPressed(){
+        
+        // depending on mode go to next control
+        //        if(testController->getCurrentPanelType() == SEQUENTIAL){
+        //            submitSingleControl();
+        //            return;
+        //        }
+        // otherwise do this other  - or call
+        
+        okToGetLeapMidi = false;
+        
+        TimerMillisec timeTaken = timeController.stopStopwatch();
+        vector<int> answer = candidateSynth.getAllParamValues();
+        
+        eventLogger.logEvent(SUBMIT_PRESSED, answer); //, answer, scoreRunningTotal, time taken (why not?));
+        
+        TestResult result = testController->submitAnswer(answer, timeTaken); // TODO returns all the results
+        
+        vector<int> logResult;
+        logResult.push_back(result.realDistanceToTarget*1000); // measured in milliCC !??!
+        logResult.push_back(result.timeTaken); // milliseconds
+        logResult.push_back(result.score);
+        logResult.push_back(result.targetBandHit);
+        logResult.push_back(result.timeWindowHit);
+        
+        eventLogger.logEvent(DISTANCE_TIME_SCORE, logResult);
+        
+        
+        // gui stuff - different controller?
+        panel->setActive(false);
+        panel->showHint(true); // add some encouraging feedback to hint
+        bottomPanel->hide();
+        
+        showScoreForTest(result);
+        
+        stopAlternatingPlayback();
+        
+        // was it the final sumbit?
+        if(testController->isLastTest()){
+            // thats it - show a final score screen etc
+            timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::testsFinished, this), 500);
+            return;
+        }else{
+            timeController.scheduleEvent(boost::bind(&SearchMessageOrganiser::delayedShowNewTest, this), 300);
+        }
+        
+        
+    };
+    
+    void showScoreForTest(TestResult result){
+        scorePanel->setText(result.displayText);
+        scorePanel->show();
+        
+        ofColor c;
+        if(result.targetBandHit == 1){
+            // yellow red blue
+            c = ofColor(255,255,0,255);
+        }else if(result.targetBandHit == 2){
+            c = ofColor(255,0,0,255);
+        }else if(result.targetBandHit == 3){
+            c = ofColor(45,45,255,255);
+        }else if(result.targetBandHit == 4){
+            c = ofColor(0,255,0,255);
+        }else{
+            c = ofColor(150,235,200,255);
+        }
+        scorePanel->setColor(c);
+        panel->setHintColor(c);
+    };
+ 
+
 };
 
 #endif /* defined(__riftathon__SearchMessageOrganiser__) */