|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Handles the system tray icon and notification system. More...
Functions | |
| void | clear_tray_notification () |
| Clear notification fields before replacing the tray state. | |
| int | end_tray () |
| Exit the system tray. | |
| const char * | GetResourcePath (const char *relativePath) |
| Get resource path. | |
| int | init_tray () |
| Initializes the system tray without starting a loop. | |
| int | init_tray_threaded () |
| Initializes and runs the system tray in a separate thread. | |
| int | init_tray_with_stop_token (const std::stop_token stop_token) |
| Initialize the tray, optionally observing an owning thread's stop request. | |
| std::array< struct tray_menu, 11 > | initial_virtualhid_license_menu () |
| Create the initial Virtual HID Driver license submenu. | |
| void | prepare_tray_virtualhid_license () |
| Query the Virtual HID Driver license and prepare the startup tray state. | |
| int | process_tray_events () |
| Processes a single tray event iteration. | |
| void | rebuild_virtualhid_license_menu (const lvh::LicenseStatus &license) |
| Rebuild the Virtual HID Driver submenu for the latest license state. | |
| void | resolve_tray_icon_paths () |
| Resolve tray icons against the current executable or application bundle. | |
| template<typename Callback = std::nullptr_t> | |
| void | set_virtualhid_license_menu_item (const std::size_t index, std::string text, const bool disabled, Callback callback=nullptr) |
| Assign text and behavior to one Virtual HID Driver submenu item. | |
| void | tray_donate_github_cb (struct tray_menu *item) |
| Callback for opening GitHub Sponsors from the system tray. | |
| void | tray_donate_patreon_cb (struct tray_menu *item) |
| Callback for opening Patreon from the system tray. | |
| void | tray_donate_paypal_cb (struct tray_menu *item) |
| Callback for opening PayPal donation from the system tray. | |
| void | tray_open_ui_cb (struct tray_menu *item) |
| Callback for opening the UI from the system tray. | |
| void | tray_quit_cb (struct tray_menu *item) |
| Callback for exiting Sunshine from the system tray. | |
| void | tray_reset_display_device_config_cb (struct tray_menu *item) |
| Callback for resetting display device configuration. | |
| void | tray_restart_cb (struct tray_menu *item) |
| Callback for restarting Sunshine from the system tray. | |
| void | tray_virtualhid_download_cb (struct tray_menu *item) |
| Callback for opening the latest Virtual HID Driver release. | |
| void | tray_virtualhid_license_cb (struct tray_menu *item) |
| Callback for opening Virtual HID Driver license settings in the Web UI. | |
| void | update_tray_pausing (std::string app_name) |
| Sets the tray icon in pausing mode (stream stopped but app running) and spawns the appropriate notification. | |
| void | update_tray_playing (std::string app_name) |
| Sets the tray icon in playing mode and spawns the appropriate notification. | |
| void | update_tray_require_pin () |
| Spawns a notification for PIN Pairing. Clicking it opens the PIN Web UI Page. | |
| void | update_tray_stopped (std::string app_name) |
| Sets the tray icon in stopped mode (app and stream stopped) and spawns the appropriate notification. | |
| void | update_tray_virtualhid_license (const lvh::LicenseStatus &license, bool notify_if_unlicensed) |
| Update the Virtual HID Driver license submenu and optional notification. | |
| std::string_view | virtualhid_license_state_detail (lvh::LicenseState state) |
| Return explanatory tray text for a non-active license state. | |
| std::string_view | virtualhid_license_state_label (lvh::LicenseState state) |
| Return the user-visible label for a Virtual HID Driver license state. | |
Variables | |
| constexpr auto | LIBVIRTUALHID_RELEASES_URL = "https://github.com/LizardByte/libvirtualhid/releases/latest"sv |
| Latest Virtual HID Driver release. | |
Handles the system tray icon and notification system.
| int system_tray::end_tray | ( | ) |
Exit the system tray.
| const char * system_tray::GetResourcePath | ( | const char * | relativePath | ) |
Get resource path.
| relativePath | Relative path. |
| int system_tray::init_tray | ( | ) |
Initializes the system tray without starting a loop.
| int system_tray::init_tray_threaded | ( | ) |
Initializes and runs the system tray in a separate thread.
| int system_tray::init_tray_with_stop_token | ( | const std::stop_token | stop_token | ) |
Initialize the tray, optionally observing an owning thread's stop request.
| stop_token | Stop token supplied by the managed tray worker, or an empty token for direct initialization. |
| std::array< struct tray_menu, 11 > system_tray::initial_virtualhid_license_menu | ( | ) |
Create the initial Virtual HID Driver license submenu.
| int system_tray::process_tray_events | ( | ) |
Processes a single tray event iteration.
| void system_tray::rebuild_virtualhid_license_menu | ( | const lvh::LicenseStatus & | license | ) |
Rebuild the Virtual HID Driver submenu for the latest license state.
| license | Latest machine license details. |
| void system_tray::set_virtualhid_license_menu_item | ( | const std::size_t | index, |
| std::string | text, | ||
| const bool | disabled, | ||
| Callback | callback = nullptr ) |
Assign text and behavior to one Virtual HID Driver submenu item.
| Callback | Callback type accepted by the tray library. |
| index | Submenu index to populate. |
| text | User-visible menu text. |
| disabled | Whether the item is informational rather than actionable. |
| callback | Callback invoked for actionable items. |
| void system_tray::tray_donate_github_cb | ( | struct tray_menu * | item | ) |
Callback for opening GitHub Sponsors from the system tray.
| item | The tray menu item. |
| void system_tray::tray_donate_patreon_cb | ( | struct tray_menu * | item | ) |
Callback for opening Patreon from the system tray.
| item | The tray menu item. |
| void system_tray::tray_donate_paypal_cb | ( | struct tray_menu * | item | ) |
Callback for opening PayPal donation from the system tray.
| item | The tray menu item. |
| void system_tray::tray_open_ui_cb | ( | struct tray_menu * | item | ) |
Callback for opening the UI from the system tray.
| item | The tray menu item. |
| void system_tray::tray_quit_cb | ( | struct tray_menu * | item | ) |
Callback for exiting Sunshine from the system tray.
| item | The tray menu item. |
| void system_tray::tray_reset_display_device_config_cb | ( | struct tray_menu * | item | ) |
Callback for resetting display device configuration.
| item | The tray menu item. |
| void system_tray::tray_restart_cb | ( | struct tray_menu * | item | ) |
Callback for restarting Sunshine from the system tray.
| item | The tray menu item. |
| void system_tray::tray_virtualhid_download_cb | ( | struct tray_menu * | item | ) |
Callback for opening the latest Virtual HID Driver release.
| item | The tray menu item. |
| void system_tray::tray_virtualhid_license_cb | ( | struct tray_menu * | item | ) |
Callback for opening Virtual HID Driver license settings in the Web UI.
| item | The tray menu item. |
| void system_tray::update_tray_pausing | ( | std::string | app_name | ) |
Sets the tray icon in pausing mode (stream stopped but app running) and spawns the appropriate notification.
| app_name | The paused application name |
| void system_tray::update_tray_playing | ( | std::string | app_name | ) |
Sets the tray icon in playing mode and spawns the appropriate notification.
| app_name | The started application name |
| void system_tray::update_tray_stopped | ( | std::string | app_name | ) |
Sets the tray icon in stopped mode (app and stream stopped) and spawns the appropriate notification.
| app_name | The started application name |
| void system_tray::update_tray_virtualhid_license | ( | const lvh::LicenseStatus & | license, |
| bool | notify_if_unlicensed ) |
Update the Virtual HID Driver license submenu and optional notification.
| license | Latest machine license details. |
| notify_if_unlicensed | Whether to notify the user when the machine is not activated. |
| std::string_view system_tray::virtualhid_license_state_detail | ( | lvh::LicenseState | state | ) |
Return explanatory tray text for a non-active license state.
| state | License state reported by libvirtualhid. |
| std::string_view system_tray::virtualhid_license_state_label | ( | lvh::LicenseState | state | ) |
Return the user-visible label for a Virtual HID Driver license state.
| state | License state reported by libvirtualhid. |