00001 /// \file GASProtoMapper.h 00002 /// \brief Prototype input mapping 00003 /// Quick and dirty for quadcontrol - abstract on next round in CATControllerMapper 00004 /// \ingroup GASPilot 00005 /// 00006 /// Copyright (c) 2008 by Michael Ellison. 00007 /// See COPYING.txt for the \ref gaslicense License (MIT License). 00008 /// 00009 // $Author: mikeellison $ 00010 // $Date: 2008-02-01 02:37:33 -0600 (Fri, 01 Feb 2008) $ 00011 // $Revision: $ 00012 // $NoKeywords: $ 00013 #ifndef GASProtoMapper_H_ 00014 #define GASProtoMapper_H_ 00015 00016 #include "CATInternal.h" 00017 #include "CATJoystick.h" 00018 #include "CATControlMap.h" 00019 #include "CATString.h" 00020 #include "CATMsgThread.h" 00021 #include "CATFilterAttackDecay.h" 00022 #include "CATFilterEWMA.h" 00023 00024 // move these to win32 implementation once we've got class developed. 00025 class CATDirectInput; 00026 00027 /// \class GASProtoMapper 00028 /// \brief Prototype input mapping 00029 /// Quick and dirty for quadcontrol - abstract on next round in CATControllerMapper 00030 /// \ingroup CAT 00031 class GASProtoMapper : public CATMsgThread 00032 { 00033 public: 00034 GASProtoMapper(); 00035 virtual ~GASProtoMapper(); 00036 00037 virtual CATResult Initialize(); 00038 virtual CATResult Uninitialize(); 00039 00040 virtual CATResult GetControllerList( std::vector<CATString>& controllerList); 00041 00042 virtual CATResult GetMappingList( const CATString& controllerName, 00043 std::vector<CATString>& mappingList); 00044 00045 virtual CATResult StartMapping( const CATString& controllerName, 00046 const CATString& mappingName); 00047 00048 virtual CATResult StopMapping(); 00049 00050 protected: 00051 virtual void OnThreadIdle(); 00052 virtual CATUInt32 OnThreadMessage(CATUInt32 msg, CATUInt32 wParam, CATUInt32 lParam); 00053 void OnAxis(CATInt32 val, CATJoystick::AXIS_TYPE axisType); 00054 void OnButtonChange(bool state, CATUInt32 button); 00055 void PushChar(CATUInt32 scancode, bool keydown = true); 00056 00057 bool fInitialized; 00058 CATUInt32 fPollFreq; 00059 CATJoystick* fController; ///< active input controller (eventually needs to be parent class of joystick) 00060 CATControlMap* fMap; ///< active mapping information 00061 00062 // Move these to win32 implementation once we've got the class developed 00063 CATDirectInput* fDirectInput; 00064 CATJOYSTICKSTRUCT fLastStatus; 00065 CATUInt32 fValidAxis; 00066 00067 CATFilterAttackDecay* fFilterXLow; 00068 CATFilterAttackDecay* fFilterXHigh; 00069 CATFilterAttackDecay* fFilterZLow; 00070 CATFilterAttackDecay* fFilterZHigh; 00071 CATFilterAttackDecay* fFilterXRotLow; 00072 CATFilterAttackDecay* fFilterXRotHigh; 00073 CATFilterAttackDecay* fFilterYRotLow; 00074 CATFilterAttackDecay* fFilterYRotHigh; 00075 00076 bool fWKeyDown; 00077 bool fSKeyDown; 00078 bool fWPovKeyDown; 00079 bool fSPovKeyDown; 00080 bool fAKeyDown; 00081 bool fDKeyDown; 00082 bool fSpeedToggle; 00083 bool fCToggle; 00084 bool fLSToggle; 00085 bool fLCToggle; 00086 }; 00087 00088 #endif // GASProtoMapper_H_