Skip to content

Commit

Permalink
Fixed status if discord restarted
Browse files Browse the repository at this point in the history
Added image when listen to url
Small fixes
  • Loading branch information
Exle committed Apr 14, 2018
1 parent e3583a1 commit 4faebc1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 4 deletions.
Binary file added .github/screenshot_radio.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions AIMPPlugin.h
Expand Up @@ -9,6 +9,7 @@ class AIMPPlugin : public IUnknownInterfaceImpl<IAIMPPlugin>

static VOID UpdatePlayerState(INT AIMPRemote_State);
static VOID UpdateTrackInfo(PAIMPTrackInfo AIMPRemote_TrackInfo);
static VOID UpdateTrackPosition(PAIMPPosition AIMPRemote_Position);

PWCHAR WINAPI InfoGet(INT Index);
DWORD WINAPI InfoGetCategories();
Expand All @@ -17,6 +18,8 @@ class AIMPPlugin : public IUnknownInterfaceImpl<IAIMPPlugin>
HRESULT WINAPI Finalize();

VOID WINAPI SystemNotification(INT NotifyID, IUnknown* Data);

static VOID DiscordReady(VOID);
private:
bool bFinalised;
};
5 changes: 5 additions & 0 deletions AIMPRemote.cpp
Expand Up @@ -249,6 +249,11 @@ BOOL AIMPRemote::InfoUpdateVersionInfo()
return false;
}

AIMPTrackInfo AIMPRemote::AIMPGetTrackInfo()
{
return PAIMPRemote->ARTrackInfo;
}

LRESULT CALLBACK AIMPRemote::WMAIMPNotify(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (wParam == AIMP_RA_NOTIFY_TRACK_INFO)
Expand Down
1 change: 1 addition & 0 deletions AIMPRemote.h
Expand Up @@ -64,6 +64,7 @@ class AIMPRemote
static BOOL AIMPSetPropertyValue(INT APropertyID, INT AValue);
static VOID AIMPSetEvents(AIMPEvents *Events);
static BOOL AIMPSetRemoteHandle(const HWND *Value);
static AIMPTrackInfo AIMPGetTrackInfo();
protected:
static LRESULT CALLBACK WMAIMPNotify(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
Expand Down
9 changes: 7 additions & 2 deletions DiscordRPC.cpp
Expand Up @@ -11,11 +11,11 @@ DiscordRPC::~DiscordRPC()
Shutdown();
}

VOID DiscordRPC::Initialise(const char *AppId)
VOID DiscordRPC::Initialise(const char *AppId, DiscordEventHandlers *handlers)
{
if (b_init == false)
{
Discord_Initialize(AppId, {}, 1, NULL);
Discord_Initialize(AppId, handlers, 1, NULL);
b_init = true;
}
}
Expand Down Expand Up @@ -89,4 +89,9 @@ VOID DiscordRPC::UpdateRP(DiscordRichPresence *richPresence)
VOID DiscordRPC::ClearPresence()
{
Discord_ClearPresence();
}

VOID DiscordRPC::RunCallbacks()
{
Discord_RunCallbacks();
}
3 changes: 2 additions & 1 deletion DiscordRPC.h
Expand Up @@ -7,11 +7,12 @@ class DiscordRPC
DiscordRPC();
~DiscordRPC();

VOID Initialise(const char *AppId);
VOID Initialise(const char *AppId, DiscordEventHandlers *handlers);
BOOL Update(DiscordRichPresence *richPresence);
VOID UpdateRP(DiscordRichPresence *richPresence);
BOOL FastUpdate();
VOID ClearPresence();
VOID RunCallbacks();
private:
VOID Shutdown();

Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -4,4 +4,5 @@
AIMP - Discord Presence
</h1>

![Screenshot](https://raw.githubusercontent.com/Exle/-AIMP-Discord-Presence/master/.github/screenshot.png)
![Screenshot](https://raw.githubusercontent.com/Exle/-AIMP-Discord-Presence/master/.github/screenshot.png)
![Screenshot Radio](https://raw.githubusercontent.com/Exle/-AIMP-Discord-Presence/master/.github/screenshot_radio.png)
Binary file modified aimp_DiscordPresence.cpp
Binary file not shown.

0 comments on commit 4faebc1

Please sign in to comment.