Winamp Media File



Plugin struct definition

  1. Winamp Media Player Pro
  2. Winamp Media File Convert To Mp3
  3. Winamp Media File To Mp3
Winamp Media File

Adding Files to the Media Library. To add files to the Media Library. If the Media Library isn't open, open the View menu located in the Winamp main window and click Library or by pressing ALT+L on your keyboard. Open the File menu in the Media Library and click Add Media to Library. The Add Media to Library window appears. Winamp is a fast, flexible, high-fidelity music player for Windows. Though its hayday has ended, this very popular mp3, audio and Internet radio player still has a very strong following despite the demise of its former owner, Nullsoft. This Winamp download is actually the original version of the program before it ceased development.

  • Plugins work by defining a struct full of functions for Winamp to call. For Media Library plugins, there are three functions.
  1. Init - called after your plugin is loaded. We need an Init() function (rather than having the plugin doing init is the winampGetMediaLibraryPlugin function) because Winamp needs to give YOU data before you can really do your initialization stuff
  2. Quit - duh
  3. MessageProc. This is a function that the Winamp calls when certain events happen, such as someone activating your treeview node in the media library, or someone invoking the send-to menu
  • You communicate with Winamp one of two basic ones
  1. By using SendMessage and sending Winamp or the Media Library window custom messages which are defined in Winamp/wa_ipc.h (for Winamp HWND) and gen_ml/ml.h (for Media Libary HWND). This is the 'old' way of doing things but even some newer APIs are still built on this mechanism.
  2. By retrieving pointers to objects from the Wasabi Service Manager. Winamp has a bunch of APIs that you can grab, and plugins can add additional features that you might want to use. Examples of useful Wasabi objects are the Local Media API (which lets you query against the media library), the Application API (let's you get version #, build #, path to winamp settings folder, etc), and the Playlist Manager API (lets you parse playlists, among other things)

ml_xmlex is probably the most useful example of the bunch. ml_ stands for media library plugin. __declspec(dllexport) is a magic keyword for Visual C++ that means that the DLL 'exports' this function, meaning that a program that loads the DLL can locate and call this function. Winamp goes through and loads ml_*.dll plugins, looks for 'winampGetMediaLibraryPlugin' and if it it exists it calls it. From that function you are supposed to return a struct that defines your plugin. It has the plugin name, some function pointers and some data that winamp will populate with information that'll be helpful to you, like winamp's HWND (window handle).

winampMediaLibraryPlugin is defined in gen_ml/ml.h which is one ugly beast of a filebenski> reupload to File:WinampMediaLibraryPlugin.pnghttp://shup.com/Shup/57721/10872016431-ml_xmlex-Microsoft-Visual-C__-%5Bdesign%5D-ml.h.png

Winamp Media Player Pro

So you supply 'init', 'quit' and 'MessageProc' functions as well as a description. Winamp calls Init(), at which point ml_xmlex does two things

Winamp Media File Convert To Mp3

  1. Gets the all-important Wasabi Service Manager object
  2. tells the media library to add a node to the treeview for itself File:Ml xmlex in ml.pnghttp://shup.com/Shup/57726/10872016155-Main-Window.png

Plugins can manifest themselves in many ways (or be completely invisible!), just this media library plugin is a good starting point because you don't have to write too much busy-work GUI code.

For Media Library plugins, when the media library needs your plugin (e.g. when the user clicked on you in the media library) it calls your message procedure. xmlview.cpp line 147 is the message procedure. this plugin is only handling one message which is to create a view. there are other messages like 'do you want to be on the send-to menu' but this example is keeping it simple.

Winamp Media File To Mp3

Retrieved from 'http://wiki.winamp.com/index.php?title=Media_Library_Plugin&oldid=61082'