00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __GizmoPowermate_h
00030 #define __GizmoPowermate_h
00031
00032 #if HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif
00035
00036 #include "Gizmo.hpp"
00037 #include "GizmoLinuxInputDevice.hpp"
00038 #include <boost/archive/text_oarchive.hpp>
00039 #include <boost/archive/text_iarchive.hpp>
00040 #include <boost/serialization/base_object.hpp>
00041
00043
00045
00046 namespace Gizmod {
00047
00049
00051
00053
00055
00062 class GizmoPowermate : public Gizmo, public GizmoLinuxInputDevice {
00063 public:
00064
00065 void changeLEDState(int StaticBrightness, int PulseSpeed, int PulseTable, int PulseAsleep, int PulseAwake);
00066 unsigned char getLED();
00067 float getLEDPercent();
00068 bool getLEDPulseAsleep();
00069 bool getRotated();
00070 virtual std::string getType();
00071 virtual bool processEvent(GizmoEvent * pEvent);
00072 void pulseLED(int Level, int PulseSpeed, int PulseTable);
00073 void setLED(unsigned char Level);
00074 void setLEDPercent(float Percent);
00075 void setLEDPulseAsleep(bool Enabled);
00076 void setRotateSensitivity(int TicksPerEvent);
00077
00078
00079 GizmoPowermate();
00080 GizmoPowermate(const H::DeviceInfo & deviceInfo, int DeviceID, int DeviceClassID);
00081 virtual ~GizmoPowermate();
00082
00083 protected:
00084
00085
00086
00087 unsigned long mClickTimer;
00088 unsigned char mLevel;
00089 bool mPulseAsleep;
00090 int mRotateCurDir;
00091 int mRotateCurTick;
00092 bool mRotated;
00093 int mRotateTicksPerEvent;
00094
00095 private:
00096
00097 friend class boost::serialization::access;
00098 template<class Archive>
00099 void serialize(Archive & ar, const unsigned int version) {
00100 ar & boost::serialization::base_object<Gizmo>(*this);
00101 ar & boost::serialization::base_object<GizmoLinuxInputDevice>(*this);
00102 ar & mLevel;
00103 ar & mPulseAsleep;
00104 ar & mRotateCurDir;
00105 ar & mRotateCurTick;
00106 ar & mRotated;
00107 ar & mRotateTicksPerEvent;
00108 }
00109 };
00110
00112
00113 }
00114
00115 #endif // __GizmoPowermate_h