|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Multi-threaded Steam process monitor. More...
#include <steam_monitor.h>
Public Types | |
| enum class | State { NOT_RUNNING , STARTING , RUNNING , STOPPING , ERROR } |
| using | StateCallback = std::function<void(State oldState, State newState)> |
Public Member Functions | |
| State | getCurrentState () const |
| bool | isSteamFullyInitialized () const |
| bool | isSteamRunning () const |
| void | requestSteamShutdown () |
| void | requestSteamStart () |
| void | setStateCallback (StateCallback callback) |
| void | startMonitoring () |
| void | stopMonitoring () |
| bool | waitForState (State targetState, int timeoutMs=10000) |
| bool | waitForSteamInitialized (int timeoutMs=10000) |
Static Public Member Functions | |
| static SteamProcessMonitor & | instance () |
Multi-threaded Steam process monitor.
Monitors Steam process state in a dedicated thread and provides callbacks for state transitions. Handles Steam start/stop requests and verifies completion by watching the actual process.
Definition at line 18 of file steam_monitor.h.
| using SteamProcessMonitor::StateCallback = std::function<void(State oldState, State newState)> |
Definition at line 31 of file steam_monitor.h.
|
strong |
| Enumerator | |
|---|---|
| NOT_RUNNING | |
| STARTING | |
| RUNNING | |
| STOPPING | |
| ERROR | |
Definition at line 21 of file steam_monitor.h.
| SteamProcessMonitor::State SteamProcessMonitor::getCurrentState | ( | ) | const |
Definition at line 166 of file steam_monitor.cpp.
Referenced by core::LaunchController::isSteamRunning().
|
static |
Definition at line 14 of file steam_monitor.cpp.
References instance().
Referenced by MainWindow::MainWindow(), MainWindow::~MainWindow(), core::LaunchController::getSteamStateDescription(), instance(), core::LaunchController::isSteamRunning(), and core::LaunchController::requestSteamStart().
| bool SteamProcessMonitor::isSteamFullyInitialized | ( | ) | const |
Definition at line 176 of file steam_monitor.cpp.
References SteamPaths::getPrimarySteamRoot(), ProcessExecutor::isProcessRunning(), and RUNNING.
Referenced by waitForSteamInitialized().
| bool SteamProcessMonitor::isSteamRunning | ( | ) | const |
Definition at line 171 of file steam_monitor.cpp.
References RUNNING.
| void SteamProcessMonitor::requestSteamShutdown | ( | ) |
Definition at line 126 of file steam_monitor.cpp.
References ProcessExecutor::execute(), Logger::info(), NOT_RUNNING, and STOPPING.
| void SteamProcessMonitor::requestSteamStart | ( | ) |
Definition at line 98 of file steam_monitor.cpp.
References ProcessExecutor::executeBackground(), Logger::info(), RUNNING, and STARTING.
Referenced by core::LaunchController::requestSteamStart().
| void SteamProcessMonitor::setStateCallback | ( | StateCallback | callback | ) |
Definition at line 251 of file steam_monitor.cpp.
| void SteamProcessMonitor::startMonitoring | ( | ) |
Definition at line 40 of file steam_monitor.cpp.
References Logger::info(), NOT_RUNNING, and RUNNING.
Referenced by MainWindow::MainWindow().
| void SteamProcessMonitor::stopMonitoring | ( | ) |
Definition at line 64 of file steam_monitor.cpp.
References Logger::info().
Referenced by MainWindow::~MainWindow().
| bool SteamProcessMonitor::waitForState | ( | State | targetState, |
| int | timeoutMs = 10000 ) |
Definition at line 154 of file steam_monitor.cpp.
| bool SteamProcessMonitor::waitForSteamInitialized | ( | int | timeoutMs = 10000 | ) |
Definition at line 217 of file steam_monitor.cpp.
References Logger::info(), isSteamFullyInitialized(), and Logger::warn().