Add settings dialog, camera controls

This commit is contained in:
2023-07-20 02:13:48 -05:00
parent a8327b2b67
commit 29cdc499e6
24 changed files with 793 additions and 82 deletions

46
src/cameraclient.hpp Normal file
View 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();
};