[dasher: 181/217] Added BP_SLOW_CONTROL_BOX parameter



commit 507d32d6ce03946705b812eb3da0cea425ad3429
Author: Ada Majorek <amajorek google com>
Date:   Thu Jan 21 23:21:53 2016 -0800

    Added BP_SLOW_CONTROL_BOX parameter
    
    fixes https://github.com/ipomoena/dasher/issues/77

 Src/DasherCore/ControlManager.cpp |    3 +++
 Src/DasherCore/ControlManager.h   |    4 ++--
 Src/DasherCore/Parameters.cpp     |    1 +
 Src/DasherCore/Parameters.h       |    1 +
 4 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/Src/DasherCore/ControlManager.cpp b/Src/DasherCore/ControlManager.cpp
index 166a2d4..a8edd7a 100644
--- a/Src/DasherCore/ControlManager.cpp
+++ b/Src/DasherCore/ControlManager.cpp
@@ -98,6 +98,9 @@ CControlBase::NodeTemplate::~NodeTemplate() {
 CControlBase::CContNode::CContNode(int iOffset, int iColour, NodeTemplate *pTemplate, CControlBase *pMgr)
 : CDasherNode(iOffset, iColour, pTemplate->m_pLabel), m_pTemplate(pTemplate), m_pMgr(pMgr) {
 }
+double  CControlBase::CContNode::SpeedMul() {
+  return m_pMgr->GetBoolParameter(BP_SLOW_CONTROL_BOX) ? 0.5 : 1;
+}
 
 void CControlBase::CContNode::PopulateChildren() {
 
diff --git a/Src/DasherCore/ControlManager.h b/Src/DasherCore/ControlManager.h
index 8288cfd..a341d43 100644
--- a/Src/DasherCore/ControlManager.h
+++ b/Src/DasherCore/ControlManager.h
@@ -65,8 +65,8 @@ namespace Dasher {
       CContNode(int iOffset, int iColour, NodeTemplate *pTemplate, CControlBase *pMgr);
       CDasherScreen::Label *getLabel() { return m_pTemplate->m_pLabel; }
 
-      bool bShove() {return false;}
-      double SpeedMul() {return 0.5;}
+      bool bShove() override {return false;}
+      double SpeedMul() override;
       ///
       /// Provide children for the supplied node
       ///
diff --git a/Src/DasherCore/Parameters.cpp b/Src/DasherCore/Parameters.cpp
index 33cb989..2dc5ba7 100644
--- a/Src/DasherCore/Parameters.cpp
+++ b/Src/DasherCore/Parameters.cpp
@@ -42,6 +42,7 @@ const bp_table boolparamtable[] = {
   {BP_SPEAK_WORDS, "SpeakWords", Persistence::PERSISTENT, false, "Speak words as they are written"},
   {BP_GAME_HELP_DRAW_PATH, "GameDrawPath", Persistence::PERSISTENT, true, "When we give help, show the 
shortest path to the target sentence"},
   {BP_TWO_PUSH_RELEASE_TIME, "TwoPushReleaseTime", Persistence::PERSISTENT, false, "Use push and release 
times of single press rather than push times of two presses"},
+  {BP_SLOW_CONTROL_BOX, "SlowControlBox", Persistence::PERSISTENT, true, "Slow down when going through 
control box" },
 };
 
 const lp_table longparamtable[] = {
diff --git a/Src/DasherCore/Parameters.h b/Src/DasherCore/Parameters.h
index 4fb729e..4021ad5 100644
--- a/Src/DasherCore/Parameters.h
+++ b/Src/DasherCore/Parameters.h
@@ -41,6 +41,7 @@ enum {
   BP_TWOBUTTON_REVERSE, BP_2B_INVERT_DOUBLE, BP_SLOW_START,
   BP_COPY_ALL_ON_STOP, BP_SPEAK_ALL_ON_STOP, BP_SPEAK_WORDS,
   BP_GAME_HELP_DRAW_PATH, BP_TWO_PUSH_RELEASE_TIME,
+  BP_SLOW_CONTROL_BOX,
   END_OF_BPS
 };
 


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