Developing PM123 Plug-ins

PM123 1.1 beta 1 supports four kinds of plug-ins: visual, decoder, output and filter. Visual plug-ins are used to peek at the data currently being heard (or not) by the user through the output plug-in and visually produce data from it back to the user. Decoder plug-ins are used to decode different types of files, tracks or streams the user can play. Output plug-ins is the final destination of the decoded data. It can be rerouted to a sound card, to the hard disk or anywhere else appropriate. The data is in standard PCM format. Filter plug-ins are chained between the decoder and the output plug-in to modify the PCM data before getting to the output plug-in.

Visual plug-in interface has not been changed since version 1.0, eventhough it could have been ameliorate. This might be done later on. Currently, Visual plugins allow the creation of internal or external windows and they can tap into PM123 in several ways: they can retrieve currently playing samples, control PM123 and so on. Plugins are Dynamic Linked Libraries, DLLs, which PM123 loads on use. Note that visual plugins cannot be loaded via PM123's Properties dialog because they are skin specific. They can of course be loaded when loading a new skin.

plugin.h contains the necessary structures for all pm123 plug-ins. A plugin must have a function that identifies it as a plugin:

    int _System plugin_query(PPLUGIN_QUERYPARAM param);
The plugin will then have to fill the variables in the param structure, for example:
     param->type         = PLUGIN_VISUAL; /* Identify the plugin as
visual plugin. Types can be ORred to include multiple plugin types in
the same DLL. */

     param->author       = "Matti Meikäläinen";
      /* Author of the plugin */

     param->desc         = "Example plugin";
      /* A short description of the plugin */

     param->configurable = TRUE;
      /* Toggles plugin configurability via PM123 Properties dialog */

If you set param->configurable = TRUE, configuration dialog should appear when PM123 calls

     int _System plugin_configure(HWND hwnd, HMODULE module);
where hwnd is the notebook window so that you can "lock" your window on it if you want and where module can be used to load a resource from your DLL

Visual plugins should deinitialize and destroy their windows and free allocated memory when receiving a

     int _System plugin_deinit(int unload);
It can also be used to save settings in your INI file for other sort of plug-ins.
Last revised July 3, 2000, Copyright © Taneli Leppä <rosmo@sektori.com>, Samuel Audet <guardia@cam.org>