[dasher] Remove CDasherModel parameter to inputfilter constructors to allow



commit f3f6b9d2bc00db3268700385fda7814219212142
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Wed Jun 17 10:24:57 2009 +0100

    Remove CDasherModel parameter to inputfilter constructors to allow
    CDasherInterfaceBase _subclasses_ to create them in CreateModules.

 Src/DasherCore/AutoSpeedControl.cpp     |    4 ++--
 Src/DasherCore/AutoSpeedControl.h       |    2 +-
 Src/DasherCore/DasherInterfaceBase.cpp  |    8 ++++----
 Src/DasherCore/DefaultFilter.cpp        |    4 ++--
 Src/DasherCore/DefaultFilter.h          |    2 +-
 Src/DasherCore/EyetrackerFilter.cpp     |    4 ++--
 Src/DasherCore/EyetrackerFilter.h       |    2 +-
 Src/DasherCore/OneDimensionalFilter.cpp |    4 ++--
 Src/DasherCore/OneDimensionalFilter.h   |    2 +-
 Src/DasherCore/StylusFilter.cpp         |    4 ++--
 Src/DasherCore/StylusFilter.h           |    2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/Src/DasherCore/AutoSpeedControl.cpp b/Src/DasherCore/AutoSpeedControl.cpp
index 44bd022..68b5841 100644
--- a/Src/DasherCore/AutoSpeedControl.cpp
+++ b/Src/DasherCore/AutoSpeedControl.cpp
@@ -22,7 +22,7 @@ double round(double dVal) {
 }
 #endif
 
-CAutoSpeedControl::CAutoSpeedControl(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore, double dFrameRate) 
+CAutoSpeedControl::CAutoSpeedControl(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore) 
   : CDasherComponent(pEventHandler, pSettingsStore) {
   //scale #samples by #samples = m_dSamplesScale / (current bitrate) + m_dSampleOffset
   m_dSampleScale = 1.5;
@@ -50,7 +50,7 @@ CAutoSpeedControl::CAutoSpeedControl(Dasher::CEventHandler * pEventHandler, CSet
   m_dBitrate = double(round(GetLongParameter(LP_MAX_BITRATE) / 100.0));
 
   UpdateMinRadius();
-  UpdateSampleSize(dFrameRate); 
+  UpdateSampleSize(GetLongParameter(LP_FRAMERATE) / 100.0); 
 }
 
   ////////////////////////////////////////////////
diff --git a/Src/DasherCore/AutoSpeedControl.h b/Src/DasherCore/AutoSpeedControl.h
index 02e95de..7534c1e 100644
--- a/Src/DasherCore/AutoSpeedControl.h
+++ b/Src/DasherCore/AutoSpeedControl.h
@@ -14,7 +14,7 @@ using namespace Dasher;
 /// @{
 class CAutoSpeedControl : public Dasher::CDasherComponent {
  public:
-  CAutoSpeedControl(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore, double dFrameRate);
+  CAutoSpeedControl(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore);
   
   ///
   /// AUTO-SPEED-CONTROL
diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp
index ac80e75..dde675c 100644
--- a/Src/DasherCore/DasherInterfaceBase.cpp
+++ b/Src/DasherCore/DasherInterfaceBase.cpp
@@ -933,10 +933,10 @@ void CDasherInterfaceBase::SetDefaultInputMethod(CDasherModule *pModule) {
 
 void CDasherInterfaceBase::CreateModules() {
   SetDefaultInputMethod(
-    RegisterModule(new CDefaultFilter(m_pEventHandler, m_pSettingsStore, this, m_pDasherModel,3, _("Normal Control")))
+    RegisterModule(new CDefaultFilter(m_pEventHandler, m_pSettingsStore, this, 3, _("Normal Control")))
   );
-  RegisterModule(new COneDimensionalFilter(m_pEventHandler, m_pSettingsStore, this, m_pDasherModel));
-  RegisterModule(new CEyetrackerFilter(m_pEventHandler, m_pSettingsStore, this, m_pDasherModel));
+  RegisterModule(new COneDimensionalFilter(m_pEventHandler, m_pSettingsStore, this));
+  RegisterModule(new CEyetrackerFilter(m_pEventHandler, m_pSettingsStore, this));
 #ifndef _WIN32_WCE
   RegisterModule(new CClickFilter(m_pEventHandler, m_pSettingsStore, this));
 #else
@@ -952,7 +952,7 @@ void CDasherInterfaceBase::CreateModules() {
   //  RegisterModule(new CDasherButtons(m_pEventHandler, m_pSettingsStore, this, 4, 0, false,11, "Buttons 3"));
   RegisterModule(new CDasherButtons(m_pEventHandler, m_pSettingsStore, this, 3, 3, false,12, _("Alternating Direct Mode")));
   RegisterModule(new CDasherButtons(m_pEventHandler, m_pSettingsStore, this, 4, 2, false,13, _("Compass Mode")));
-  RegisterModule(new CStylusFilter(m_pEventHandler, m_pSettingsStore, this, m_pDasherModel,15, _("Stylus Control")));
+  RegisterModule(new CStylusFilter(m_pEventHandler, m_pSettingsStore, this, 15, _("Stylus Control")));
 
 }
 
diff --git a/Src/DasherCore/DefaultFilter.cpp b/Src/DasherCore/DefaultFilter.cpp
index e96de85..c85f7ea 100644
--- a/Src/DasherCore/DefaultFilter.cpp
+++ b/Src/DasherCore/DefaultFilter.cpp
@@ -8,10 +8,10 @@
 
 #include <iostream>
 
-CDefaultFilter::CDefaultFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *m_pDasherModel, ModuleID_t iID, const char *szName)
+CDefaultFilter::CDefaultFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, ModuleID_t iID, const char *szName)
   : CInputFilter(pEventHandler, pSettingsStore, pInterface, iID, 1, szName) {
   m_pStartHandler = 0;
-  m_pAutoSpeedControl = new CAutoSpeedControl(m_pEventHandler, m_pSettingsStore, m_pDasherModel->Framerate());
+  m_pAutoSpeedControl = new CAutoSpeedControl(m_pEventHandler, m_pSettingsStore);
 
   CreateStartHandler();
 }
diff --git a/Src/DasherCore/DefaultFilter.h b/Src/DasherCore/DefaultFilter.h
index 0b8fe35..05a14ee 100644
--- a/Src/DasherCore/DefaultFilter.h
+++ b/Src/DasherCore/DefaultFilter.h
@@ -9,7 +9,7 @@
 /// @{
 class CDefaultFilter : public CInputFilter {
  public:
-  CDefaultFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *m_pDasherModel, ModuleID_t iID, const char *szName);
+  CDefaultFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, ModuleID_t iID, const char *szName);
   ~CDefaultFilter();
 
   virtual void HandleEvent(Dasher::CEvent * pEvent);
diff --git a/Src/DasherCore/EyetrackerFilter.cpp b/Src/DasherCore/EyetrackerFilter.cpp
index a53df89..778e655 100644
--- a/Src/DasherCore/EyetrackerFilter.cpp
+++ b/Src/DasherCore/EyetrackerFilter.cpp
@@ -7,8 +7,8 @@ static SModuleSettings sSettings[] = {
   {BP_AUTOCALIBRATE, T_BOOL, -1, -1, -1, -1, _("Automatic calibration")}
 };
 
-CEyetrackerFilter::CEyetrackerFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *m_pDasherModel)
-  : CDefaultFilter(pEventHandler, pSettingsStore, pInterface, m_pDasherModel, 5, _("Eyetracker Mode")) {
+CEyetrackerFilter::CEyetrackerFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface)
+  : CDefaultFilter(pEventHandler, pSettingsStore, pInterface, 5, _("Eyetracker Mode")) {
 
   // Setup some autocalibration parameters
   m_iYAutoOffset = 0;
diff --git a/Src/DasherCore/EyetrackerFilter.h b/Src/DasherCore/EyetrackerFilter.h
index c048409..7686a2c 100644
--- a/Src/DasherCore/EyetrackerFilter.h
+++ b/Src/DasherCore/EyetrackerFilter.h
@@ -7,7 +7,7 @@
 /// @{
 class CEyetrackerFilter : public CDefaultFilter {
  public:
-  CEyetrackerFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *m_pDasherModel);
+  CEyetrackerFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface);
 
   bool GetSettings(SModuleSettings **pSettings, int *iCount);
 
diff --git a/Src/DasherCore/OneDimensionalFilter.cpp b/Src/DasherCore/OneDimensionalFilter.cpp
index 4f3d178..89effa7 100644
--- a/Src/DasherCore/OneDimensionalFilter.cpp
+++ b/Src/DasherCore/OneDimensionalFilter.cpp
@@ -1,8 +1,8 @@
 #include "../Common/Common.h"
 #include "OneDimensionalFilter.h"
 
-COneDimensionalFilter::COneDimensionalFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *m_pDasherModel)
-  : CDefaultFilter(pEventHandler, pSettingsStore, pInterface, m_pDasherModel, 4, _("One Dimensional Mode")) {
+COneDimensionalFilter::COneDimensionalFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface)
+  : CDefaultFilter(pEventHandler, pSettingsStore, pInterface, 4, _("One Dimensional Mode")) {
 }
 
 void COneDimensionalFilter::ApplyTransform(myint &iDasherX, myint &iDasherY) {
diff --git a/Src/DasherCore/OneDimensionalFilter.h b/Src/DasherCore/OneDimensionalFilter.h
index b74802b..53030f9 100644
--- a/Src/DasherCore/OneDimensionalFilter.h
+++ b/Src/DasherCore/OneDimensionalFilter.h
@@ -7,7 +7,7 @@
 /// @{
 class COneDimensionalFilter : public CDefaultFilter {
  public:
-  COneDimensionalFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *m_pDasherModel);
+  COneDimensionalFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface);
 
  private:
    virtual void ApplyTransform(myint &iDasherX, myint &iDasherY);
diff --git a/Src/DasherCore/StylusFilter.cpp b/Src/DasherCore/StylusFilter.cpp
index ba43e76..c4162f8 100644
--- a/Src/DasherCore/StylusFilter.cpp
+++ b/Src/DasherCore/StylusFilter.cpp
@@ -3,8 +3,8 @@
 #include "DasherInterfaceBase.h"
 #include "Event.h"
 
-CStylusFilter::CStylusFilter(Dasher::CEventHandler *pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *pDasherModel, ModuleID_t iID, const char *szName)
-  : CDefaultFilter(pEventHandler, pSettingsStore, pInterface, pDasherModel, iID, szName) {
+CStylusFilter::CStylusFilter(Dasher::CEventHandler *pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, ModuleID_t iID, const char *szName)
+  : CDefaultFilter(pEventHandler, pSettingsStore, pInterface, iID, szName) {
 }
 
 
diff --git a/Src/DasherCore/StylusFilter.h b/Src/DasherCore/StylusFilter.h
index 6c8ef07..baa2356 100644
--- a/Src/DasherCore/StylusFilter.h
+++ b/Src/DasherCore/StylusFilter.h
@@ -7,7 +7,7 @@
 /// @{
 class CStylusFilter : public CDefaultFilter {
  public:
-  CStylusFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, CDasherModel *pDasherModel, ModuleID_t iID, const char *szName);
+  CStylusFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, ModuleID_t iID, const char *szName);
 
   virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog);
   virtual void KeyUp(int iTime, int iId, CDasherView *pView, CDasherModel *pModel);



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