sensorfw
alsadaptor-ascii.h
Go to the documentation of this file.
1 
32 #ifndef ALSADAPTOR_ASCII_H
33 #define ALSADAPTOR_ASCII_H
34 
35 #include <QObject>
36 #include <QString>
37 #include "sysfsadaptor.h"
38 #include "deviceadaptorringbuffer.h"
40 
41 class ALSAdaptorAscii : public SysfsAdaptor
42 {
43  Q_OBJECT;
44 public:
45  static DeviceAdaptor* factoryMethod(const QString& id)
46  {
47  return new ALSAdaptorAscii(id);
48  }
49 
50 protected:
51  ALSAdaptorAscii(const QString& id);
53  bool startSensor();
54  void stopSensor();
55  virtual bool setStandbyOverride(const bool override) { Q_UNUSED(override); return false; }
56 private:
57 
58  void processSample(int pathId, int fd);
59  char buf[16];
60 
61  DeviceAdaptorRingBuffer<TimedUnsigned>* alsBuffer_;
62 
63  QByteArray powerStatePath;
64  QByteArray powerMode;
65 };
66 
67 #endif
ALSAdaptorAscii(const QString &id)
virtual bool setStandbyOverride(const bool override)
static DeviceAdaptor * factoryMethod(const QString &id)
Datatype for unsigned values.