Go to the documentation of this file.00001
00029 #ifndef ALSADAPTOR_H
00030 #define ALSADAPTOR_H
00031
00032 #include "sysfsadaptor.h"
00033 #include "deviceadaptorringbuffer.h"
00034 #include "datatypes/timedunsigned.h"
00035 #include <QTime>
00036 #include <QDBusInterface>
00037
00038 #ifdef SENSORFW_MCE_WATCHER
00039 #include <mce/mode-names.h>
00040 #include <mce/dbus-names.h>
00041 #endif
00042
00054 class ALSAdaptor : public SysfsAdaptor
00055 {
00056 Q_OBJECT;
00057 public:
00058
00059 enum DeviceType
00060 {
00061 DeviceUnknown = 0,
00062 RM680,
00063 RM696
00064 };
00065
00070 static DeviceAdaptor* factoryMethod(const QString& id)
00071 {
00072 return new ALSAdaptor(id);
00073 }
00074
00078 bool startAdaptor();
00079
00083 void stopAdaptor();
00084
00085 protected:
00090 ALSAdaptor(const QString& id);
00091 ~ALSAdaptor();
00092
00093 private:
00094
00102 void processSample(int pathId, int fd);
00103
00104 DeviceAdaptorRingBuffer<TimedUnsigned>* alsBuffer_;
00105 ALSAdaptor::DeviceType device;
00106
00107 #ifdef SENSORFW_MCE_WATCHER
00108 QDBusInterface *dbusIfc;
00109 #endif
00110 };
00111
00112 #endif