mirror of
https://github.com/gtalent/sc9k.git
synced 2025-09-11 15:02:55 -05:00
Switch from QMake to CMake with buildcore
This commit is contained in:
50
src/obsclient.hpp
Normal file
50
src/obsclient.hpp
Normal 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();
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user