Mercurial > hg > soniczoomios
comparison 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 |
comparison
equal
deleted
inserted
replaced
31:23ef179c3748 | 32:ab7c86d0f3d8 |
---|---|
126 } | 126 } |
127 setAllGUISliders(theGridView.getParams()); | 127 setAllGUISliders(theGridView.getParams()); |
128 // GO | 128 // GO |
129 paused = false; | 129 paused = false; |
130 | 130 |
131 randomise(); // everyone starts from random position | |
132 | |
133 ofxiPhoneExternalDisplay::mirrorOn(); | |
134 | |
135 double timemsd = [NSDate timeIntervalSinceReferenceDate]; | |
136 cout << "TIME: " << timemsd << '\n'; | |
131 | 137 |
132 } | 138 } |
133 | 139 |
134 | 140 |
135 //-------------------------------------------------------------- | 141 //-------------------------------------------------------------- |
219 } | 225 } |
220 //-------------------------------------------------------------- | 226 //-------------------------------------------------------------- |
221 void testApp::questionnaireHidden(vector<int> answers, const char* userComments){ | 227 void testApp::questionnaireHidden(vector<int> answers, const char* userComments){ |
222 // send answers to server as json | 228 // send answers to server as json |
223 eventLogger.questionnaireAnswersObtained(answers, userComments); | 229 eventLogger.questionnaireAnswersObtained(answers, userComments); |
224 | 230 |
225 // set "we've done questionnaire" to true in event logger | 231 // tell bottomtabviewcontroller to show and select both interface |
226 | 232 interfaceSelected(BOTH); |
227 whichInterfaceShowing = BOTH; | |
228 // tell bottomtabviewcontroller | |
229 [bottomTabViewController show:(id)this withSelection:1]; | 233 [bottomTabViewController show:(id)this withSelection:1]; |
234 | |
230 | 235 |
231 } | 236 } |
232 //-------------------------------------------------------------- | 237 //-------------------------------------------------------------- |
233 void testApp::showIntro(){ | 238 void testApp::showIntro(){ |
234 | 239 |
253 // | 258 // |
254 // clear presets? | 259 // clear presets? |
255 presetManager.clearAll(); | 260 presetManager.clearAll(); |
256 // show username prompt | 261 // show username prompt |
257 [usernameAlertViewController showUserNamePrompt]; | 262 [usernameAlertViewController showUserNamePrompt]; |
263 // reset top buttons | |
264 [topButtonViewController unlockAll]; | |
265 randomise(); | |
258 } | 266 } |
259 // no unOK | 267 // no unOK |
260 } | 268 } |
261 //-------------------------------------------------------------- | 269 //-------------------------------------------------------------- |
262 // called from BottomTabViewController iOS segmented thing | 270 // called from BottomTabViewController iOS segmented thing |
432 //-------------------------------------------------------------- | 440 //-------------------------------------------------------------- |
433 void testApp::update(){ | 441 void testApp::update(){ |
434 | 442 |
435 if(paused) return; | 443 if(paused) return; |
436 | 444 |
445 if(ofxiPhoneExternalDisplay::isExternalScreenConnected()){ | |
446 if(!ofxiPhoneExternalDisplay::isMirroring()){ | |
447 ofxiPhoneExternalDisplay::mirrorOn(); | |
448 printf("turned on Mirroring!\n"); | |
449 } | |
450 } | |
451 | |
437 // continiue to move or zoom at velocity, unless snapped | 452 // continiue to move or zoom at velocity, unless snapped |
438 | 453 |
439 if (numActiveTouches == 0){ // no touches, use momentum | 454 if (numActiveTouches == 0){ // no touches, use momentum |
440 | 455 // ZOOM MOMENTUM |
456 // continiue to zoom at velocity | |
457 if (numActiveTouches < 2 && abs(zoomVel)>0.001){ | |
458 theGridView.zoom(zoomVel + 1.0); // +1 because zoomVel factor is + or - , wheras zoom is a multiplier near 1 | |
459 zoomVel = zoomVel*slowFactor; | |
460 moveVel.setCoord(0.0,0.0);; // don't move if zooming! Too many events! | |
461 } | |
462 | |
441 if(moveVel.norm() > 0.3){ | 463 if(moveVel.norm() > 0.3){ |
442 if(theGridView.snapped){ | 464 if(theGridView.snapped){ |
443 // stop it (snap check sends snap event) | 465 // stop it (snap check sends snap event) |
444 moveVel.setCoord(0.0,0.0); | 466 moveVel.setCoord(0.0,0.0); |
445 }else{ | 467 }else{ |
457 eventLogger.logEvent(SCROLL_STOPPED, theGridView.getCoord() ); | 479 eventLogger.logEvent(SCROLL_STOPPED, theGridView.getCoord() ); |
458 | 480 |
459 }else{ | 481 }else{ |
460 // stopped - do nothing | 482 // stopped - do nothing |
461 } | 483 } |
462 | 484 |
463 } | 485 |
464 // ZOOM MOMENTUM | 486 |
465 // continiue to zoom at velocity | 487 } |
466 if (numActiveTouches < 2 && abs(zoomVel)>0.001){ | 488 |
467 theGridView.zoom(zoomVel + 1.0); // +1 because zoomVel factor is + or - , wheras zoom is a multiplier near 1 | |
468 zoomVel = zoomVel*slowFactor; | |
469 } | |
470 | 489 |
471 } | 490 } |
472 //-------------------------------------------------------------- | 491 //-------------------------------------------------------------- |
473 void testApp::sendOSCParams(){ | 492 void testApp::sendOSCParams(){ |
474 | 493 |
522 preventingMovePostScroll = false; | 541 preventingMovePostScroll = false; |
523 | 542 |
524 if(touch.id == 0){ | 543 if(touch.id == 0){ |
525 touch0.setCoord(touch.x,touch.y); | 544 touch0.setCoord(touch.x,touch.y); |
526 prevTouch0 = touch0; | 545 prevTouch0 = touch0; |
546 // stop zoom | |
547 zoomVel = 0.0; | |
527 }else if(touch.id == 1){ | 548 }else if(touch.id == 1){ |
528 | 549 |
529 touch1.setCoord(touch.x,touch.y); | 550 touch1.setCoord(touch.x,touch.y); |
530 prevTouch1 = touch1; | 551 prevTouch1 = touch1; |
531 | 552 |