2018-06-28 06:15:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-07-09 00:33:47 +00:00
|
|
|
#include <QObject>
|
2018-08-05 21:55:26 +00:00
|
|
|
#include <QRect>
|
2018-07-09 00:33:47 +00:00
|
|
|
|
|
|
|
class StreamingPreferences : public QObject
|
2018-06-28 06:15:13 +00:00
|
|
|
{
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2018-06-28 06:15:13 +00:00
|
|
|
public:
|
2018-09-29 21:06:55 +00:00
|
|
|
StreamingPreferences(QObject *parent = nullptr);
|
2018-06-28 06:15:13 +00:00
|
|
|
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_INVOKABLE static int
|
2018-06-28 06:15:13 +00:00
|
|
|
getDefaultBitrate(int width, int height, int fps);
|
|
|
|
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_INVOKABLE void save();
|
2018-07-26 07:41:46 +00:00
|
|
|
|
2018-06-28 06:15:13 +00:00
|
|
|
void reload();
|
|
|
|
|
|
|
|
enum AudioConfig
|
|
|
|
{
|
2018-10-02 22:30:22 +00:00
|
|
|
AC_STEREO,
|
|
|
|
AC_51_SURROUND
|
2018-06-28 06:15:13 +00:00
|
|
|
};
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_ENUM(AudioConfig)
|
2018-06-28 06:15:13 +00:00
|
|
|
|
|
|
|
enum VideoCodecConfig
|
|
|
|
{
|
|
|
|
VCC_AUTO,
|
|
|
|
VCC_FORCE_H264,
|
|
|
|
VCC_FORCE_HEVC,
|
|
|
|
VCC_FORCE_HEVC_HDR
|
|
|
|
};
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_ENUM(VideoCodecConfig)
|
|
|
|
|
|
|
|
enum VideoDecoderSelection
|
|
|
|
{
|
|
|
|
VDS_AUTO,
|
|
|
|
VDS_FORCE_HARDWARE,
|
|
|
|
VDS_FORCE_SOFTWARE
|
|
|
|
};
|
|
|
|
Q_ENUM(VideoDecoderSelection)
|
|
|
|
|
2018-09-04 02:17:34 +00:00
|
|
|
enum WindowMode
|
|
|
|
{
|
|
|
|
WM_FULLSCREEN,
|
|
|
|
WM_FULLSCREEN_DESKTOP,
|
|
|
|
WM_WINDOWED
|
|
|
|
};
|
2018-09-04 04:21:37 +00:00
|
|
|
Q_ENUM(WindowMode)
|
2018-09-04 02:17:34 +00:00
|
|
|
|
2018-07-09 03:53:24 +00:00
|
|
|
Q_PROPERTY(int width MEMBER width NOTIFY displayModeChanged)
|
|
|
|
Q_PROPERTY(int height MEMBER height NOTIFY displayModeChanged)
|
|
|
|
Q_PROPERTY(int fps MEMBER fps NOTIFY displayModeChanged)
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_PROPERTY(int bitrateKbps MEMBER bitrateKbps NOTIFY bitrateChanged)
|
2018-08-21 05:25:19 +00:00
|
|
|
Q_PROPERTY(bool enableVsync MEMBER enableVsync NOTIFY enableVsyncChanged)
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_PROPERTY(bool gameOptimizations MEMBER gameOptimizations NOTIFY gameOptimizationsChanged)
|
|
|
|
Q_PROPERTY(bool playAudioOnHost MEMBER playAudioOnHost NOTIFY playAudioOnHostChanged)
|
|
|
|
Q_PROPERTY(bool multiController MEMBER multiController NOTIFY multiControllerChanged)
|
2018-09-08 21:33:34 +00:00
|
|
|
Q_PROPERTY(bool unsupportedFps MEMBER unsupportedFps NOTIFY unsupportedFpsChanged)
|
2018-09-09 19:33:19 +00:00
|
|
|
Q_PROPERTY(bool enableMdns MEMBER enableMdns NOTIFY enableMdnsChanged)
|
2018-12-06 02:45:28 +00:00
|
|
|
Q_PROPERTY(bool quitAppAfter MEMBER quitAppAfter NOTIFY quitAppAfterChanged)
|
2018-09-09 20:21:11 +00:00
|
|
|
Q_PROPERTY(bool mouseAcceleration MEMBER mouseAcceleration NOTIFY mouseAccelerationChanged)
|
2018-11-04 21:57:33 +00:00
|
|
|
Q_PROPERTY(bool startWindowed MEMBER startWindowed NOTIFY startWindowedChanged)
|
2018-12-25 20:57:00 +00:00
|
|
|
Q_PROPERTY(bool framePacing MEMBER framePacing NOTIFY framePacingChanged)
|
2019-03-19 03:21:52 +00:00
|
|
|
Q_PROPERTY(bool connectionWarnings MEMBER connectionWarnings NOTIFY connectionWarningsChanged)
|
2019-06-30 01:24:59 +00:00
|
|
|
Q_PROPERTY(bool richPresence MEMBER richPresence NOTIFY richPresenceChanged)
|
|
|
|
Q_PROPERTY(bool gamepadMouse MEMBER gamepadMouse NOTIFY gamepadMouseChanged)
|
2018-07-09 00:33:47 +00:00
|
|
|
Q_PROPERTY(AudioConfig audioConfig MEMBER audioConfig NOTIFY audioConfigChanged)
|
|
|
|
Q_PROPERTY(VideoCodecConfig videoCodecConfig MEMBER videoCodecConfig NOTIFY videoCodecConfigChanged)
|
|
|
|
Q_PROPERTY(VideoDecoderSelection videoDecoderSelection MEMBER videoDecoderSelection NOTIFY videoDecoderSelectionChanged)
|
2018-09-04 02:17:34 +00:00
|
|
|
Q_PROPERTY(WindowMode windowMode MEMBER windowMode NOTIFY windowModeChanged)
|
2019-06-29 21:58:27 +00:00
|
|
|
Q_PROPERTY(WindowMode recommendedFullScreenMode MEMBER recommendedFullScreenMode CONSTANT)
|
2018-06-28 06:15:13 +00:00
|
|
|
|
|
|
|
// Directly accessible members for preferences
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int fps;
|
|
|
|
int bitrateKbps;
|
2018-08-21 05:25:19 +00:00
|
|
|
bool enableVsync;
|
2018-07-09 00:33:47 +00:00
|
|
|
bool gameOptimizations;
|
2018-06-28 06:15:13 +00:00
|
|
|
bool playAudioOnHost;
|
|
|
|
bool multiController;
|
2018-09-08 21:33:34 +00:00
|
|
|
bool unsupportedFps;
|
2018-09-09 19:33:19 +00:00
|
|
|
bool enableMdns;
|
2018-12-06 02:45:28 +00:00
|
|
|
bool quitAppAfter;
|
2018-09-09 20:21:11 +00:00
|
|
|
bool mouseAcceleration;
|
2018-11-04 21:57:33 +00:00
|
|
|
bool startWindowed;
|
2018-12-25 20:57:00 +00:00
|
|
|
bool framePacing;
|
2019-03-19 03:21:52 +00:00
|
|
|
bool connectionWarnings;
|
2019-06-30 00:40:30 +00:00
|
|
|
bool richPresence;
|
2019-06-30 01:24:59 +00:00
|
|
|
bool gamepadMouse;
|
2018-06-28 06:15:13 +00:00
|
|
|
AudioConfig audioConfig;
|
|
|
|
VideoCodecConfig videoCodecConfig;
|
2018-07-09 00:33:47 +00:00
|
|
|
VideoDecoderSelection videoDecoderSelection;
|
2018-09-04 02:17:34 +00:00
|
|
|
WindowMode windowMode;
|
2019-06-29 21:58:27 +00:00
|
|
|
WindowMode recommendedFullScreenMode;
|
2018-07-09 00:33:47 +00:00
|
|
|
|
|
|
|
signals:
|
2018-07-09 03:53:24 +00:00
|
|
|
void displayModeChanged();
|
2018-07-09 00:33:47 +00:00
|
|
|
void bitrateChanged();
|
2018-08-21 05:25:19 +00:00
|
|
|
void enableVsyncChanged();
|
2018-07-09 00:33:47 +00:00
|
|
|
void gameOptimizationsChanged();
|
|
|
|
void playAudioOnHostChanged();
|
|
|
|
void multiControllerChanged();
|
2018-09-08 21:33:34 +00:00
|
|
|
void unsupportedFpsChanged();
|
2018-09-09 19:33:19 +00:00
|
|
|
void enableMdnsChanged();
|
2018-12-06 02:45:28 +00:00
|
|
|
void quitAppAfterChanged();
|
2018-09-09 20:21:11 +00:00
|
|
|
void mouseAccelerationChanged();
|
2018-07-09 00:33:47 +00:00
|
|
|
void audioConfigChanged();
|
|
|
|
void videoCodecConfigChanged();
|
|
|
|
void videoDecoderSelectionChanged();
|
2018-09-04 02:17:34 +00:00
|
|
|
void windowModeChanged();
|
2018-11-04 21:57:33 +00:00
|
|
|
void startWindowedChanged();
|
2018-12-25 20:57:00 +00:00
|
|
|
void framePacingChanged();
|
2019-03-19 03:21:52 +00:00
|
|
|
void connectionWarningsChanged();
|
2019-06-30 00:40:30 +00:00
|
|
|
void richPresenceChanged();
|
2019-06-30 01:24:59 +00:00
|
|
|
void gamepadMouseChanged();
|
2018-06-28 06:15:13 +00:00
|
|
|
};
|
|
|
|
|