Fixed UTF-8 file save bug Update to circle start handler Started two
[dasher.git] / Src / DasherCore / TwoButtonDynamicFilter.h
blob42da1b1c2241ec040a4b8a86e6ae196e5050e977
1 #ifndef __TWO_BUTTON_DYNAMIC_FILTER_H__
2 #define __TWO_BUTTON_DYNAMIC_FILTER_H__
4 #include "InputFilter.h"
6 #include <deque>
8 class CTwoButtonDynamicFilter : public CInputFilter {
9 public:
10 CTwoButtonDynamicFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface, long long int iID, int iType, const char *szName);
12 // Inherited methods
13 virtual bool DecorateView(CDasherView *pView);
14 virtual bool Timer(int Time, CDasherView *m_pDasherView, CDasherModel *m_pDasherModel, Dasher::VECTOR_SYMBOL_PROB *pAdded, int *pNumDeleted);
15 virtual void KeyDown(int iTime, int iId, CDasherModel *pModel, CUserLog *pUserLog);
16 virtual void KeyUp(int iTime, int iId, CDasherModel *pModel);
17 virtual void Activate();
18 virtual void Deactivate();
20 virtual bool GetSettings(SModuleSettings **pSettings, int *iCount);
22 virtual bool GetMinWidth(int &iMinWidth);
24 protected:
25 virtual bool TimerImpl(int Time, CDasherView *m_pDasherView, CDasherModel *m_pDasherModel, Dasher::VECTOR_SYMBOL_PROB *pAdded, int *pNumDeleted);
26 virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLog *pUserLog);
28 bool m_bDecorationChanged;
30 private:
31 void Event(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLog *pUserLog);
32 void AutoSpeedSample(int iTime);
34 class SBTree {
35 public:
36 SBTree(int iValue);
37 void Add(int iValue);
38 SBTree* Delete(int iValue);
40 int GetMax();
41 int GetMin();
42 private:
43 int m_iValue;
44 SBTree *m_pLeft;
45 SBTree *m_pRight;
48 SBTree *m_pLowerTree;
49 SBTree *m_pUpperTree;
51 int m_iLowerMax;
52 int m_iUpperMin;
54 int m_iUpperCount;
55 int m_iLowerCount;
57 int m_iLastButton;
58 int m_iKeyDownTime;
59 int m_iState; // 0 = paused, 1 = running 2 = backing off
60 int m_iQueueId;
61 std::deque<int> m_deQueueTimes;
63 bool m_bKeyDown;
64 bool m_bKeyHandled;
65 int m_iHeldId;
66 int m_iLastTime;
68 CUserLog *m_pUserLog;
71 #endif