Code Monkey home page Code Monkey logo

wdrp's Introduction

Discord Rich Presence Winamp plugin

Do you use Winamp to play media, and Discord for social purposes? If you have ever wanted to integrate Winamp into Discord, this simple, easy-to-use plugin will allow you to do it.

Features:

  • Plugin has a settings menu for ease of use
  • Changing settings doesn't require re-starting Winamp or the plugin
  • Option to not display currently-playing title
  • Option to show elapsed time

Tested on

  • Winamp version 5.623 (x86)
  • Winamp version 5.8 Build 3660 (x86)

This plugin is for Windows 7/8/10+ x86-compatible environments.

Example:

Winamp is shown running, playing a song, side-by-side with a Discord Rich Presence status indicator showing that song's name and artist

Frequently Asked Questions (F.A.Q.'s)

Q: Winamp, really? In {current year}?

A: Yep

Q: How does it work?

A: This is implemented as a Winamp plug-in which calls the Discord RPC API. The rich presence updates are sent to a Discord application which is associated with your Discord account.

Q: How do I set it up?

A: Here's step-by-step instructions:

  1. Log in to the Discord web app.

Visit discordapp.com/developers/applications/.

You'll see something like:

A view of the Applications tab of the Discord Developer Portal, with a button that says Create an application

Click "Create an application". You can give it a name like "Winamp".

An image of a dialog box titled Create an application. The user is typing in the text, Winamp. There are buttons labeled Create and Cancel

Afterward, you'll be taken to a screen to configure the application. You can set an icon, if you want. I got one from here.

If you want to include a logo in the Rich Presence, upload an asset for the application to "Rich Presence --> Art Assets" and name it "winamp-logo". It will show up to the left of the rich presence text. For an example of where the logo will show up and what that looks like, see "largeImageKey" described on this page.

A view of the Applications tab of the Discord Developer Portal; viewing the General Information tab for the Winamp application. The screeenshot shows the Winamp Application's name as Winamp, and a CLIENT ID. An example ID of 112233445566778899 is shown.

The only thing to do here is to take note of the Client ID, also called an Application ID, since you'll need it later.

  1. Download "Distribute.zip" from the latest plug-in release from GitHub here.

  2. To install the Winamp plugin, unzip Distribute.zip and copy the results to the Plugins folder of your Winamp installation as shown.

Most often, the Plugins folder is located at C:\Program Files (x86)\Winamp\Plugins.

Two Windows file folders are shown; one for the Winamp Plugins install folder and one for the unzipped plugin release. Arrows are showing that the plugin release files are copied into the Winamp Plugins folder.

When you're done, there should be a file gen_DiscordRichPresence.dll in the Plugins folder, plus a folder inside that called DiscordRichPresence.

  1. Make sure you have the "Microsoft C++ Redistributable for Visual Studio 2015". It's more likely than not you already have this, because a lot of program installers include it. But in case you don't, you can find it here:

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

(The runtime is the same for VS 2015, 2017 and 2019.)

  1. Now open Winamp (or restart it if it was already open), and go to Preferences.

Winamp is shown running, where the user has clicked the menu button, moused-over the Options menu, and is about to click Preferences. Preferences can also be accessed with Ctrl+P.

Under the Plug-ins tab, under General Purpose, the "Discord Rich Presence" item should appear. If it does, the plug-in was successfully installed!

The Winamp Preferences window is shown. There are some Preferences categories, such as Media Library, Skins and Plug-ins. Under the Plug-ins category, the user has clicked the General Purpose sub-category. There's a listing of General Purpose plugins, and Discord Rich Presence, labeled gen_DiscordRichPresence.dll, is at the top, selected. There are buttons labeled Configure selected plug-in and Uninstall selected plug-in. There's an arrow pointing to the Configure selected plug-in button.

Click the button Configure selected plug-in.

There is a model dialog box titled Discord Rich Presence. In it, there is a checkbox labeled Display currently-playing title in Discord status. The checkbox is checked. Also, there is a text box labeled Discord Application ID. In the text box, the user has filled in the text 112233445566778899. There are buttons OK and Cancel.

On this menu, paste the Discord Application ID from before. Also, you can check or un-check the box depending on whether you are comfortable showing the currently-playing media on Discord.

Alternatively, you can close Winamp and edit the settings.ini file, e.g., in

C:\Program Files (x86)\Winamp\Plugins\DiscordRichPresence\settings.ini

and verify it contains ApplicationID:xxx (your Application/Client ID and not all zeores) You may have to do this if Winamp plugins don't have privilege to change files in their folder.

Click OK, or save settings.ini, and you're done!

Q: If I want to use the plugin, do I need to build from source?

A: Nope- you can go to the Releases page and download the binaries in a zip file.

Q: Do I need to give the application my Discord credentials?

A: No, the plugin doesn't ask for your credentials.

Q: How come the status says "Playing a game" instead of "Listening to" like with Spotify?

A: The Discord RPC library doesn't (at the time of writing this) currently expose a way for 3rd party plugins to change this UI element. The status for Spotify worked because Discord gave Spotify special treatment. If the RPC library adds flexibility of changing this, I'd be interested in adopting it.

Update (6/28/2019): Discord is distributing a new SDK called GameSDK to eventually replace the RPC SDK this uses. The docs say the new SDK supports the ability to customize this. But when I tried it, it didn't work. I had a weird back-and-forth with Discord folks about it. They told me basically it's there but not hooked up.

Q: Sometimes, I'm seeing a small delay before my Discord Rich Presence status is updated. What gives?

A: Discord thresholds the update frequency of the status text on its side. The frequency is every 15 seconds. See this page for more information.

Q: Is there a way to get it to show album art?

A: Currently, proabably not. At some point it might be doable.

One half of it would work fine- I can query Winamp for the art. The other missing half is to send it up to Discord. Discord doesn't, at the time of this writing, allow any "real" sort of programmatic upload of images- all images need to be uploaded through the Developer Portal web site. This is discussed a bit in their FAQ and this Reddit thread. If I could send images up with the RPC data, that would be perfect, but I'd be okay with anything really.

Q: Will other people be able to hear the music I'm listening to?

A: No, Discord Rich Presence doesn't allow you to transmit music. You can look at other rich presences and see they don't play music either. For example, Spotify- if any Discord Rich Presence were to have it, it'd be that one (they have a special relationship with Discord and get access to special functionalities ordinary plug-ins don't have), and they don't have it. Their rich presence has a link on it you can click that opens Spotify in your browser, presumably at the same stream. The rich presence itself doesn't play music or video. Discord Rich Presence API doesn't even allow plug-ins to transmit images, much less audio and video.

If you want to stream audio to a particular server, Discord has a more heavyweight feature GoLive, which streams audio+video.

Q: I can't seem to get the plug-in to start.

A: One thing to check, is if you close Winamp and go to your Winamp installation folder, i.e.,

C:\Program Files (x86)\Winamp\Plugins\DiscordRichPresence

Verify that settings.ini contains ApplicationID:xxx (your Application/Client ID and not all zeores)

you may need to edit it manually to set it. This is necessary if Winamp was run as a limited-privilege user without the permission to change the settings file in the plugin folder.

Q: I'm seeing problems when I re-name the Discord application then try to use it with Rich Presence.

A: I've seen this problem too. It appears to be a bug in Discord. The way I've found to work around it is to delete and re-create a new application with the right name.

Q: If I want to build the plugin, what type of environment do I use?

A: The plugin is built using Visual Studio 2017 on a Windows 10 environment. It uses the v141 toolset and SDK version 10.0.17134.0. Other environments might work too.

VS Code is supported as well. See CONTRIBUTING.md for setup assistance including required libraries and paths.

Q: I have a question or other comment.

A: Setting expectations: I've started focusing my attention on other projects. So I don't have capacity to do this maintenance on this project any more. If you reach out or open issues you might have a better result investigating them yourself.

wdrp's People

Contributors

clandrew avatar derekgates avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wdrp's Issues

Cannot make wdrp work under Winamp beta 5.8

Althrough i manually edited the .ini file adding my Application ID and changed the DiscordRichPresence folder permissions for every user read/write, i still cant get this plugin to work.

image

Currently running Windows 10 1903 x64, Winamp 5.8 build 3660 with Bento skin.

Almost work on Winamp 2.95

Hi there,

so I've followed your guide with my ancient Winamp 2.95 and it almost works - it shows in plugins, there's a dialog for entering appid, but when I play a song the player crashes.

I know that it's probably ridiculous to have a support for such version, but perhaps we could at least give a shot at debugging it? Is there some kind of logging? Or can I attach a debugger somehow to see what's going on?

Opening Winamp from file association sometimes causes misbehavior

When Winamp is opened normally, the plug-in behaves normally.

However when Winamp was opened due to opening a file with a Winamp program association, sometimes the plug-in doesn't appear to communicate with Discord. Need to investigate. A guess at what could be happening is some local-working-directory thing is preventing the plug-in from loading the Discord RPC dll, kind of silly.

Terminate Discord RPC connection when Winamp closing

Need to double check that the Discord connection/RPC is being closed when Winamp is shutting down.

I noticed I closed Winamp today and the status in Discord stuck around.

wa_ipc.h:

#define IPC_ISFULLSTOP 400
/* (requires winamp 2.7+ I think)
** int ret=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISFULLSTOP);
** This is useful for when you're an output plugin and you want to see if the stop/close
** happening is a full stop or if you are just between tracks. This returns non zero if
** it is a full stop or zero if it is just a new track.
** benski> i think it's actually the other way around - 
**         !0 for EOF and 0 for user pressing stop
*/

Version 1.4 not saving app ID with newest Winamp 5.9.1

Everything works fine while Winamp is running but does not save the app ID between sessions when installed with latest Winamp v5.9.1 build 10029 that was released 21 Dec 2022

It's only mildly inconvenient I guess but if anyone has a fix, that'd be great.
Can always downgrade to an earlier version of Winamp when it saved the app ID across sessions if needed I suppose.

H

Time elapsed?

Hey there,
I want to thank you for this nice plugin, however I do have a suggestion.
Would it be hard for you to implement "time elapsed" display also? From what I checked in the documentation you'd only need to provide a "startTimestamp" to show how much time has passed. Would be a nice little add-on to the plugin.
(Also, you forget to mention in the ReadMe that if you want to have a logo in Discord pop-up you also need to upload image named "winamp-logo" to "Rich Presence -> Art Assets" part of Developer section.)
Thanks.

Winamp logo not showing anymore

Hello,

I just started on discord to make this [https://github.com/clandrew/wdrp]plugin(url) working again, but its not showing the avatar... what im doing wrong? the wrong is the winamp version, the avatar itself, i really dont understand why its not showing the avatar anymore...

https://media.discordapp.net/attachments/1089198854102073473/1090727306009518161/image.png

Other details:

Version: Winamp 5.666 (i downloaded from a random website, cant remember anymore)
Plugins installed: YES
Application installed: YES
Screenshot_1
Screenshot_2
Screenshot_3
Screenshot_4
Screenshot_5

Best regards.

Put the settings.ini file someplace else

Side effect of how this project began as a small convenience for myself, but now it's expected to work generally for more people.

The settings file lives, right now, right alongside the plug-in in the Winamp program folder. Depending on where Winamp was installed, say, Winamp was installed to Program Files (common situation) that means it won't have write privileges for that folder.

To fix this, the settings file could live somewhere else where you don't need special permissions to write there. Maybe in your app local folder somewhere.

Incorrect title being sent for streaming audio

I often listen to streaming radio via Winamp (namely DI.FM). The plugin never picks up the currently playing song, it only will show the URL of the stream it's trying to connect to. One can pause the stream and press play and the plugin will update for the current track, but on song change it does not change unless you pause/unpause again.

Is it possible to add support for streaming audio?

Implement Discord Game SDK

As mentioned in the README.md:

Q: How come the status says "Playing a game" instead of "Listening to" like with Spotify?

A: The Discord RPC library doesn't (at the time of writing this) currently expose a way of changing this UI element. The status for Spotify worked because Discord gave Spotify special treatment. If it comes to be that the RPC library adds flexibility of changing this, I'd be interested in adopting it.

Update (6/28/2019): it looks like Discord is distributing a new SDK called GameSDK, and ultimately the RPC SDK will become deprecated. From a quick glance at the docs, it looks like the new SDK supports the ability to customize this. If so, great! I think it is kind of a hassle I need to move the plugin to a new SDK just to get this small feature, but I suppose they are phasing out the RPC SDK anyway. I can take a look at GameSDK and see how easy or hard it is to make it work and start there.

To implement:

https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide#code-primer-unreal-engine-c

And the relevant "Activity" that this plugin must use:

https://discordapp.com/developers/docs/game-sdk/activities

Allow Artist - Album to be displayed along with track name

It would be great if the Artist tag and Album tags can be included beneath the Track tag.

Honestly, I find the (Paused)/(Playing) notification to be pointless. If space is an issue, have an option of replacing that with the artist and album. It's more useful information imo.

Also, can you give us an option to make it say the time remaining instead of time elapsed?

Thanks a lot, this is a great plugin and I'm very glad winamp is still getting the love it deserves!

The plugin is not working

The plugin has stopped working in Discord

I would like to say that the plugin was working fantastic, thank you very much for all the work you have put into this!

No Logo Image in RPC Status

I've uploaded winamp-logo.png to art assets of my Discord Application but am not seeing it pop up in my RPC status. Not sure if its expecting jpg or what. Deleted application and started over and still persists with fresh appID.

image

Update to VS 2019

I started using VS 2019 for all my stuff some months ago but haven't yet upgraded this project.
I plan to do this after merging @derekgates 's change- i hope this is not too disruptive?

Feature request- more compact display

From e-mail:

"I was wondering if it's possible to modify the plugin to, instead of looking like this:

App Title
Band - Song
(Playing)
xx:xx elapsed

To change it to look like this:

App Title
Band
Song
xx:xx elapsed"

Stop sending presence when paused

Feature Request:

When I have Winamp open but paused, Discord can only see Winamp as my currently used 'presence'. If I start playing Spotify my Discord status does not update until Winamp is closed.

It would be fantastic to have the option of NOT sending presence when the player is paused. Could even have a delay such as 30 seconds since paused?

Acceptance Criteria

  • Option to pause presence updates when Winamp is paused
  • If Winamp is paused and option is selected, Discord no longer receives updates.
  • If WInamp is paused and option is not selected, Discord continues to receive presence updates of (Paused) status.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.