game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
GameProcessManager Class Reference

#include <game_process.h>

Classes

struct  ProcessSnapshot

Public Types

using GameAccessCallback

Public Member Functions

std::chrono::seconds getGameSessionDuration (const std::string &gameId) const
int getLastExitCode (const std::string &gameId, int defaultCode=0) const
std::function< void(const std::string &)> getOnGameStatsUpdated () const
std::function< void(GameProcess::NotificationType, const std::string &)> getOnNotification () const
std::vector< std::string > getRunningGameIds () const
const GameProcess * getRunningProcess (const std::string &gameId) const
ProcessSnapshot getRunningProcessSnapshot (const std::string &gameId) const
bool isGameRunning (const std::string &gameId) const
bool launchGame (const std::string &gameId, Game &game)
void scanForRunningGames (const std::vector< Game * > &games, GameAccessCallback gameAccessCallback)
void setOnGameStatsUpdated (std::function< void(const std::string &gameId)> callback)
void setOnNotification (std::function< void(GameProcess::NotificationType, const std::string &)> callback)
bool stopGame (const std::string &gameId, Game *game=nullptr, bool force=false)
void update ()

Static Public Member Functions

static GameProcessManager & instance ()

Detailed Description

Definition at line 389 of file game_process.h.

Member Typedef Documentation

◆ GameAccessCallback

Initial value:
std::function<void(const std::string& gameId, std::function<void(Game&)>)>
Complete representation of a game in the library.
Definition game.h:767

Definition at line 444 of file game_process.h.

Member Function Documentation

◆ getGameSessionDuration()

std::chrono::seconds GameProcessManager::getGameSessionDuration ( const std::string & gameId) const

Definition at line 5027 of file game_process.cpp.

References PipeHandle::get().

Referenced by core::LaunchController::getSessionDuration().

◆ getLastExitCode()

int GameProcessManager::getLastExitCode ( const std::string & gameId,
int defaultCode = 0 ) const

Definition at line 5113 of file game_process.cpp.

Referenced by core::LaunchController::update().

◆ getOnGameStatsUpdated()

std::function< void(const std::string &)> GameProcessManager::getOnGameStatsUpdated ( ) const

Definition at line 4649 of file game_process.cpp.

Referenced by update().

◆ getOnNotification()

std::function< void(GameProcess::NotificationType, const std::string &)> GameProcessManager::getOnNotification ( ) const

Definition at line 4643 of file game_process.cpp.

◆ getRunningGameIds()

std::vector< std::string > GameProcessManager::getRunningGameIds ( ) const

◆ getRunningProcess()

const GameProcess * GameProcessManager::getRunningProcess ( const std::string & gameId) const

◆ getRunningProcessSnapshot()

◆ instance()

◆ isGameRunning()

bool GameProcessManager::isGameRunning ( const std::string & gameId) const

◆ launchGame()

◆ scanForRunningGames()

void GameProcessManager::scanForRunningGames ( const std::vector< Game * > & games,
GameAccessCallback gameAccessCallback )

◆ setOnGameStatsUpdated()

void GameProcessManager::setOnGameStatsUpdated ( std::function< void(const std::string &gameId)> callback)

Definition at line 4635 of file game_process.cpp.

Referenced by MainWindow::MainWindow(), and MainWindow::~MainWindow().

◆ setOnNotification()

void GameProcessManager::setOnNotification ( std::function< void(GameProcess::NotificationType, const std::string &)> callback)

Definition at line 4628 of file game_process.cpp.

Referenced by main().

◆ stopGame()

◆ update()


The documentation for this class was generated from the following files: