diff --git a/src/config.cpp b/src/config.cpp index 7f5888633..e8accb15a 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -407,21 +407,6 @@ namespace config { boost::asio::ip::host_name(), // sunshine_name, "sunshine_state.json"s, // file_state {}, // external_ip - { - "352x240"s, - "480x360"s, - "858x480"s, - "1280x720"s, - "1920x1080"s, - "2560x1080"s, - "2560x1440"s, - "3440x1440"s, - "1920x1200"s, - "3840x2160"s, - "3840x1600"s, - }, // supported resolutions - - { 10, 30, 60, 90, 120 }, // supported fps }; input_t input { @@ -1044,8 +1029,6 @@ namespace config { path_f(vars, "credentials_file", config::sunshine.credentials_file); string_f(vars, "external_ip", nvhttp.external_ip); - list_string_f(vars, "resolutions"s, nvhttp.resolutions); - list_int_f(vars, "fps"s, nvhttp.fps); list_prep_cmd_f(vars, "global_prep_cmd", config::sunshine.prep_cmds); string_f(vars, "audio_sink", audio.sink); diff --git a/src/config.h b/src/config.h index d2c4783ce..c987fc543 100644 --- a/src/config.h +++ b/src/config.h @@ -115,8 +115,6 @@ namespace config { std::string file_state; std::string external_ip; - std::vector resolutions; - std::vector fps; }; struct input_t { diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index af32391bb..085402ffa 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -734,31 +734,6 @@ namespace nvhttp { } tree.put("root.ServerCodecModeSupport", codec_mode_flags); - pt::ptree display_nodes; - for (auto &resolution : config::nvhttp.resolutions) { - auto pred = [](auto ch) { return ch == ' ' || ch == '\t' || ch == 'x'; }; - - auto middle = std::find_if(std::begin(resolution), std::end(resolution), pred); - if (middle == std::end(resolution)) { - BOOST_LOG(warning) << resolution << " is not in the proper format for a resolution: WIDTHxHEIGHT"sv; - continue; - } - - auto width = util::from_chars(&*std::begin(resolution), &*middle); - auto height = util::from_chars(&*(middle + 1), &*std::end(resolution)); - for (auto fps : config::nvhttp.fps) { - pt::ptree display_node; - display_node.put("Width", width); - display_node.put("Height", height); - display_node.put("RefreshRate", fps); - - display_nodes.add_child("DisplayMode", display_node); - } - } - - if (!config::nvhttp.resolutions.empty()) { - tree.add_child("root.SupportedDisplayMode", display_nodes); - } auto current_appid = proc::proc.running(); tree.put("root.PairStatus", pair_status); tree.put("root.currentgame", current_appid); diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 8c2bce2b3..8386dbd36 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -49,8 +49,6 @@ v-if="currentTab === 'av'" :config="config" :platform="platform" - :resolutions="resolutions" - :fps="fps" > @@ -128,8 +126,6 @@ saved: false, restarted: false, config: null, - fps: [], - resolutions: [], currentTab: "general", global_prep_cmd: [], tabs: [ // TODO: Move the options to each Component instead, encapsulate. @@ -174,8 +170,6 @@ "install_steam_audio_drivers": "enabled", "adapter_name": "", "output_name": "", - "resolutions": "[352x240,480x360,858x480,1280x720,1920x1080,2560x1080,2560x1440,3440x1440,1920x1200,3840x2160,3840x1600]", - "fps": "[10,30,60,90,120]", "min_fps_factor": 1, }, }, @@ -320,16 +314,6 @@ }); }); - this.fps = JSON.parse(this.config.fps); - //Resolutions should be fixed because are not valid JSON - let res = this.config.resolutions.substring( - 1, - this.config.resolutions.length - 1 - ); - let resolutions = []; - res.split(",").forEach((r) => resolutions.push(r.trim())); - this.resolutions = resolutions; - this.config.global_prep_cmd = this.config.global_prep_cmd || []; this.global_prep_cmd = JSON.parse(this.config.global_prep_cmd); }); @@ -339,16 +323,6 @@ this.$forceUpdate() }, serialize() { - let nl = this.config === "windows" ? "\r\n" : "\n"; - this.config.resolutions = - "[" + - nl + - " " + - this.resolutions.join("," + nl + " ") + - nl + - "]"; - // remove quotes from values in fps - this.config.fps = JSON.stringify(this.fps).replace(/"/g, ""); this.config.global_prep_cmd = JSON.stringify(this.global_prep_cmd); }, save() { @@ -364,19 +338,11 @@ Object.keys(tab.options).forEach(optionKey => { let delete_value = false - if (["resolutions", "fps", "global_prep_cmd"].includes(optionKey)) { + if (["global_prep_cmd"].includes(optionKey)) { let config_value, default_value - if (optionKey === "resolutions") { - let regex = /([\d]+x[\d]+)/g - - // Use a regular expression to find each value and replace it with a quoted version - config_value = JSON.parse(config[optionKey].replace(regex, '"$1"')).toString() - default_value = JSON.parse(tab.options[optionKey].replace(regex, '"$1"')).toString() - } else { - config_value = JSON.parse(config[optionKey]) - default_value = JSON.parse(tab.options[optionKey]) - } + config_value = JSON.parse(config[optionKey]) + default_value = JSON.parse(tab.options[optionKey]) if (config_value === default_value) { delete_value = true diff --git a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue index 1a5b63c07..21160dfed 100644 --- a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue +++ b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue @@ -11,8 +11,6 @@ import DisplayModesSettings from "./audiovideo/DisplayModesSettings.vue"; const props = defineProps([ 'platform', 'config', - 'resolutions', - 'fps', 'min_fps_factor', ]) @@ -82,8 +80,6 @@ const config = ref(props.config) diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue index d519d75f7..b901e1ca4 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue @@ -6,14 +6,10 @@ import PlatformLayout from '../../../PlatformLayout.vue' const props = defineProps([ 'platform', 'config', - 'resolutions', - 'fps', 'min_fps_factor', ]) const config = ref(props.config) -const resolutions = ref(props.resolutions) -const fps = ref(props.fps) const resIn = ref("") const fpsIn = ref("") @@ -21,50 +17,6 @@ const fpsIn = ref("")