moonlight-qt/app/backend/nvcomputer.h

85 lines
1.5 KiB
C
Raw Normal View History

#pragma once
#include "nvhttp.h"
#include <QThread>
#include <QReadWriteLock>
#include <QSettings>
#include <QRunnable>
class NvComputer
{
friend class PcMonitorThread;
friend class ComputerManager;
friend class PendingQuitTask;
private:
void sortAppList();
bool updateAppList(QVector<NvApp> newAppList);
bool pendingQuit;
public:
2018-12-22 02:08:07 +00:00
explicit NvComputer(QString address, QString serverInfo, QSslCertificate serverCert);
explicit NvComputer(QSettings& settings);
bool
update(NvComputer& that);
bool
wake();
bool
isReachableOverVpn();
QVector<QString>
2020-02-25 01:44:21 +00:00
uniqueAddresses() const;
void
2020-02-25 01:44:21 +00:00
serialize(QSettings& settings) const;
enum PairState
{
PS_UNKNOWN,
PS_PAIRED,
PS_NOT_PAIRED
};
enum ComputerState
{
CS_UNKNOWN,
CS_ONLINE,
CS_OFFLINE
};
// Ephemeral traits
ComputerState state;
PairState pairState;
QString activeAddress;
int currentGameId;
QString gfeVersion;
QString appVersion;
QVector<NvDisplayMode> displayModes;
int maxLumaPixelsHEVC;
int serverCodecModeSupport;
QString gpuModel;
bool isSupportedServerVersion;
// Persisted traits
QString localAddress;
QString remoteAddress;
QString ipv6Address;
QString manualAddress;
QByteArray macAddress;
QString name;
2020-05-02 01:34:15 +00:00
bool hasCustomName;
QString uuid;
2018-12-22 02:08:07 +00:00
QSslCertificate serverCert;
QVector<NvApp> appList;
// Synchronization
2020-02-25 01:44:21 +00:00
mutable QReadWriteLock lock;
};