Switch from QMake to CMake with buildcore

This commit is contained in:
2021-07-28 01:13:20 -05:00
parent 1ab03975f7
commit 91683b4dd7
23 changed files with 898 additions and 30 deletions

50
src/obsclient.hpp Normal file
View File

@@ -0,0 +1,50 @@
/*
* Copyright 2021 gary@drinkingtea.net
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <QNetworkAccessManager>
#include <QObject>
#include <QTimer>
#include "consts.hpp"
class OBSClient: public QObject {
Q_OBJECT
private:
const QString BaseUrl = QString("http://") + SlideHost + ":9302";
QNetworkAccessManager *m_nam = new QNetworkAccessManager(this);
QNetworkAccessManager *m_pollingNam = new QNetworkAccessManager(this);
QTimer m_pollTimer;
public:
explicit OBSClient(QObject *parent = nullptr);
public slots:
void setScene(QString scene);
void showSlides();
void hideSlides();
void setSlidesVisible(int state);
private:
void get(QString url);
void poll();
void handlePollResponse(QNetworkReply *reply);
signals:
void pollUpdate();
void pollFailed();
};