Provides information on device orientation. More...
#include <qmorientation.h>
Public Types | |
enum | Orientation { Undefined = 0, BottomUp, BottomDown, LeftUp, RightUp, FaceDown, FaceUp } |
Signals | |
void | orientationChanged (const MeeGo::QmOrientationReading orientation) |
Public Member Functions | |
QmOrientation (QObject *parent=0) | |
~QmOrientation () | |
QmOrientationReading | orientation () |
int | threshold () |
void | setThreshold (int value) |
Properties | |
QmOrientationReading | orientation |
int | threshold |
Provides information on device orientation.
Orientation is given as the side of the device with the strongest negative acceleration. Threshold value can be used to control the sensitivity of state change. setThreshold()
Device side naming:
Top ---------- / NOKIA /| /-------- / | // // / // // / Left // Face // / Right // // / // // / /---------/ / / O / / / / / ---------- / |_________!/ Bottom
To get measurements and change sensor settings, the client must open a session (and call start() for data). Details can be found from documentation of QmSensor.
Definition at line 81 of file qmorientation.h.
Enumerated states for possible orientations.
Definition at line 92 of file qmorientation.h.
MeeGo::QmOrientation::QmOrientation | ( | QObject * | parent = 0 |
) |
Constructor
parent | Parent QObject. |
MeeGo::QmOrientation::~QmOrientation | ( | ) |
Destructor
QmOrientationReading MeeGo::QmOrientation::orientation | ( | ) |
Gets the current device orientation.
void MeeGo::QmOrientation::orientationChanged | ( | const MeeGo::QmOrientationReading | orientation | ) | [signal] |
Sent when the device orientation has changed.
orientation | Current device orientation |
void MeeGo::QmOrientation::setThreshold | ( | int | value | ) |
Sets the threshold value for the algorithm. Threshold value controls the sensitivity of orientation change. Value is given in mG. Orientation is considered to have changed whenever measured acceleration towards new orientation is stronger than acceleration towards previous orientation by the amount of threshold.
Low threshold provides more sensitivity, high threshold value provides more stability.
Current default is 50 mG.
value | Threshold value to set |
int MeeGo::QmOrientation::threshold | ( | ) |
Gets the currently used threshold value. Value is in mG. See setThreshold()
QmOrientationReading MeeGo::QmOrientation::orientation [read] |
Definition at line 83 of file qmorientation.h.
int MeeGo::QmOrientation::threshold [read, write] |
Definition at line 84 of file qmorientation.h.