sensorfw
alsadaptor.h
Go to the documentation of this file.
1 
31 #ifndef ALSADAPTOR_H
32 #define ALSADAPTOR_H
33 
34 #include "sysfsadaptor.h"
35 #include "deviceadaptorringbuffer.h"
37 #include <QTime>
38 #include <QDBusInterface>
39 
40 #ifdef SENSORFW_MCE_WATCHER
41  #include <mce/mode-names.h>
42  #include <mce/dbus-names.h>
43 #endif
44 
56 class ALSAdaptor : public SysfsAdaptor
57 {
58  Q_OBJECT;
59 public:
61  {
66  };
67 
74  static DeviceAdaptor* factoryMethod(const QString& id)
75  {
76  return new ALSAdaptor(id);
77  }
78 
79  virtual bool startSensor();
80 
81  virtual void stopSensor();
82 
83  virtual bool standby();
84 
85  virtual bool resume();
86 
87 protected:
88 
93  ALSAdaptor(const QString& id);
94 
95  ~ALSAdaptor();
96 
97  void processSample(int pathId, int fd);
98 
99 private:
100 #ifdef SENSORFW_MCE_WATCHER
101  void enableALS();
102  void disableALS();
103 
104  QDBusInterface *dbusIfc;
105  bool alsEnabled;
106 #endif
107 
108  DeviceAdaptorRingBuffer<TimedUnsigned>* alsBuffer_;
109  DeviceType deviceType_;
110  QByteArray powerStatePath_;
111 };
112 
113 #endif
virtual bool startSensor()
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of ALSAdaptor class.
Definition: alsadaptor.h:74
void processSample(int pathId, int fd)
virtual bool standby()
Adaptor for internal ambient light sensor.
Definition: alsadaptor.h:56
ALSAdaptor(const QString &id)
Constructor.
virtual bool resume()
virtual void stopSensor()
Datatype for unsigned values.