changeset 20:1e6d4ece1572

intro screen with mode options. seems to work.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 22 Oct 2014 16:47:11 +0100
parents bd23c1b922be
children 5cf2b80909fc
files IntroViewController.mm IntroViewController.xib UI code/IconPanel.mm testApp.h testApp.mm
diffstat 5 files changed, 68 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/IntroViewController.mm	Wed Oct 22 16:29:31 2014 +0100
+++ b/IntroViewController.mm	Wed Oct 22 16:47:11 2014 +0100
@@ -39,6 +39,15 @@
     self.theOFAppRef = theOFApp;
     
 }
+- (IBAction)enterExpMode:(id)sender {
+    ((testApp *)self.theOFAppRef)->introHidden(1);
+}
+- (IBAction)enterTrainMode:(id)sender {
+    ((testApp *)self.theOFAppRef)->introHidden(2);
+}
+- (IBAction)enterSearchMode:(id)sender {
+    ((testApp *)self.theOFAppRef)->introHidden(3);
+}
 
 - (IBAction)show:(id)sender
 {
@@ -48,14 +57,14 @@
 - (IBAction)hide:(id)sender
 {
     self.view.hidden = YES;
-    ((testApp *)self.theOFAppRef)->introHidden();
+    
     
 }
 - (IBAction)disagree:(id)sender
 {
     // shut down the app
     self.view.hidden = YES;
-    ((testApp *)self.theOFAppRef)->introHidden();
+    ((testApp *)self.theOFAppRef)->introHidden(0);
 }
 - (void)dealloc {
     [_text release];
--- a/IntroViewController.xib	Wed Oct 22 16:29:31 2014 +0100
+++ b/IntroViewController.xib	Wed Oct 22 16:47:11 2014 +0100
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4514" systemVersion="12F45" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="5056" systemVersion="14A389" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
     <dependencies>
         <deployment defaultVersion="1280" identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="IntroViewController">
@@ -17,20 +17,44 @@
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <subviews>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="4">
-                    <rect key="frame" x="454" y="643" width="116" height="44"/>
+                    <rect key="frame" x="328" y="626" width="154" height="61"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                    <state key="normal" title="AGREE" backgroundImage="buttron.png">
+                    <state key="normal" title="EXP" backgroundImage="buttron.png">
                         <color key="titleColor" red="0.28581259671449843" green="0.80918817934782605" blue="0.73026968770868927" alpha="1" colorSpace="calibratedRGB"/>
                         <color key="titleShadowColor" red="0.0" green="0.79530400815217395" blue="0.77655573399798061" alpha="1" colorSpace="calibratedRGB"/>
                     </state>
                     <connections>
+                        <action selector="enterExpMode:" destination="-1" eventType="touchUpInside" id="CrH-pf-5B1"/>
                         <action selector="hide:" destination="-1" eventType="touchUpInside" id="55"/>
                     </connections>
                 </button>
-                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" lineBreakMode="tailTruncation" numberOfLines="39" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="14">
+                <button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="WDx-XU-GHx">
+                    <rect key="frame" x="510" y="626" width="142" height="61"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                    <state key="normal" title="TRAIN" backgroundImage="buttron.png">
+                        <color key="titleColor" red="0.28581259669999998" green="0.80918817929999998" blue="0.7302696877" alpha="1" colorSpace="calibratedRGB"/>
+                        <color key="titleShadowColor" red="0.0" green="0.79530400820000002" blue="0.776555734" alpha="1" colorSpace="calibratedRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="enterTrainMode:" destination="-1" eventType="touchUpInside" id="ptd-it-odB"/>
+                        <action selector="hide:" destination="-1" eventType="touchUpInside" id="097-DM-YsD"/>
+                    </connections>
+                </button>
+                <button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="ngS-Bg-YOQ">
+                    <rect key="frame" x="679" y="626" width="152" height="61"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                    <state key="normal" title="SEARCH" backgroundImage="buttron.png">
+                        <color key="titleColor" red="0.28581259669999998" green="0.80918817929999998" blue="0.7302696877" alpha="1" colorSpace="calibratedRGB"/>
+                        <color key="titleShadowColor" red="0.0" green="0.79530400820000002" blue="0.776555734" alpha="1" colorSpace="calibratedRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="enterSearchMode:" destination="-1" eventType="touchUpInside" id="uD3-wA-ZcD"/>
+                        <action selector="hide:" destination="-1" eventType="touchUpInside" id="pSz-nO-BgA"/>
+                    </connections>
+                </button>
+                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Welcome to RIFTATHON." lineBreakMode="tailTruncation" numberOfLines="39" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="14">
                     <rect key="frame" x="158" y="-139" width="773" height="735"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                    <mutableString key="text">Welcome to the "Tweakathon". This will test your ability to tweak the controls of a synthesiser to achieve a desired sound. Your task is to find a sound that matches a target sound as accurately and as quickly as possible, using a variety of different control methods. The target and you current sound will play repeatedly. The second sound changes as you tweak the controls. When you match the sounds as well as you can, press submit. You will then see how far you were from the correct settings, and be given a score based on the time you took and how far away from the target you were. 
There will be more and more controls as the test progresses, therefore it will become harder to find the target sound. You actions will be logged and sent to a server at Queen Mary University for analysis. If you agree to this, click "Agree" button to start the test.</mutableString>
                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                     <color key="textColor" red="0.72194573409571561" green="1" blue="0.83094137152153613" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
@@ -51,4 +75,4 @@
     <resources>
         <image name="buttron.png" width="150" height="60"/>
     </resources>
-</document>
\ No newline at end of file
+</document>
--- a/UI code/IconPanel.mm	Wed Oct 22 16:29:31 2014 +0100
+++ b/UI code/IconPanel.mm	Wed Oct 22 16:47:11 2014 +0100
@@ -56,7 +56,7 @@
 void IconPanel::drawTick(){
     ofPoint pos(x + width - 25, y + height - 25);
     ofSetColor(0, 200, 20);
-    ofSetLineWidth(2);
+    ofSetLineWidth(3);
     ofLine(pos.x, pos.y, pos.x+8, pos.y+10);
     ofLine(pos.x+8, pos.y+10, pos.x+10, pos.y+8);
 }
@@ -64,7 +64,7 @@
 void IconPanel::drawCross(){
     ofPoint pos(x + width - 25, y + height - 25);
     ofSetColor(230, 0, 20);
-    ofSetLineWidth(2);
+    ofSetLineWidth(3);
     ofLine(pos.x, pos.y, pos.x+10, pos.y+10);
     ofLine(pos.x+10, pos.y, pos.x, pos.y+10);
 }
--- a/testApp.h	Wed Oct 22 16:29:31 2014 +0100
+++ b/testApp.h	Wed Oct 22 16:47:11 2014 +0100
@@ -116,7 +116,7 @@
     void questionnaireHidden(vector<int> answers,  const char* userComments);
 
     void showIntro();
-    void introHidden();
+    void introHidden(int mode);
     void usernameEntered();
     void startTheSearchTests();
     void startTheTrainingTests();
--- a/testApp.mm	Wed Oct 22 16:29:31 2014 +0100
+++ b/testApp.mm	Wed Oct 22 16:47:11 2014 +0100
@@ -56,7 +56,7 @@
             
         }else{
             // then we're in timed session mode
-            showIntro();
+            [usernameAlertViewController showUserNamePrompt];
         }
     }
     paused = false;
@@ -386,7 +386,8 @@
 
 //--------------------------------------------------------------
 void testApp::showIntro(){
-    
+    // display a thing that gives us an option as to which stage to start
+    // EXPLORE, PERFORMANCE TRAINING, SEARCH
     cout << "SHOW INTRO\n";
 
     introViewController	= [[IntroViewController alloc] initWithNibName:@"IntroViewController" bundle:nil];
@@ -399,20 +400,33 @@
     
 }
 //--------------------------------------------------------------
-void testApp::introHidden(){
+//void testApp::introHidden(){
+//    eventLogger.consentGiven = true;
+//    eventLogger.logEvent(INTRO_CONSENTED);
+//    [usernameAlertViewController showUserNamePrompt];
+//    // after prompt goes it calls usernameEntered()
+//}
+//--------------------------------------------------------------
+void testApp::introHidden(int mode){
     eventLogger.consentGiven = true;
     eventLogger.logEvent(INTRO_CONSENTED);
-    [usernameAlertViewController showUserNamePrompt];
-    // after prompt goes it calls usernameEntered()
+    
+    if(mode == 1){
+        startTheExpTests();
+    }else if(mode == 2){
+        startTheTrainingTests();
+    }else if(mode == 3){
+        startTheSearchTests();
+    }
+    
 }
+//--------------------------------------------------------------
+void testApp::usernameEntered(){
 
-void testApp::usernameEntered(){
-    // display a thing that gives us an option as to which stage to start
-    // EXPLORE, PERFORMANCE TRAINING, SEARCH
     eventLogger.onUsernameEntered();
     expPresetManager.onAppLoad();
     
-    startTheExpTests();
+    showIntro();
     
 }
 //--------------------------------------------------------------