Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,13 @@ namespace config {
}
} // namespace dd

alt_gamepad_numbering_t alt_gamepad_numbering {
{}, // alt_gamepad_numbering_mutex
{}, // sDeviceNames
true, // bFirstTimeControllerAllocation
true, // bFirstTimeParsing
};

video_t video {
false, // headless_mode
true, // limit_framerate
Expand Down Expand Up @@ -572,6 +579,9 @@ namespace config {
true, // high resolution scrolling
true, // native pen/touch support
false, // enable input only mode
false, // alt_controller enable
"", // alt_controller_order_string
4, // alt_controller_count
};

sunshine_t sunshine {
Expand Down Expand Up @@ -1281,6 +1291,9 @@ namespace config {
bool_f(vars, "high_resolution_scrolling", input.high_resolution_scrolling);
bool_f(vars, "native_pen_touch", input.native_pen_touch);
bool_f(vars, "enable_input_only_mode", input.enable_input_only_mode);
bool_f(vars, "enable_alt_controller_numbering_mode", input.enable_alt_controller_numbering_mode);
string_f(vars, "alt_controller_order_string", input.alt_controller_order_string);
int_between_f(vars, "alt_controller_count", input.alt_controller_count, {1, 16}); // CORRESPONDS TO MAX_GAMEPADS = 16 in common.h on /src/platform/common.h

bool_f(vars, "hide_tray_controls", sunshine.hide_tray_controls);
bool_f(vars, "enable_pairing", sunshine.enable_pairing);
Expand Down
16 changes: 15 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <string>
#include <unordered_map>
#include <vector>
#include <mutex>

// local includes
#include "nvenc/nvenc_config.h"
Expand Down Expand Up @@ -212,6 +213,10 @@ namespace config {
bool native_pen_touch;

bool enable_input_only_mode;
// Alternate Controller Numbering Mode
bool enable_alt_controller_numbering_mode;
std::string alt_controller_order_string;
int alt_controller_count;
};

namespace flag {
Expand Down Expand Up @@ -285,7 +290,16 @@ namespace config {
std::vector<prep_cmd_t> state_cmds;
std::vector<server_cmd_t> server_cmds;
};


// Alternate Controller Numbering Mode
struct alt_gamepad_numbering_t {
std::mutex alt_gamepad_numbering_mutex;
std::vector< std::string > sDeviceNames;
volatile bool bFirstTimeControllerAllocation { true };
volatile bool bFirstTimeParsing { true };
};

extern alt_gamepad_numbering_t alt_gamepad_numbering;
extern video_t video;
extern audio_t audio;
extern stream_t stream;
Expand Down
Loading