Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
settings_storage.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <string>
9#include <vector>
10
11// local includes
13
14namespace app {
15
19 struct AppSettings {
20 logging::LogLevel loggingLevel = logging::LogLevel::none;
21 logging::LogLevel xemuConsoleLoggingLevel = logging::LogLevel::none;
22 app::LogViewerPlacement logViewerPlacement = app::LogViewerPlacement::full;
23 VIDEO_MODE preferredVideoMode {};
24 bool preferredVideoModeSet = false;
25 int streamFramerate = 30;
26 int streamBitrateKbps = 1000;
27 bool playAudioOnPc = false;
28 bool showPerformanceStats = false;
29 bool playAudioOnXbox = true;
30 };
31
37 std::vector<std::string> warnings;
38 bool fileFound = false;
39 bool cleanupRequired = false;
40 };
41
46 bool success = false;
47 std::string errorMessage;
48 };
49
55 std::string default_settings_path();
56
63 LoadAppSettingsResult load_app_settings(const std::string &filePath = default_settings_path());
64
72 SaveAppSettingsResult save_app_settings(const AppSettings &settings, const std::string &filePath = default_settings_path());
73
74} // namespace app
Declares client state models and transitions.
LogViewerPlacement
Layout options for the embedded log viewer.
Definition client_state.h:62
LogLevel
Severity levels used by the Moonlight client logger.
Definition logger.h:22
LoadAppSettingsResult load_app_settings(const std::string &filePath)
Load the persisted Moonlight settings file.
Definition settings_storage.cpp:442
SaveAppSettingsResult save_app_settings(const AppSettings &settings, const std::string &filePath)
Save the persisted Moonlight settings file.
Definition settings_storage.cpp:500
std::string default_settings_path()
Return the default path used for the persisted Moonlight settings file.
Definition settings_storage.cpp:438
Persisted Moonlight user settings stored in TOML.
Definition settings_storage.h:19
bool preferredVideoModeSet
True when preferredVideoMode contains a saved user preference.
Definition settings_storage.h:24
int streamBitrateKbps
Preferred stream bitrate in kilobits per second.
Definition settings_storage.h:26
bool playAudioOnPc
True when the host PC should continue local audio playback during streaming.
Definition settings_storage.h:27
logging::LogLevel loggingLevel
Minimum runtime log level written to the log file.
Definition settings_storage.h:20
logging::LogLevel xemuConsoleLoggingLevel
Minimum runtime log level written through DbgPrint() for xemu's serial console.
Definition settings_storage.h:21
bool showPerformanceStats
True when stream telemetry should be shown after streaming ends.
Definition settings_storage.h:28
app::LogViewerPlacement logViewerPlacement
Preferred placement for the in-app log viewer.
Definition settings_storage.h:22
int streamFramerate
Preferred stream frame rate in frames per second.
Definition settings_storage.h:25
VIDEO_MODE preferredVideoMode
Preferred stream resolution requested from the host.
Definition settings_storage.h:23
bool playAudioOnXbox
True when the Xbox should decode and play streamed audio locally.
Definition settings_storage.h:29
Result of loading the persisted Moonlight settings file.
Definition settings_storage.h:35
std::vector< std::string > warnings
Non-fatal warnings encountered while loading the file.
Definition settings_storage.h:37
bool fileFound
True when the settings file existed on disk.
Definition settings_storage.h:38
bool cleanupRequired
True when legacy or unknown keys should be removed by rewriting the file.
Definition settings_storage.h:39
AppSettings settings
Loaded settings, or defaults when the file is missing or invalid.
Definition settings_storage.h:36
Result of saving the persisted Moonlight settings file.
Definition settings_storage.h:45
std::string errorMessage
Error detail when writing failed.
Definition settings_storage.h:47
bool success
True when the settings file was written successfully.
Definition settings_storage.h:46