2024-02-23 21:32:32 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2023-08-11 17:22:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
2024-02-23 20:57:57 +00:00
|
|
|
#include <discord_rpc.h>
|
2023-08-11 17:22:26 +00:00
|
|
|
|
2024-10-08 15:14:37 +00:00
|
|
|
namespace DiscordRPCHandler {
|
2024-02-23 21:32:32 +00:00
|
|
|
|
|
|
|
enum class RPCStatus {
|
|
|
|
Idling,
|
|
|
|
Playing,
|
|
|
|
};
|
2023-08-11 17:22:26 +00:00
|
|
|
|
2024-02-23 20:57:57 +00:00
|
|
|
class RPC {
|
|
|
|
std::uint64_t startTimestamp;
|
2024-10-08 15:14:37 +00:00
|
|
|
bool rpcEnabled = false;
|
|
|
|
RPCStatus status;
|
2023-08-11 17:22:26 +00:00
|
|
|
|
2024-02-23 20:57:57 +00:00
|
|
|
public:
|
|
|
|
void init();
|
2024-10-08 15:14:37 +00:00
|
|
|
void setStatusIdling();
|
|
|
|
void setStatusPlaying(const std::string& game_name, const std::string& game_id);
|
|
|
|
void shutdown();
|
|
|
|
bool getRPCEnabled();
|
2024-02-23 20:57:57 +00:00
|
|
|
};
|
2024-02-23 21:32:32 +00:00
|
|
|
|
2024-10-08 15:14:37 +00:00
|
|
|
} // namespace DiscordRPCHandler
|