mirror of
https://github.com/gtalent/sc9k.git
synced 2025-09-11 08:02:57 -05:00
Add settings dialog, camera controls
This commit is contained in:
46
src/cameraclient.hpp
Normal file
46
src/cameraclient.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2021 - 2023 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 CameraClient: public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString m_baseUrl;
|
||||
QNetworkAccessManager *const m_nam = new QNetworkAccessManager(this);
|
||||
QNetworkAccessManager *const m_pollingNam = new QNetworkAccessManager(this);
|
||||
QTimer m_pollTimer;
|
||||
|
||||
public:
|
||||
explicit CameraClient(QObject *parent = nullptr);
|
||||
|
||||
void setPreset(int preset);
|
||||
|
||||
public slots:
|
||||
void setBaseUrl();
|
||||
|
||||
private:
|
||||
void get(QString const&url);
|
||||
|
||||
void poll();
|
||||
|
||||
void handlePollResponse(QNetworkReply *reply);
|
||||
|
||||
signals:
|
||||
void pollUpdate();
|
||||
|
||||
void pollFailed();
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user