feat!: drop advertised resolutions and fps (#2924)
This commit is contained in:
parent
64083c1679
commit
04df80ff6b
7 changed files with 3 additions and 136 deletions
|
|
@ -49,8 +49,6 @@
|
|||
v-if="currentTab === 'av'"
|
||||
:config="config"
|
||||
:platform="platform"
|
||||
:resolutions="resolutions"
|
||||
:fps="fps"
|
||||
>
|
||||
</audio-video>
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
|||
<DisplayModesSettings
|
||||
:platform="platform"
|
||||
:config="config"
|
||||
:resolutions="resolutions"
|
||||
:fps="fps"
|
||||
:min_fps_factor="min_fps_factor"
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -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("")
|
|||
|
||||
<template>
|
||||
<div class="mb-3">
|
||||
<!-- Advertised Resolutions -->
|
||||
<div id="resolutions" class="resolutions-container">
|
||||
<label>{{ $t('config.resolutions') }}</label>
|
||||
<div class="resolutions d-flex flex-wrap">
|
||||
<div class="p-2 ms-item m-2 d-flex justify-content-between" v-for="(r,i) in resolutions" :key="r">
|
||||
<span class="px-2">{{r}}</span>
|
||||
<span style="cursor: pointer" @click="resolutions.splice(i,1)">×</span>
|
||||
</div>
|
||||
</div>
|
||||
<form @submit.prevent="resolutions.push(resIn);resIn = '';" class="d-flex align-items-center">
|
||||
<input type="text" v-model="resIn" required pattern="[0-9]+x[0-9]+" style="
|
||||
width: 12ch;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
" class="form-control" />
|
||||
<button style="border-top-left-radius: 0; border-bottom-left-radius: 0" class="btn btn-success">
|
||||
+
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Advertised FPS -->
|
||||
<div id="fps" class="fps-container">
|
||||
<label>{{ $t('config.fps') }}</label>
|
||||
<div class="fps d-flex flex-wrap">
|
||||
<div class="p-2 ms-item m-2 d-flex justify-content-between" v-for="(f,i) in fps" :key="f">
|
||||
<span class="px-2">{{f}}</span>
|
||||
<span style="cursor: pointer" @click="fps.splice(i,1)">×</span>
|
||||
</div>
|
||||
</div>
|
||||
<form @submit.prevent="fps.push(fpsIn);fpsIn = '';" class="d-flex align-items-center">
|
||||
<input type="text" v-model="fpsIn" required pattern="[0-9]+" style="
|
||||
width: 6ch;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
" class="form-control" />
|
||||
<button style="border-top-left-radius: 0; border-bottom-left-radius: 0" class="btn btn-success">
|
||||
+
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="form-text mb-3">{{ $t('config.res_fps_desc') }}</div>
|
||||
|
||||
<!--min_fps_factor-->
|
||||
<div class="mb-3">
|
||||
<label for="qp" class="form-label">{{ $t('config.min_fps_factor') }}</label>
|
||||
|
|
|
|||
|
|
@ -164,7 +164,6 @@
|
|||
"file_apps_desc": "The file where current apps of Sunshine are stored.",
|
||||
"file_state": "State File",
|
||||
"file_state_desc": "The file where current state of Sunshine is stored",
|
||||
"fps": "Advertised FPS",
|
||||
"gamepad": "Emulated Gamepad Type",
|
||||
"gamepad_auto": "Automatic selection options",
|
||||
"gamepad_desc": "Choose which type of gamepad to emulate on the host",
|
||||
|
|
@ -285,8 +284,6 @@
|
|||
"qsv_preset_veryfast": "fastest (lowest quality)",
|
||||
"qsv_slow_hevc": "Allow Slow HEVC Encoding",
|
||||
"qsv_slow_hevc_desc": "This can enable HEVC encoding on older Intel GPUs, at the cost of higher GPU usage and worse performance.",
|
||||
"res_fps_desc": "The display modes advertised by Sunshine. Some versions of Moonlight, such as Moonlight-nx (Switch), rely on these lists to ensure that the requested resolutions and fps are supported. This setting does not change how the screen stream is sent to Moonlight.",
|
||||
"resolutions": "Advertised Resolutions",
|
||||
"restart_note": "Sunshine is restarting to apply changes.",
|
||||
"sunshine_name": "Sunshine Name",
|
||||
"sunshine_name_desc": "The name displayed by Moonlight. If not specified, the PC's hostname is used",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue