switched from qsettings to json added editng of actors
This commit is contained in:
45
src/sensors/speakersensor.h
Normal file
45
src/sensors/speakersensor.h
Normal file
@ -0,0 +1,45 @@
|
||||
#ifndef AMPMANAGER_H
|
||||
#define AMPMANAGER_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <QObject>
|
||||
#include <QRunnable>
|
||||
#include <QScopedPointer>
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
#include <QProcess>
|
||||
#include <QByteArray>
|
||||
|
||||
#include "sensor.h"
|
||||
|
||||
|
||||
class SpeakerSensorSource : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString name_;
|
||||
bool state = true;
|
||||
QTimer timer;
|
||||
|
||||
public:
|
||||
explicit SpeakerSensorSource(QString name = "", QObject *parent = nullptr);
|
||||
~SpeakerSensorSource();
|
||||
|
||||
public slots:
|
||||
void run();
|
||||
void abort();
|
||||
|
||||
signals:
|
||||
void stateChanged(Sensor sensor);
|
||||
|
||||
private slots:
|
||||
void doTick();
|
||||
|
||||
private:
|
||||
long silenceCount = 0;
|
||||
|
||||
QProcess arecord;
|
||||
};
|
||||
|
||||
#endif // AMPMANAGER_H
|
Reference in New Issue
Block a user