![]() |
Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
|
Declares client state models and transitions. More...
#include <cstddef>#include <string>#include <vector>#include <hal/video.h>#include "src/app/host_records.h"#include "src/app/pairing_flow.h"#include "src/input/navigation_input.h"#include "src/logging/logger.h"#include "src/startup/saved_files.h"#include "src/ui/menu_model.h"Go to the source code of this file.
Classes | |
| struct | app::AddHostDraft |
| Controller-friendly draft state for manual host entry. More... | |
| struct | app::AddHostKeypadState |
| Controller selection state for the add-host keypad modal. More... | |
| struct | app::AppNavigationUpdate |
| Navigation and modal effects emitted by one command update. More... | |
| struct | app::AppPersistenceUpdate |
| Persistence and cleanup side effects emitted by one command update. More... | |
| struct | app::AppRequestUpdate |
| Network and browsing requests emitted by one command update. More... | |
| struct | app::AppsState |
| State owned by the per-host apps browser. More... | |
| struct | app::AppUpdate |
| Result of updating the client shell with a UI command. More... | |
| struct | app::ClientState |
| Serializable app state for the menu-driven client shell. More... | |
| struct | app::ConfirmationDialogState |
| Content shown by the destructive-action confirmation dialog. More... | |
| struct | app::HostsState |
| State owned by the saved-host browser and retained host snapshot. More... | |
| struct | app::ModalState |
| Context modal state shared by the hosts and apps pages. More... | |
| struct | app::SettingsState |
| State owned by the settings, log viewer, and saved-file workflows. More... | |
| struct | app::ShellState |
| Shell-wide state that is not owned by a specific workflow screen. More... | |
Enumerations | |
| enum class | app::AddHostField { address , port } |
| Active field for keypad-based host entry. More... | |
| enum class | app::ConfirmationAction { none , delete_saved_file , factory_reset } |
| Destructive confirmation requests surfaced in a modal popup. More... | |
| enum class | app::HostsFocusArea { toolbar , grid } |
| Focus areas on the hosts page. More... | |
| enum class | app::LogViewerPlacement { full , left , right } |
| Layout options for the embedded log viewer. More... | |
| enum class | app::ModalId { none , support , host_actions , host_details , app_actions , app_details , confirmation , log_viewer } |
| Active modal surfaced on top of the current page. More... | |
| enum class | app::ScreenId { home , hosts , apps , add_host , pair_host , settings } |
| Top-level screens used by the Moonlight client shell. More... | |
| enum class | app::SettingsCategory { logging , display , input , reset } |
| Top-level categories shown on the left side of the settings screen. More... | |
| enum class | app::SettingsFocusArea { categories , options } |
| Focus areas used by the two-pane settings screen. More... | |
Functions | |
| void | app::apply_app_list_result (ClientState &state, const std::string &address, uint16_t port, std::vector< HostAppRecord > apps, uint64_t appListContentHash, bool success, std::string message) |
| Apply a fetched app list to a saved host. | |
| void | app::apply_connection_test_result (ClientState &state, bool success, std::string message) |
| Apply the result of a host connection test to the current shell state. | |
| void | app::apply_log_viewer_contents (ClientState &state, std::vector< std::string > lines, std::string statusMessage) |
| Replace the loaded log viewer contents. | |
| bool | app::apply_pairing_result (ClientState &state, const std::string &address, uint16_t port, bool success, std::string message) |
| Apply the result of a pairing attempt to the current shell state. | |
| const HostRecord * | app::apps_host (const ClientState &state) |
| Return the host currently shown by the Apps screen. | |
| bool | app::begin_selected_host_app_browse (ClientState &state, bool showHiddenApps) |
| Enter the apps screen for the currently selected host after authorization has been refreshed. | |
| ClientState | app::create_initial_state () |
| Create the initial app state shown after startup. | |
| std::string | app::current_add_host_address (const ClientState &state) |
| Return the current host address shown in the add-host flow. | |
| uint16_t | app::current_add_host_port (const ClientState &state) |
| Return the effective TCP port for the current add-host draft. | |
| std::string | app::current_pairing_pin (const ClientState &state) |
| Return the current pairing PIN shown in the pairing flow. | |
| AppUpdate | app::handle_command (ClientState &state, input::UiCommand command) |
| Apply a UI command to the client shell. | |
| bool | app::host_requires_manual_pairing (const ClientState &state, const std::string &address, uint16_t port) |
| Return whether a saved host still requires a manual pairing flow. | |
| void | app::mark_cover_art_cached (ClientState &state, const std::string &address, uint16_t port, int appId) |
| Mark one cached cover-art entry as available for a host app. | |
| bool | app::merge_discovered_host (ClientState &state, std::string displayName, const std::string &address, uint16_t port) |
| Add or refresh one auto-discovered host in the current host list. | |
| void | app::replace_hosts (ClientState &state, std::vector< HostRecord > hosts, std::string statusMessage={}) |
| Replace the in-memory host list from a persisted snapshot. | |
| void | app::replace_saved_files (ClientState &state, std::vector< startup::SavedFileEntry > savedFiles) |
| Replace the in-memory saved-file inventory shown on the settings page. | |
| const HostAppRecord * | app::selected_app (const ClientState &state) |
| Return the currently selected app on the Apps screen. | |
| const HostRecord * | app::selected_host (const ClientState &state) |
| Return the currently selected loaded host for the active screen. | |
| void | app::set_log_file_path (ClientState &state, std::string logFilePath) |
| Update the log file path tracked by the shell. | |
| const char * | app::to_string (ScreenId screen) |
| Return a display label for a screen identifier. | |
Declares client state models and transitions.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Active modal surfaced on top of the current page.
|
strong |
Top-level screens used by the Moonlight client shell.
|
strong |
|
strong |
| void app::apply_app_list_result | ( | ClientState & | state, |
| const std::string & | address, | ||
| uint16_t | port, | ||
| std::vector< HostAppRecord > | apps, | ||
| uint64_t | appListContentHash, | ||
| bool | success, | ||
| std::string | message ) |
Apply a fetched app list to a saved host.
| state | Mutable app state. |
| address | Host address used for the fetch. |
| port | Host port used for the fetch. |
| apps | Fresh app records returned by the host. |
| appListContentHash | Stable content hash for the returned app list. |
| success | Whether the fetch succeeded. |
| message | User-visible status message. |
| void app::apply_connection_test_result | ( | ClientState & | state, |
| bool | success, | ||
| std::string | message ) |
Apply the result of a host connection test to the current shell state.
| state | Mutable app state. |
| success | Whether the test succeeded. |
| message | User-visible status message. |
| void app::apply_log_viewer_contents | ( | ClientState & | state, |
| std::vector< std::string > | lines, | ||
| std::string | statusMessage ) |
Replace the loaded log viewer contents.
| state | Mutable app state. |
| lines | Log file lines ready for display. |
| statusMessage | User-visible status line for the log viewer state. |
| bool app::apply_pairing_result | ( | ClientState & | state, |
| const std::string & | address, | ||
| uint16_t | port, | ||
| bool | success, | ||
| std::string | message ) |
Apply the result of a pairing attempt to the current shell state.
| state | Mutable app state. |
| address | Host address used for pairing. |
| port | Host port used for pairing. |
| success | Whether the pairing attempt succeeded. |
| message | User-visible status message. |
| const HostRecord * app::apps_host | ( | const ClientState & | state | ) |
Return the host currently shown by the Apps screen.
| state | App state containing the selected host. |
| bool app::begin_selected_host_app_browse | ( | ClientState & | state, |
| bool | showHiddenApps ) |
Enter the apps screen for the currently selected host after authorization has been refreshed.
| state | Mutable app state. |
| showHiddenApps | Whether hidden apps should still be shown. |
| ClientState app::create_initial_state | ( | ) |
Create the initial app state shown after startup.
| std::string app::current_add_host_address | ( | const ClientState & | state | ) |
Return the current host address shown in the add-host flow.
| state | App state containing the add-host draft. |
| uint16_t app::current_add_host_port | ( | const ClientState & | state | ) |
Return the effective TCP port for the current add-host draft.
| state | App state containing the add-host draft. |
| std::string app::current_pairing_pin | ( | const ClientState & | state | ) |
Return the current pairing PIN shown in the pairing flow.
| state | App state containing the pairing draft. |
| AppUpdate app::handle_command | ( | ClientState & | state, |
| input::UiCommand | command ) |
Apply a UI command to the client shell.
| state | Mutable app state. |
| command | UI command from controller or keyboard input. |
| bool app::host_requires_manual_pairing | ( | const ClientState & | state, |
| const std::string & | address, | ||
| uint16_t | port ) |
Return whether a saved host still requires a manual pairing flow.
| state | App state containing the saved host list. |
| address | Host address to inspect. |
| port | Host port to inspect. |
| void app::mark_cover_art_cached | ( | ClientState & | state, |
| const std::string & | address, | ||
| uint16_t | port, | ||
| int | appId ) |
Mark one cached cover-art entry as available for a host app.
| state | Mutable app state. |
| address | Host address owning the app. |
| port | Host port owning the app. |
| appId | App identifier whose cached art is now available. |
| bool app::merge_discovered_host | ( | ClientState & | state, |
| std::string | displayName, | ||
| const std::string & | address, | ||
| uint16_t | port ) |
Add or refresh one auto-discovered host in the current host list.
Discovery results are normalized to the same saved-host conventions used by manual host entry. When a matching host already exists, transient runtime fields such as reachability are refreshed without overwriting a custom saved name. When no host matches, a new host record is appended and marked dirty so it can be persisted.
| state | Mutable app state. |
| displayName | Discovered host name, or an empty string to use the default label. |
| address | Discovered IPv4 address. |
| port | Discovered host HTTP port. |
| void app::replace_hosts | ( | ClientState & | state, |
| std::vector< HostRecord > | hosts, | ||
| std::string | statusMessage = {} ) |
Replace the in-memory host list from a persisted snapshot.
| state | Mutable app state. |
| hosts | Loaded host records. |
| statusMessage | Optional status line shown in the shell. |
| void app::replace_saved_files | ( | ClientState & | state, |
| std::vector< startup::SavedFileEntry > | savedFiles ) |
Replace the in-memory saved-file inventory shown on the settings page.
| state | Mutable app state. |
| savedFiles | Saved files currently found on disk. |
| const HostAppRecord * app::selected_app | ( | const ClientState & | state | ) |
Return the currently selected app on the Apps screen.
| state | App state containing the selected host and apps list. |
| const HostRecord * app::selected_host | ( | const ClientState & | state | ) |
Return the currently selected loaded host for the active screen.
On the hosts page this returns the selected saved host tile. On host-specific pages such as pairing it may return the lightweight active host snapshot.
| state | App state containing the loaded host selection. |
| void app::set_log_file_path | ( | ClientState & | state, |
| std::string | logFilePath ) |
Update the log file path tracked by the shell.
| state | Mutable app state. |
| logFilePath | Path to the log file that should be shown in the viewer. |
| const char * app::to_string | ( | ScreenId | screen | ) |
Return a display label for a screen identifier.
| screen | Screen identifier to stringify. |