Add options to invert scroll direction and swap gamepad buttons

Fixes #463
Fixes #467
This commit is contained in:
Cameron Gutman
2020-12-25 22:21:20 -06:00
parent a11f623b17
commit 5096ff6496
9 changed files with 103 additions and 1 deletions
+6
View File
@@ -32,6 +32,8 @@
#define SER_SWAPMOUSEBUTTONS "swapmousebuttons"
#define SER_MUTEONMINIMIZE "muteonminimize"
#define SER_BACKGROUNDGAMEPAD "backgroundgamepad"
#define SER_REVERSESCROLL "reversescroll"
#define SER_SWAPFACEBUTTONS "swapfacebuttons"
#define CURRENT_DEFAULT_VER 1
@@ -76,6 +78,8 @@ void StreamingPreferences::reload()
swapMouseButtons = settings.value(SER_SWAPMOUSEBUTTONS, false).toBool();
muteOnMinimize = settings.value(SER_MUTEONMINIMIZE, false).toBool();
backgroundGamepad = settings.value(SER_BACKGROUNDGAMEPAD, false).toBool();
reverseScrollDirection = settings.value(SER_REVERSESCROLL, false).toBool();
swapFaceButtons = settings.value(SER_SWAPFACEBUTTONS, false).toBool();
audioConfig = static_cast<AudioConfig>(settings.value(SER_AUDIOCFG,
static_cast<int>(AudioConfig::AC_STEREO)).toInt());
videoCodecConfig = static_cast<VideoCodecConfig>(settings.value(SER_VIDEOCFG,
@@ -130,6 +134,8 @@ void StreamingPreferences::save()
settings.setValue(SER_SWAPMOUSEBUTTONS, swapMouseButtons);
settings.setValue(SER_MUTEONMINIMIZE, muteOnMinimize);
settings.setValue(SER_BACKGROUNDGAMEPAD, backgroundGamepad);
settings.setValue(SER_REVERSESCROLL, reverseScrollDirection);
settings.setValue(SER_SWAPFACEBUTTONS, swapFaceButtons);
}
int StreamingPreferences::getDefaultBitrate(int width, int height, int fps)
+6
View File
@@ -77,6 +77,8 @@ public:
Q_PROPERTY(bool swapMouseButtons MEMBER swapMouseButtons NOTIFY mouseButtonsChanged)
Q_PROPERTY(bool muteOnMinimize MEMBER muteOnMinimize NOTIFY muteOnMinimizeChanged)
Q_PROPERTY(bool backgroundGamepad MEMBER backgroundGamepad NOTIFY backgroundGamepadChanged)
Q_PROPERTY(bool reverseScrollDirection MEMBER reverseScrollDirection NOTIFY reverseScrollDirectionChanged)
Q_PROPERTY(bool swapFaceButtons MEMBER swapFaceButtons NOTIFY swapFaceButtonsChanged)
// Directly accessible members for preferences
int width;
@@ -101,6 +103,8 @@ public:
bool swapMouseButtons;
bool muteOnMinimize;
bool backgroundGamepad;
bool reverseScrollDirection;
bool swapFaceButtons;
int packetSize;
AudioConfig audioConfig;
VideoCodecConfig videoCodecConfig;
@@ -133,5 +137,7 @@ signals:
void mouseButtonsChanged();
void muteOnMinimizeChanged();
void backgroundGamepadChanged();
void reverseScrollDirectionChanged();
void swapFaceButtonsChanged();
};