diff MessageOrganiser.h @ 16:2da0350a4aa2

expMessageOrganiser and express/explore view setup.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 21 Oct 2014 18:06:44 +0100
parents f83635861187
children 2a7320a8cbed
line wrap: on
line diff
--- a/MessageOrganiser.h	Tue Oct 21 16:52:56 2014 +0100
+++ b/MessageOrganiser.h	Tue Oct 21 18:06:44 2014 +0100
@@ -31,7 +31,7 @@
 #include "CountdownText.h"
 #include "buttonPanel.h"
 #include "ExplorePresetManager.h"
-
+#include "IconPanel.h"
 
 // should be called TIMED TEST MESSAGE ORGANISER ?
 
@@ -80,12 +80,40 @@
     void setBottomPanel(ButtonPanel * ntb){
         bottomPanel = ntb;
     };
+    
+    
+    void setIconPanel(IconPanel * ip){
+        presetIconPanel = ip;
+    }
+    void setInstructionPanel(TextPanel * ip){
+        instructionPanel = ip;
+        instructionPanel->show();
+    }
+
+    
+    //-----------------------------------------------------------------------------
+    void hideMyPanels(){
+        presetIconPanel->hide();
+        instructionPanel->hide();
+        bottomPanel->hide();
+        panel->hide();
+    }
+    void showMyPanels(){
+        presetIconPanel->show();
+        instructionPanel->show();
+        bottomPanel->show();
+        panel->show();
+    }
 protected:
 
     PDSynthWrapper candidateSynth;
     PDSynthWrapper targetSynth;
     ButtonPanel* bottomPanel; // shows during test : play buttons and submit
     SliderPanel* panel;
+    
+    IconPanel* presetIconPanel;
+    TextPanel* instructionPanel;
+    
     map<int,UIElement*> currentMapping; // could get more sophisticated if not 1-1 ?
     
 
@@ -156,6 +184,36 @@
         control->setLabel(candidateSynth.getNameForMappingID(mappingID));
     };
     
+    //-----------------------------------------------------------------------------
+    
+    void mapSlidersToParams(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() == 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{
+                cout << "ERROR ERROR: ui type not handled my mapping function !" << endl;
+            }
+        }
+        
+        eventLogger.logEvent(CONTROL_LIST,typeListLog);
+    };
+    
     void mapXYToParams(ButtronXY* control, int mappingIDX, int mappingIDY){
         UICallbackFunction callback;