A lightweight, native Windows C++ application that provides Discord Rich Presence for the TIDAL desktop app.
It runs in the system tray, monitors your media activity using the Windows System Media Transport Controls (SMTC), and automatically updates your Discord status to "Listening to..." with the current track, artist, and cover art.
- Real-time Status: Updates your Discord presence in real-time as you listen to music on TIDAL.
- Full Metadata: Displays song title, artist, and album.
- Cover Art: Fetches the track's cover art, uploads it to a temporary host, and displays it directly in your Discord status.
- System Tray Icon: Runs quietly in the system tray with a context menu for:
- Forcing a presence update.
- Showing/hiding a debug console.
- Exiting the application.
- Lightweight: Native C++/WinRT and Win32 application with no heavy frameworks or dependencies (aside from
curl).
This application uses a combination of modern and classic Windows APIs:
- SMTC Monitoring (C++/WinRT): It hooks into the
GlobalSystemMediaTransportControlsSessionManagerto monitor all media activity on the system. - Session Filtering: It checks the
SourceAppUserModelIdof the current media session to see if it originates from TIDAL. - Metadata Fetching: When a TIDAL session is active and a track changes, it asynchronously fetches the
MediaProperties(title, artist, album, and thumbnail). - Cover Art Upload: Discord Rich Presence requires a public URL for images. To solve this:
- The application reads the thumbnail
IRandomAccessStreaminto a memory buffer. - It writes this buffer to a temporary
.pngfile. - It then shells out to
curl.exeto upload this file to thehttp://0x0.sttemporary file hosting service with a 7-minute expiration. - The public URL returned by
0x0.stis used for the Rich Presence art.
- The application reads the thumbnail
- Discord Integration (Discord SDK): It uses the official Discord Partner SDK to set the
Activitystatus (Listening to...), populating it with all the fetched metadata and the cover art URL. - UI (Win32): The application runs as a hidden, message-only window with a
NOTIFYICONDATAsystem tray icon, which serves as the main user interface.
- Visual Studio 2022 (or 2019) with the "Desktop development with C++" workload.
- Windows SDK (latest version, usually included with the VS workload).
- C++/WinRT (usually included with the VS workload).
- Discord Partner SDK: You must download the SDK from the Discord Developer Portal.
curl.exe: The application requirescurl.exeto be in your system'sPATHto upload cover art. Windows 10 and 11 includecurlby default, so this should not be an issue on modern systems.
Before you can build and run this, you should create a Discord Application, or use the one included (idk if im going to get banned from discord for this).
-
Create a Discord Application:
- Go to the Discord Developer Portal.
- Click "New Application" and give it a name (e.g., "TIDAL RPC").
- On the "General Information" page, copy the Application ID.
-
Update the Source Code:
- Open
TidalRPC.cpp. - Find the
APPLICATION_IDconstant and replace the placeholder value with your own Application ID:// --- Application Constants --- constexpr uint64_t APPLICATION_ID = YOUR_APPLICATION_ID_HERE; // e.g., 1429350918310072372
- Open
-
Add Rich Presence Assets (Optional but Recommended):
- In the Developer Portal, go to the "Rich Presence" tab.
- Under "Rich Presence Assets," upload an image to use as the small icon (e.g., a TIDAL logo).
- Name the asset
tidal-icon. The code refers to this key (assets.SetSmallImage("tidal-icon");). If you name it something else, update the code to match.
This project is intended to be built with Visual Studio.
- Clone this repository.
- Download and extract the Discord Partner SDK to a known location (e.g.,
C:\SDKs\discord_partner_sdk). - Open the
.slnfile in Visual Studio. - Configure your project properties to point to the SDK:
- Right-click the project in Solution Explorer -> Properties.
- C/C++ -> General -> Additional Include Directories: Add the path to the Discord SDK's
cppdirectory (e.g.,C:\SDKs\discord_partner_sdk\cpp). - Linker -> General -> Additional Library Directories: Add the path to the Discord SDK's library directory (e.g.,
C:\SDKs\discord_partner_sdk\lib\x86_64).
- Build the project (e.g., in
Releasemode,x64). - Find the compiled
.exein yourx64\Releasefolder and run it.
curl.exeDependency: The application will fail to upload (and therefore display) cover art ifcurl.exeis not found in your system'sPATH.0x0.stHost: Cover art is uploaded to a public, temporary hosting service. If this service is down or blocks a request, cover art will not appear.- Windows Only: This is a Windows-native application using WinRT and Win32 APIs. It will not run on macOS or Linux.