RichPresence: Formatting and add settings reload

This commit is contained in:
Jonas Kvinge
2025-03-30 00:06:05 +01:00
parent 34fb289e33
commit d5f7a4b883
6 changed files with 109 additions and 62 deletions

View File

@@ -22,10 +22,15 @@
#include "config.h"
#include <QObject>
#include <QString>
#include "core/player.h"
#include "playlist/playlistmanager.h"
#include "includes/shared_ptr.h"
#include "core/player.h"
#include "engine/enginebase.h"
class Song;
class Player;
class PlaylistManager;
namespace discord {
@@ -38,17 +43,17 @@ class RichPresence : public QObject {
QObject *parent = nullptr);
~RichPresence();
void ReloadSettings();
void Stop();
private Q_SLOTS:
void EngineStateChanged(EngineBase::State newState);
void EngineStateChanged(const EngineBase::State state);
void CurrentSongChanged(const Song &song);
void Seeked(const qint64 microseconds);
void Seeked(const qint64 seek_microseconds);
private:
void CheckEnabled();
void SendPresenceUpdate();
void SetTimestamp(const qint64 seekMicroseconds = 0);
void SetTimestamp(const qint64 seconds = 0);
const SharedPtr<Player> player_;
const SharedPtr<PlaylistManager> playlist_manager_;
@@ -62,7 +67,7 @@ class RichPresence : public QObject {
qint64 seek_secs;
} activity_;
qint64 send_presence_timestamp_;
bool is_enabled_;
bool enabled_;
};
} // namespace discord