mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-15 11:25:13 +00:00
3e7137cc6b
* added discord rpc
* linting issues
* Revert "linting issues"
This reverts commit 55f4e39506
.
* fix clang-format issues
* removed wrong rpc submodule
* added correct rpc submodule
* Moved cmake instructions to correct files.
* added minor suggestions from pr
* Added an option to enable/disable RPC, added rpc to emulator.cpp making it work on nonqt builds
* typo & minor stuff
* Changed getInstance implementation with Singleton class.
* Update discord_rpc_handler.cpp
discord id
* fixed ci clangformat errors
---------
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
31 lines
593 B
C++
31 lines
593 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <discord_rpc.h>
|
|
|
|
namespace DiscordRPCHandler {
|
|
|
|
enum class RPCStatus {
|
|
Idling,
|
|
Playing,
|
|
};
|
|
|
|
class RPC {
|
|
std::uint64_t startTimestamp;
|
|
bool rpcEnabled = false;
|
|
RPCStatus status;
|
|
|
|
public:
|
|
void init();
|
|
void setStatusIdling();
|
|
void setStatusPlaying(const std::string& game_name, const std::string& game_id);
|
|
void shutdown();
|
|
bool getRPCEnabled();
|
|
};
|
|
|
|
} // namespace DiscordRPCHandler
|