#include <GizmoPowermate.hpp>
Public Member Functions | |
void | changeLEDState (int StaticBrightness, int PulseSpeed, int PulseTable, int PulseAsleep, int PulseAwake) |
Directly send a raw event code to the Powermate. | |
unsigned char | getLED () |
Get the Powermate's LED value. | |
float | getLEDPercent () |
Get the Powermate's LED value as a percentage. | |
bool | getLEDPulseAsleep () |
Get pulse while sleeping. | |
bool | getRotated () |
Has the dial rotated since last press? | |
virtual std::string | getType () |
Get the type of the Gizmo. | |
virtual bool | processEvent (GizmoEvent *pEvent) |
Process an event. | |
void | pulseLED (int Level, int PulseSpeed, int PulseTable) |
Set the pulsing state of the LED. | |
void | setLED (unsigned char Level) |
Set the LED intensity. | |
void | setLEDPercent (float Percent) |
Set the LED intensity as a percentage. | |
void | setLEDPulseAsleep (bool Enabled) |
Pulse while sleeping. | |
void | setRotateSensitivity (int TicksPerEvent) |
Set the rotate sensitivity in wheel ticks per generated event (default 1). | |
GizmoPowermate () | |
Set the rotate sensitivity in wheel ticks per generated event (default 1). | |
GizmoPowermate (const H::DeviceInfo &deviceInfo, int DeviceID, int DeviceClassID) | |
Default Constructor. | |
virtual | ~GizmoPowermate () |
Destructor. | |
Protected Attributes | |
unsigned long | mClickTimer |
Time of last button press. | |
unsigned char | mLevel |
Current intensity level of the LED. | |
bool | mPulseAsleep |
Pulse when going to sleep. | |
int | mRotateCurDir |
Rotation sensitivity direction keeper. | |
int | mRotateCurTick |
Rotation sensitivity counter. | |
bool | mRotated |
Has the dial rotated since last click. | |
int | mRotateTicksPerEvent |
Rotation sensitivity. | |
Friends | |
class | boost::serialization::access |
This class contains all of the helper functions for making use of the Powermate
Definition at line 62 of file GizmoPowermate.hpp.
GizmoPowermate::GizmoPowermate | ( | ) |
Set the rotate sensitivity in wheel ticks per generated event (default 1).
GizmoPowermate Serialize Constructor.
Serialize Constructor
Definition at line 71 of file GizmoPowermate.cpp.
References mPulseAsleep, mRotateCurDir, mRotateCurTick, mRotated, and mRotateTicksPerEvent.
GizmoPowermate::GizmoPowermate | ( | const H::DeviceInfo & | deviceInfo, | |
int | DeviceID, | |||
int | DeviceClassID | |||
) |
Default Constructor.
GizmoPowermate Default Constructor.
Definition at line 60 of file GizmoPowermate.cpp.
References mPulseAsleep, mRotateCurDir, mRotateCurTick, mRotated, and mRotateTicksPerEvent.
GizmoPowermate::~GizmoPowermate | ( | ) | [virtual] |
void GizmoPowermate::changeLEDState | ( | int | StaticBrightness, | |
int | PulseSpeed, | |||
int | PulseTable, | |||
int | PulseAsleep, | |||
int | PulseAwake | |||
) |
Directly send a raw event code to the Powermate.
Change the state of the Powermate's LED.
StaticBrightness | Brightness level of LED | |
PulseSpeed | Pulse speed of the LED | |
PulseTable | Pulse type of LED | |
PulseAsleep | Pulse while asleep | |
PulseAwake | Pulse while awake |
Definition at line 101 of file GizmoPowermate.cpp.
References cdbg, H::DeviceInfo::FileDescriptor, and Gizmod::GizmoLinuxInputDevice::mDeviceInfo.
Referenced by pulseLED(), and setLED().
unsigned char GizmoPowermate::getLED | ( | ) |
Get the Powermate's LED value.
Get the Powermate's LED Value.
Definition at line 130 of file GizmoPowermate.cpp.
References mLevel.
float GizmoPowermate::getLEDPercent | ( | ) |
Get the Powermate's LED value as a percentage.
Get the Powermate's LED Value as a percentage.
Definition at line 138 of file GizmoPowermate.cpp.
References mLevel.
bool GizmoPowermate::getLEDPulseAsleep | ( | ) |
Get pulse while sleeping.
Definition at line 146 of file GizmoPowermate.cpp.
References mPulseAsleep.
bool GizmoPowermate::getRotated | ( | ) |
Has the dial rotated since last press?
Get whether or not the dial has rotated since the last button event.
Definition at line 162 of file GizmoPowermate.cpp.
References mRotated.
std::string GizmoPowermate::getType | ( | ) | [virtual] |
Get the type of the Gizmo.
Get the type of this Gizmo.
Reimplemented from Gizmod::Gizmo.
Definition at line 154 of file GizmoPowermate.cpp.
References GIZMO_POWERMATE_TYPE.
bool GizmoPowermate::processEvent | ( | GizmoEvent * | pEvent | ) | [virtual] |
Process an event.
pEvent | The event to process |
Reimplemented from Gizmod::Gizmo.
Definition at line 171 of file GizmoPowermate.cpp.
References Gizmod::GizmoEventPowermate::ClickTime, Gizmod::GizmoLinuxInputEvent::Code, mClickTimer, mRotateCurDir, mRotateCurTick, mRotated, mRotateTicksPerEvent, Gizmod::GizmoLinuxInputDevice::processEvent(), Gizmod::Gizmo::setKeyState(), Gizmod::GizmoLinuxInputEvent::Type, and Gizmod::GizmoLinuxInputEvent::Value.
void GizmoPowermate::pulseLED | ( | int | Level, | |
int | PulseSpeed, | |||
int | PulseTable | |||
) |
Set the pulsing state of the LED.
Set the hardware pulsing state of the Powermate's LED.
Level | The Level of the Pulsing (255 is a good value) | |
PulseSpeed | Speed of the pulsing (255-270 are good values) | |
PulseTable | Type of the pulsing |
Definition at line 209 of file GizmoPowermate.cpp.
References cdbg2, and changeLEDState().
void GizmoPowermate::setLED | ( | unsigned char | Level | ) |
Set the LED intensity.
Set the intensity of the Powermate's LED.
Level | of intensity from 0 - 255 |
Definition at line 218 of file GizmoPowermate.cpp.
References changeLEDState(), mLevel, and mPulseAsleep.
Referenced by setLEDPercent().
void GizmoPowermate::setLEDPercent | ( | float | Percent | ) |
Set the LED intensity as a percentage.
Set the intensity of the Powermate's LED as a percentage.
Percent | The intensity of the powermate as a range between 0.0 and 100.0 |
Definition at line 229 of file GizmoPowermate.cpp.
void GizmoPowermate::setLEDPulseAsleep | ( | bool | Enabled | ) |
Pulse while sleeping.
Set LED pulse while sleeping.
Enabled | Set to true if the powermate should pulse when it goes to sleep |
Definition at line 244 of file GizmoPowermate.cpp.
References mPulseAsleep.
void GizmoPowermate::setRotateSensitivity | ( | int | TicksPerEvent | ) |
Set the rotate sensitivity in wheel ticks per generated event (default 1).
TicksPerEvent | The number of ticks required to generate an event |
Definition at line 252 of file GizmoPowermate.cpp.
References cdbg, and mRotateTicksPerEvent.