Winamp Dsd Plugin

1 view
Skip to first unread message

Lilliana Adames

unread,
Aug 4, 2024, 1:01:10 PM8/4/24
to spirukcemas
Soyou want to write a plugin for Winamp but don't know where to start? This is the page for you. We'll walk you through creating a very basic plugin that does nothing. You can then expand on the code to do whatever you want.

This guide assumes you're developing using Visual Studio in a Windows environment. It also assumes you have some familiarity with programming. For people that don't, try using google. We'll have to expand this guide in the future to give out more pointers.


The following code has been created based on samples from several forum threads. Many thanks go out to forum members Kaboon, kichik, baafie, burek021, and bananskib for their code examples and advice.


To begin, you'll need a tool that lets you write code. Check out the Tools page. You can get a free copy of Visual Studio C++ Express here. You'll probably also want a copy of Winamp itself, to test your plugin; you can get that on the Winamp site here.


Note: Winamp classifies plugins based on the first part of their .dll filename, so you will need to properly name the file if you want Winamp to recognize it (details: the Winamp client searches for and loads plugins based on the first part of their filenames. This saves time and space instead of loading all dlls and then detecting which ones are real plugins). Thus, to make our basic plugin we want to name the first part of the file 'gen_'. Be sure to start your plugin name with 'gen_' to make it work properly.


Once you click okay Visual Studio should create a bunch of boilerplate code for you, and throw some files in your project with names like "resource.h", "stdafx.h", "AssemblyInfo.cpp", and so on. The main files we want to work with are called 'gen_myplugin.h' and 'gen_myplugin.cpp'. If you double-click to view them you should see code that looks something like this:


You might be wondering why the last two fields in the winampGeneralPurposePlugin structure are left empty. You might have noticed the reference that is returned as part of the winampGetGeneralPurposePlugin() method. This is the method that the Winamp.exe calls when loading these gen_*.dll files. As part of loading the plugin, the Winamp.exe will store the handle to its main window and the hinstance for the plugin dll into these two fields. Since these are references, these values become available for use by the plugin.


Once you have pasted this code into your .h and .cpp files, save your changes and compile the project. You can do this by pressing F7, or selecting Build -> Build Solution. If everything works, you should see some messages in Visual Studio's 'Output' window, with the final line saying something like


If your project builds successfully, it will output a file called 'gen_myplugin.dll' into a 'Debug' or 'Release' folder in the same location you created your project. Look for that file now. We want to copy this file to C:\Program Files\Winamp\Plugins\, which is the folder Winamp examines to find all of its plugins.


The next time you build your project the .dll will be copied over automatically. Be careful - this means you will always overwrite any existing .dll. Once you are finished making your plugin you may want to remove this step. Also, keep a backup copy.


So what's next? More guides still need to be written. Eventually there may be a guide for each type of plugin: Input, Output, Visualization, Audio Effect/DSP, General Purpose, Media Library and Portables.


we are creating a variable called 'plugin'. The variable's type, rather than being an integer ('int'), floating point number ('float'), or some other type, is of type 'winampGeneralPurposePlugin', which is a type we have created. This type is created in the header file with the code




this line is telling Visual Studio to put everything inside the 'myplugin' namespace (read up on namespaces here). We get rid of the default boilerplate code, including the namespace, to make everything work.


This tells Visual Studio where to look for the winampGeneralPurposePlugin type (i.e., to look inside the 'myplugin' namespace). If you are new to programming or plugin creation, however, you probably don't need (or want) to mess with namespaces.


My long lasting plan for just about all screensavers where to create winamp plugins of them. I did that with the old planestate but seening as I couldn't actually connect the music to the screensavers action in a good way I put the project on ice.


Well this time around that shouldn't be a problem since all I need to do is to create a new node that uses the winamps input as an output. For example a node that outputs spectrum data, waveform data or possibly a beat sensing node that output a value between 0.0 and 1.0 depending on how strong beat was detected in the music. From there your imagination should be able to do the rest of what could be done.


I'm not quite there yet, however I have taken the first step. The screensaver now run as an actual winamp plugin. It was a bit harder than I had hoped. The problem is that I really didn't want the plugin to run from the real winamp plugin dir since I need a few extra dlls (Like cg dlls and so forth) and that would clutter up the plugins dir. So to fix this I had to create a proxy plugin. It basically takes all commands it gets from winamp and send them off to another plugin placed in whatever dir you want. One of the reasons this was a bit harder than expected was that the plugin in the new directory didn't find the dlls it needed. Turns out that you had tell windows where he should look for dlls. You do that simply by calling "SetDllDirectory();"You might also need to set the working directory but after that your proxy plugin should work fine.


I also plan on creating a Windows Media Player plugin later on since a lot of people seem to use that too. The neat thing there is that all scenes should work without any changes both as winamp, windows media player or screensaver scenes.


What would be very nice would be if I could attach the screensaver to winamp. So if you had winamp running with some music and the screensaver got activated. The screensaver would use the scenes and data from winamp.However from what I have read so far so isn't this possible in a simple way. But we will see down the road.


There are several reasons why im using the old version.

The problem is, that Malwarebytes Premium is stopping the plugin album list.

Some month ago i hadnt this problem. Some weeks ago, i had a workaround to start wimamp with the plugin.

I just switches off the exploit protection, started winamp with the plugin, and switched on the exploit protection.

Yesterday i installed win 10 new, also winamp with the plugin and also Malwarebytes.

Now my workaround is not working anymore.


To save attachments, please click the link as shown below. You can click and drag the files to this bar or you can click the choose files, then browse to where your files are located, select them and click the Open button.


You should be able to eliminate this detection by disabling Exploit Protection for Winamp Player (since this is technically what you were doing when you were disabling Exploit Protection, starting Winamp, then re-enabling Exploit Protection anyway; it was a bug with Exploit Protection that allowed this to work which has since been corrected which is why it is no longer working). To do so, open Malwarebytes and go to Settings>Protection and under Real-Time Protection click on the Manage Protected Applications button below where it shows Exploit Protection: Prevents vulnerability exploits and zero-day attacks and scroll down the list of items until you find Winamp Player and click the green switch to change it to Off then click OK and you should then be able to launch Winamp without it being blocked, just remember that Winamp will no longer be shielded by Exploit Protection as long as that option is disabled so if any malicious media file or plugin which contains an exploit is opened by Winamp it will not be blocked or detected.


I often listen to music while I code.

Switching songs while in the middle of something damages your productivity because you have to move to another window.

How would you implement such a plug in and in what language would I be more comfortable with if I want to interact with the winamp sdk?

I'm a C++ programmer but I can get by with C# as well.


You can look at the Winamp SDK and should be really easy to make it in either C++ or C#. I had a similar problem and had made a addin for the same, it's not a full featured add in but takes care of the basics functionality.


And yes I knew of the global shortcuts before I developed it, sometimes you just are doing everything with the keyboard and don't want to switch to the mouse and sometimes you are using the mouse and don't want to go to the keyboard. It is just a very tiny thing for half a second increase in productivity!


The general purpose plug-ins catalogue even includes everyday features which you can run, like an alarm clock, and the User Interface can be customized to your individual tastes and preferences. You can change your UI as often as you choose and save them as different installs. This comes on handy when you have you have more than one user. Some other examples of fun plug-ins are the CDG karaoke Plugin which is a free and safe plug-in you can use to play CDG files (mp3+g) in sync with MP3. SoftAmp Virtual Sound Winamp plug-in for 3D sound produces a three dimensional sound with four independent virtual speakers and enjoy the sound coming from above or from above and the reverberation effect is provided. You can even download the Pac-man game for free and relieve your youth!


The more serious and practical plug-ins such as the multiple DSP stacker allow you to stack as many plug-ins inside Winamp as you want, allowing you to manage everything from one place. Also available is the Waveform Seeker Plug-in v2.3.1 which defines the waveform output of a selected file which you can then use to search or seek within the file and allows you to maximize the potential within that file.

3a8082e126
Reply all
Reply to author
Forward
0 new messages