[dasher: 5/21] Disable auto-speed-control during slow-startup



commit ef619f1a13afc0de0653f6db1d9d8434627983ad
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Thu Jul 7 16:43:18 2011 +0100

    Disable auto-speed-control during slow-startup
    
    As this gives a misleading impression of user's ability to cope at full speed

 Src/DasherCore/DefaultFilter.cpp             |    6 ++++--
 Src/iPhone/Classes/CDasherInterfaceBridge.mm |    8 ++++----
 Src/iPhone/Classes/IPhoneFilters.h           |    4 ++--
 Src/iPhone/Classes/IPhoneFilters.mm          |   10 +++++-----
 Src/iPhone/Dasher.xcodeproj/project.pbxproj  |    6 ++++++
 5 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/Src/DasherCore/DefaultFilter.cpp b/Src/DasherCore/DefaultFilter.cpp
index 7194a92..63ab85a 100644
--- a/Src/DasherCore/DefaultFilter.cpp
+++ b/Src/DasherCore/DefaultFilter.cpp
@@ -127,10 +127,12 @@ bool CDefaultFilter::Timer(unsigned long Time, CDasherView *pView, CDasherInput
       }
     }
 
-    OneStepTowards(m_pDasherModel, m_iLastX,m_iLastY, Time, SlowStartSpeedMul(Time));
+    const double dSpeedMul(SlowStartSpeedMul(Time));
+    
+    OneStepTowards(m_pDasherModel, m_iLastX,m_iLastY, Time, dSpeedMul);
     bDidSomething = true;
 
-    if (GetLongParameter(LP_BOOSTFACTOR)==100)
+    if (GetLongParameter(LP_BOOSTFACTOR)==100 && dSpeedMul==1.0)
       m_pAutoSpeedControl->SpeedControl(m_iLastX, m_iLastY, pView);
   }
 
diff --git a/Src/iPhone/Classes/CDasherInterfaceBridge.mm b/Src/iPhone/Classes/CDasherInterfaceBridge.mm
index dbb07f1..6a39c51 100644
--- a/Src/iPhone/Classes/CDasherInterfaceBridge.mm
+++ b/Src/iPhone/Classes/CDasherInterfaceBridge.mm
@@ -80,13 +80,13 @@ void CDasherInterfaceBridge::CreateModules() {
                  
   RegisterModule(new CButtonMode(this, this, true, 9, "Menu Mode"));
   RegisterModule(new CButtonMode(this, this, false, 8, "Direct Mode"));
-  RegisterModule(new CTwoButtonDynamicFilter(this, this));
-  RegisterModule(new CTwoPushDynamicFilter(this, this));
+  RegisterModule(new CTwoButtonDynamicFilter(this, this, m_pFramerate));
+  RegisterModule(new CTwoPushDynamicFilter(this, this, m_pFramerate));
   
 	RegisterModule(m_pTiltFilter =
-				   new CIPhoneTiltFilter(this, this, 16, m_pMouseDevice));
+				   new CIPhoneTiltFilter(this, this, m_pFramerate, 16, m_pMouseDevice));
 	RegisterModule(m_pTouchFilter = 
-				   new CIPhoneTouchFilter(this, this, 17, m_pUndoubledTouch, m_pTiltDevice));
+				   new CIPhoneTouchFilter(this, this, m_pFramerate, 17, m_pUndoubledTouch, m_pTiltDevice));
 	SetDefaultInputMethod(m_pTouchFilter);
 }
 	
diff --git a/Src/iPhone/Classes/IPhoneFilters.h b/Src/iPhone/Classes/IPhoneFilters.h
index 36e2366..73b62e1 100644
--- a/Src/iPhone/Classes/IPhoneFilters.h
+++ b/Src/iPhone/Classes/IPhoneFilters.h
@@ -35,7 +35,7 @@ extern NSString *TOUCH_USE_TILT_X;
 #define TOUCH_FILTER "IPhone Touch Filter"
 class CIPhoneTiltFilter : public COneDimensionalFilter, private IPhonePrefsObserver {
 public:
-	CIPhoneTiltFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, CDasherInput *pTouch);
+	CIPhoneTiltFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, CFrameRate *pFramerate, ModuleID_t iID, CDasherInput *pTouch);
   ///override to enable hold-to-go
 	virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
   ///override to enable hold-to-go
@@ -59,7 +59,7 @@ private:
 
 class CIPhoneTouchFilter : public CStylusFilter, private IPhonePrefsObserver {
 public:
-	CIPhoneTouchFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, UndoubledTouch *pUndoubledTouch, CIPhoneTiltInput *pTilt);
+	CIPhoneTouchFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, CFrameRate *pFramerate, ModuleID_t iID, UndoubledTouch *pUndoubledTouch, CIPhoneTiltInput *pTilt);
 	
 	virtual void KeyUp(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
   
diff --git a/Src/iPhone/Classes/IPhoneFilters.mm b/Src/iPhone/Classes/IPhoneFilters.mm
index 3f3a6dd..85b422b 100644
--- a/Src/iPhone/Classes/IPhoneFilters.mm
+++ b/Src/iPhone/Classes/IPhoneFilters.mm
@@ -64,8 +64,8 @@ IPhonePrefsObserver::~IPhonePrefsObserver() {
   [obsvr release];
 }
 
-CIPhoneTiltFilter::CIPhoneTiltFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, CDasherInput *pTouch)
-: COneDimensionalFilter(pCreator, pInterface, iID, TILT_FILTER), m_pTouch(pTouch) {
+CIPhoneTiltFilter::CIPhoneTiltFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, CFrameRate *pFramerate, ModuleID_t iID, CDasherInput *pTouch)
+: COneDimensionalFilter(pCreator, pInterface, pFramerate, iID, TILT_FILTER), m_pTouch(pTouch) {
   ObserveKeys(HOLD_TO_GO, TILT_USE_TOUCH_X, TILT_1D, @"CircleStart", nil);
 };
 			
@@ -84,7 +84,7 @@ void CIPhoneTiltFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDasher
 
 void CIPhoneTiltFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
 	if(iId == 100 && bHoldToGo)
-		m_pInterface->Unpause(iTime);
+		Unpause(iTime);
   else COneDimensionalFilter::KeyDown(iTime, iId, pView, pInput, pModel, pUserLog);
 }
 
@@ -132,8 +132,8 @@ CStartHandler *CIPhoneTiltFilter::MakeStartHandler() {
   return CDefaultFilter::MakeStartHandler();
 }
 
-CIPhoneTouchFilter::CIPhoneTouchFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, UndoubledTouch *pUndoubledTouch, CIPhoneTiltInput *pTilt)
-: CStylusFilter(pCreator, pInterface, iID, TOUCH_FILTER), m_pUndoubledTouch(pUndoubledTouch), m_pTilt(pTilt) {
+CIPhoneTouchFilter::CIPhoneTouchFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, CFrameRate *pFramerate, ModuleID_t iID, UndoubledTouch *pUndoubledTouch, CIPhoneTiltInput *pTilt)
+: CStylusFilter(pCreator, pInterface, pFramerate, iID, TOUCH_FILTER), m_pUndoubledTouch(pUndoubledTouch), m_pTilt(pTilt) {
   ObserveKeys(TOUCH_USE_TILT_X,nil);
   
 };
diff --git a/Src/iPhone/Dasher.xcodeproj/project.pbxproj b/Src/iPhone/Dasher.xcodeproj/project.pbxproj
index b933151..2803a52 100755
--- a/Src/iPhone/Dasher.xcodeproj/project.pbxproj
+++ b/Src/iPhone/Dasher.xcodeproj/project.pbxproj
@@ -253,6 +253,7 @@
 		337ECC1B10DD5E0700D0C6A5 /* ExpansionPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 337ECC1910DD5E0700D0C6A5 /* ExpansionPolicy.cpp */; };
 		339F8A330FF5088000282847 /* CalibrationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 339F8A320FF5088000282847 /* CalibrationController.mm */; };
 		33B3430813A8A927009AE0D5 /* DashIntfScreenMsgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33B3430613A8A927009AE0D5 /* DashIntfScreenMsgs.cpp */; };
+		33B6825013CA4CC300F0A952 /* DynamicButtons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33B6824E13CA4CC200F0A952 /* DynamicButtons.cpp */; };
 		33C71AF20FF7B51700A20992 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 33C71AF10FF7B51700A20992 /* Default.png */; };
 		33CBB397101F422200510BF9 /* PPMPYLanguageModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33CBB395101F422200510BF9 /* PPMPYLanguageModel.cpp */; };
 		33CBB4CD101F9E5F00510BF9 /* training_czechC_CS.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33CBB4C7101F9E5F00510BF9 /* training_czechC_CS.txt */; };
@@ -703,6 +704,8 @@
 		33B342F313A8A8B2009AE0D5 /* Messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Messages.h; sourceTree = "<group>"; };
 		33B3430613A8A927009AE0D5 /* DashIntfScreenMsgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DashIntfScreenMsgs.cpp; sourceTree = "<group>"; };
 		33B3430713A8A927009AE0D5 /* DashIntfScreenMsgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DashIntfScreenMsgs.h; sourceTree = "<group>"; };
+		33B6824E13CA4CC200F0A952 /* DynamicButtons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicButtons.cpp; sourceTree = "<group>"; };
+		33B6824F13CA4CC200F0A952 /* DynamicButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicButtons.h; sourceTree = "<group>"; };
 		33C71AF10FF7B51700A20992 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
 		33CBB395101F422200510BF9 /* PPMPYLanguageModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPMPYLanguageModel.cpp; sourceTree = "<group>"; };
 		33CBB396101F422200510BF9 /* PPMPYLanguageModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPMPYLanguageModel.h; sourceTree = "<group>"; };
@@ -1222,6 +1225,8 @@
 				3344FDAB0F71717C00506EAA /* DasherViewSquare.inl */,
 				3344FDAC0F71717C00506EAA /* DefaultFilter.cpp */,
 				3344FDAD0F71717C00506EAA /* DefaultFilter.h */,
+				33B6824E13CA4CC200F0A952 /* DynamicButtons.cpp */,
+				33B6824F13CA4CC200F0A952 /* DynamicButtons.h */,
 				3344FDAF0F71717C00506EAA /* DynamicFilter.cpp */,
 				3344FDB00F71717C00506EAA /* DynamicFilter.h */,
 				3344FDB10F71717C00506EAA /* Event.h */,
@@ -1729,6 +1734,7 @@
 				33DFE411137AA2FC00F86CDE /* GameModule.cpp in Sources */,
 				33DFE416137AA32300F86CDE /* WordGeneratorBase.cpp in Sources */,
 				3360335813ABDF3700417DFE /* ScreenGameModule.cpp in Sources */,
+				33B6825013CA4CC300F0A952 /* DynamicButtons.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]