New Sensor-> Actor -> Item system (half implemented, relay support
only), new ui, Relay dehardcoeding.
This commit is contained in:
48
src/speakersensor.h
Normal file
48
src/speakersensor.h
Normal file
@ -0,0 +1,48 @@
|
||||
#ifndef AMPMANAGER_H
|
||||
#define AMPMANAGER_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <QObject>
|
||||
#include <QRunnable>
|
||||
#include <QScopedPointer>
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
#include <QProcess>
|
||||
#include <QByteArray>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "microcontroller.h"
|
||||
|
||||
|
||||
class AmpManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AmpManager(Microcontroller *micro, int relayNumber, QObject *parent = nullptr);
|
||||
~AmpManager();
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
void run();
|
||||
void abort();
|
||||
|
||||
private slots:
|
||||
void doTick();
|
||||
|
||||
private:
|
||||
QScopedPointer<QEventLoop> loop;
|
||||
|
||||
long silenceCount = 0;
|
||||
Microcontroller *_micro;
|
||||
int _relayNumber;
|
||||
|
||||
|
||||
QProcess arecord;
|
||||
|
||||
bool relayState = false;
|
||||
|
||||
};
|
||||
|
||||
#endif // AMPMANAGER_H
|
Reference in New Issue
Block a user