switched from qsettings to json added editng of actors
This commit is contained in:
42
src/broadcast.h
Normal file
42
src/broadcast.h
Normal file
@ -0,0 +1,42 @@
|
||||
#ifndef BROADCAST_H
|
||||
#define BROADCAST_H
|
||||
#include <QIODevice>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QJsonObject>
|
||||
|
||||
class BroadCast: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
|
||||
static constexpr uint8_t MODE_PREPACKET = 0;
|
||||
static constexpr uint8_t MODE_PACKET = 1;
|
||||
|
||||
QByteArray buffer_;
|
||||
|
||||
QIODevice* const iodevice_;
|
||||
|
||||
void write(const char * const buffer, const size_t length);
|
||||
void write(const QByteArray& buffer);
|
||||
|
||||
void decode();
|
||||
|
||||
private slots:
|
||||
|
||||
void readyRead();
|
||||
|
||||
signals:
|
||||
|
||||
void gotJson(QJsonObject json);
|
||||
|
||||
public:
|
||||
|
||||
BroadCast(QIODevice* const iodevice = nullptr);
|
||||
void sendJson(const QJsonObject& json);
|
||||
|
||||
};
|
||||
|
||||
#endif // BROADCAST_H
|
||||
|
Reference in New Issue
Block a user