diff testApp.mm @ 32:ab7c86d0f3d8

V0.3 SZBeta sent out. bristol tests.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 08 Mar 2013 14:54:55 +0000
parents c0a6f7c66719
children 92dba082d957
line wrap: on
line diff
--- a/testApp.mm	Fri Mar 01 13:28:45 2013 +0000
+++ b/testApp.mm	Fri Mar 08 14:54:55 2013 +0000
@@ -128,6 +128,12 @@
     // GO
     paused = false;
 
+    randomise(); // everyone starts from random position
+    
+    ofxiPhoneExternalDisplay::mirrorOn();
+    
+    double timemsd = [NSDate timeIntervalSinceReferenceDate];
+    cout << "TIME: " << timemsd << '\n';
     
 }
 
@@ -221,12 +227,11 @@
 void testApp::questionnaireHidden(vector<int> answers, const char* userComments){
     // send answers to server as json
     eventLogger.questionnaireAnswersObtained(answers, userComments);
+
+    // tell bottomtabviewcontroller to show and select both interface
+    interfaceSelected(BOTH);
+    [bottomTabViewController show:(id)this withSelection:1];
     
-    // set "we've done questionnaire" to true in event logger
-
-    whichInterfaceShowing = BOTH;
-    // tell bottomtabviewcontroller
-    [bottomTabViewController show:(id)this withSelection:1];
 
 }
 //--------------------------------------------------------------
@@ -255,6 +260,9 @@
         presetManager.clearAll();
         // show username prompt
         [usernameAlertViewController showUserNamePrompt];
+        // reset top buttons
+        [topButtonViewController unlockAll];
+        randomise();
     }
     // no unOK
 }
@@ -434,10 +442,24 @@
 
     if(paused) return;
     
+    if(ofxiPhoneExternalDisplay::isExternalScreenConnected()){
+        if(!ofxiPhoneExternalDisplay::isMirroring()){
+            ofxiPhoneExternalDisplay::mirrorOn();
+            printf("turned on Mirroring!\n");
+        }
+    }
+    
     // continiue to move or zoom at velocity, unless snapped
     
     if (numActiveTouches == 0){ // no touches, use momentum
-
+        // ZOOM MOMENTUM
+        // continiue to zoom at velocity
+        if (numActiveTouches < 2 && abs(zoomVel)>0.001){
+            theGridView.zoom(zoomVel + 1.0); // +1 because zoomVel factor is + or - , wheras zoom is a multiplier near 1
+            zoomVel = zoomVel*slowFactor;
+            moveVel.setCoord(0.0,0.0);; // don't move if zooming! Too many events!
+        }
+        
         if(moveVel.norm() > 0.3){
             if(theGridView.snapped){
                 // stop it (snap check sends snap event)
@@ -459,14 +481,11 @@
         }else{
             // stopped - do nothing
         }
+        
+
 
     }
-    // ZOOM MOMENTUM
-    // continiue to zoom at velocity
-    if (numActiveTouches < 2 && abs(zoomVel)>0.001){
-        theGridView.zoom(zoomVel + 1.0); // +1 because zoomVel factor is + or - , wheras zoom is a multiplier near 1 
-        zoomVel = zoomVel*slowFactor;
-    }
+
 
 }
 //--------------------------------------------------------------
@@ -524,6 +543,8 @@
     if(touch.id == 0){
         touch0.setCoord(touch.x,touch.y);
         prevTouch0 = touch0;
+        // stop zoom
+        zoomVel = 0.0;
     }else if(touch.id == 1){
         
         touch1.setCoord(touch.x,touch.y);