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,
|
2020-04-03 07:12:52 +00:00
|
|
|
AC_51_SURROUND,
|
|
|
|
AC_71_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)
|
2020-04-25 20:00:39 +00:00
|
|
|
Q_PROPERTY(bool absoluteMouseMode MEMBER absoluteMouseMode NOTIFY absoluteMouseModeChanged)
|
2020-05-01 03:55:15 +00:00
|
|
|
Q_PROPERTY(bool absoluteTouchMode MEMBER absoluteTouchMode NOTIFY absoluteTouchModeChanged)
|
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)
|
2020-08-09 01:29:36 +00:00
|
|
|
Q_PROPERTY(bool detectNetworkBlocking MEMBER detectNetworkBlocking NOTIFY detectNetworkBlockingChanged);
|
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)
|
2020-08-23 14:05:00 +00:00
|
|
|
Q_PROPERTY(bool swapMouseButtons MEMBER swapMouseButtons NOTIFY mouseButtonsChanged)
|
2020-12-25 21:32:11 +00:00
|
|
|
Q_PROPERTY(bool muteOnMinimize MEMBER muteOnMinimize NOTIFY muteOnMinimizeChanged)
|
|
|
|
Q_PROPERTY(bool backgroundGamepad MEMBER backgroundGamepad NOTIFY backgroundGamepadChanged)
|
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;
|
2020-04-25 20:00:39 +00:00
|
|
|
bool absoluteMouseMode;
|
2020-05-01 03:55:15 +00:00
|
|
|
bool absoluteTouchMode;
|
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;
|
2020-08-09 01:29:36 +00:00
|
|
|
bool detectNetworkBlocking;
|
2020-08-23 14:05:00 +00:00
|
|
|
bool swapMouseButtons;
|
2020-12-25 21:32:11 +00:00
|
|
|
bool muteOnMinimize;
|
|
|
|
bool backgroundGamepad;
|
2020-01-22 03:10:10 +00:00
|
|
|
int packetSize;
|
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();
|
2020-04-25 20:00:39 +00:00
|
|
|
void absoluteMouseModeChanged();
|
2020-05-01 03:55:15 +00:00
|
|
|
void absoluteTouchModeChanged();
|
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();
|
2020-08-09 01:29:36 +00:00
|
|
|
void detectNetworkBlockingChanged();
|
2020-08-23 14:05:00 +00:00
|
|
|
void mouseButtonsChanged();
|
2020-12-25 21:32:11 +00:00
|
|
|
void muteOnMinimizeChanged();
|
|
|
|
void backgroundGamepadChanged();
|
2018-06-28 06:15:13 +00:00
|
|
|
};
|
|
|
|
|