Merge remote-tracking branch 'origin/master'

This commit is contained in:
Yukino Song
2024-08-08 19:43:28 +08:00
10 changed files with 13 additions and 156 deletions

2
.gitignore vendored
View File

@@ -40,7 +40,7 @@
# build directories # build directories
build/ build/
cmake-*/ cmake-*/
docs/*-doxyconfig* docs/doxyconfig*
# npm # npm
node_modules/ node_modules/

View File

@@ -10,25 +10,15 @@ build:
tools: tools:
python: "miniconda-latest" python: "miniconda-latest"
commands: commands:
# because we are overriding the build commands, we need to setup the environment ourselves
- cat third-party/doxyconfig/environment.yml
- conda env create --quiet --name ${READTHEDOCS_VERSION} --file third-party/doxyconfig/environment.yml
- npm install "@fortawesome/fontawesome-free"
- mkdir -p ${READTHEDOCS_OUTPUT}html/assets/fontawesome/css
- mkdir -p ${READTHEDOCS_OUTPUT}html/assets/fontawesome/js
- cp node_modules/@fortawesome/fontawesome-free/css/all.min.css ${READTHEDOCS_OUTPUT}html/assets/fontawesome/css
- cp node_modules/@fortawesome/fontawesome-free/js/all.min.js ${READTHEDOCS_OUTPUT}html/assets/fontawesome/js
- cp -r node_modules/@fortawesome/fontawesome-free/webfonts ${READTHEDOCS_OUTPUT}html/assets/fontawesome/
- | - |
wget "https://raw.githubusercontent.com/LizardByte/.github/master/branding/logos/favicon.ico" \ if [ -f readthedocs_build.sh ]; then
-O ${READTHEDOCS_OUTPUT}lizardbyte.ico doxyconfig_dir="."
- | else
wget "https://raw.githubusercontent.com/LizardByte/.github/master/branding/logos/logo-128x128.png" \ doxyconfig_dir="./third-party/doxyconfig"
-O ${READTHEDOCS_OUTPUT}lizardbyte.png fi
- cp ./third-party/doxyconfig/Doxyfile ./docs/Doxyfile-doxyconfig chmod +x "${doxyconfig_dir}/readthedocs_build.sh"
- cp ./third-party/doxyconfig/header.html ./docs/header-doxyconfig.html export DOXYCONFIG_DIR="${doxyconfig_dir}"
- cat ./docs/Doxyfile >> ./docs/Doxyfile-doxyconfig "${doxyconfig_dir}/readthedocs_build.sh"
- cd docs && doxygen Doxyfile-doxyconfig
# using conda, we can get newer doxygen and graphviz than ubuntu provide # using conda, we can get newer doxygen and graphviz than ubuntu provide
# https://github.com/readthedocs/readthedocs.org/issues/8151#issuecomment-890359661 # https://github.com/readthedocs/readthedocs.org/issues/8151#issuecomment-890359661

View File

@@ -409,21 +409,6 @@ namespace config {
boost::asio::ip::host_name(), // sunshine_name, boost::asio::ip::host_name(), // sunshine_name,
"sunshine_state.json"s, // file_state "sunshine_state.json"s, // file_state
{}, // external_ip {}, // 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 { input_t input {
@@ -1046,8 +1031,6 @@ namespace config {
path_f(vars, "credentials_file", config::sunshine.credentials_file); path_f(vars, "credentials_file", config::sunshine.credentials_file);
string_f(vars, "external_ip", nvhttp.external_ip); 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); list_prep_cmd_f(vars, "global_prep_cmd", config::sunshine.prep_cmds);
string_f(vars, "audio_sink", audio.sink); string_f(vars, "audio_sink", audio.sink);

View File

@@ -117,8 +117,6 @@ namespace config {
std::string file_state; std::string file_state;
std::string external_ip; std::string external_ip;
std::vector<std::string> resolutions;
std::vector<int> fps;
}; };
struct input_t { struct input_t {

View File

@@ -734,31 +734,6 @@ namespace nvhttp {
} }
tree.put("root.ServerCodecModeSupport", codec_mode_flags); 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(); auto current_appid = proc::proc.running();
tree.put("root.PairStatus", pair_status); tree.put("root.PairStatus", pair_status);
tree.put("root.currentgame", current_appid); tree.put("root.currentgame", current_appid);

View File

@@ -53,8 +53,6 @@
v-if="currentTab === 'av'" v-if="currentTab === 'av'"
:config="config" :config="config"
:platform="platform" :platform="platform"
:resolutions="resolutions"
:fps="fps"
> >
</audio-video> </audio-video>
@@ -132,8 +130,6 @@
saved: false, saved: false,
restarted: false, restarted: false,
config: null, config: null,
fps: [],
resolutions: [],
currentTab: "general", currentTab: "general",
global_prep_cmd: [], global_prep_cmd: [],
tabs: [ // TODO: Move the options to each Component instead, encapsulate. tabs: [ // TODO: Move the options to each Component instead, encapsulate.
@@ -180,8 +176,6 @@
"auto_capture_sink": "enabled", "auto_capture_sink": "enabled",
"adapter_name": "", "adapter_name": "",
"output_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, "min_fps_factor": 1,
}, },
}, },
@@ -326,16 +320,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.config.global_prep_cmd = this.config.global_prep_cmd || [];
this.global_prep_cmd = JSON.parse(this.config.global_prep_cmd); this.global_prep_cmd = JSON.parse(this.config.global_prep_cmd);
}); });
@@ -345,16 +329,6 @@
this.$forceUpdate() this.$forceUpdate()
}, },
serialize() { 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); this.config.global_prep_cmd = JSON.stringify(this.global_prep_cmd);
}, },
save() { save() {
@@ -370,19 +344,11 @@
Object.keys(tab.options).forEach(optionKey => { Object.keys(tab.options).forEach(optionKey => {
let delete_value = false let delete_value = false
if (["resolutions", "fps", "global_prep_cmd"].includes(optionKey)) { if (["global_prep_cmd"].includes(optionKey)) {
let config_value, default_value let config_value, default_value
if (optionKey === "resolutions") { config_value = JSON.parse(config[optionKey])
let regex = /([\d]+x[\d]+)/g default_value = JSON.parse(tab.options[optionKey])
// 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])
}
if (config_value === default_value) { if (config_value === default_value) {
delete_value = true delete_value = true

View File

@@ -11,8 +11,6 @@ import DisplayModesSettings from "./audiovideo/DisplayModesSettings.vue";
const props = defineProps([ const props = defineProps([
'platform', 'platform',
'config', 'config',
'resolutions',
'fps',
'min_fps_factor', 'min_fps_factor',
]) ])
@@ -97,8 +95,6 @@ const config = ref(props.config)
<DisplayModesSettings <DisplayModesSettings
:platform="platform" :platform="platform"
:config="config" :config="config"
:resolutions="resolutions"
:fps="fps"
:min_fps_factor="min_fps_factor" :min_fps_factor="min_fps_factor"
/> />

View File

@@ -6,14 +6,10 @@ import PlatformLayout from '../../../PlatformLayout.vue'
const props = defineProps([ const props = defineProps([
'platform', 'platform',
'config', 'config',
'resolutions',
'fps',
'min_fps_factor', 'min_fps_factor',
]) ])
const config = ref(props.config) const config = ref(props.config)
const resolutions = ref(props.resolutions)
const fps = ref(props.fps)
const resIn = ref("") const resIn = ref("")
const fpsIn = ref("") const fpsIn = ref("")
@@ -21,50 +17,6 @@ const fpsIn = ref("")
<template> <template>
<div class="mb-3"> <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)">&times;</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)">&times;</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--> <!--min_fps_factor-->
<div class="mb-3"> <div class="mb-3">
<label for="qp" class="form-label">{{ $t('config.min_fps_factor') }}</label> <label for="qp" class="form-label">{{ $t('config.min_fps_factor') }}</label>

View File

@@ -164,7 +164,6 @@
"file_apps_desc": "The file where current apps of Apollo are stored.", "file_apps_desc": "The file where current apps of Apollo are stored.",
"file_state": "State File", "file_state": "State File",
"file_state_desc": "The file where current state of Apollo is stored", "file_state_desc": "The file where current state of Apollo is stored",
"fps": "Advertised FPS",
"gamepad": "Emulated Gamepad Type", "gamepad": "Emulated Gamepad Type",
"gamepad_auto": "Automatic selection options", "gamepad_auto": "Automatic selection options",
"gamepad_desc": "Choose which type of gamepad to emulate on the host", "gamepad_desc": "Choose which type of gamepad to emulate on the host",
@@ -285,8 +284,6 @@
"qsv_preset_veryfast": "fastest (lowest quality)", "qsv_preset_veryfast": "fastest (lowest quality)",
"qsv_slow_hevc": "Allow Slow HEVC Encoding", "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.", "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 Apollo. 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": "Apollo is restarting to apply changes.", "restart_note": "Apollo is restarting to apply changes.",
"sunshine_name": "Apollo Name", "sunshine_name": "Apollo Name",
"sunshine_name_desc": "The name displayed by Moonlight. If not specified, the PC's hostname is used", "sunshine_name_desc": "The name displayed by Moonlight. If not specified, the PC's hostname is used",