Author Topic: Loading and using an xmp dll  (Read 840 times)

Malade

  • Posts: 9
Loading and using an xmp dll
« on: 9 Dec '16 - 05:00 »
any info on how to call a player addon from your own program , specifically XMPZXTUNE.


Dotpitch

  • Posts: 2871
Re: Loading and using an xmp dll
« Reply #1 on: 9 Dec '16 - 06:50 »
I guess you should be using BASS + BASSZXTUNE, and not try to recreate XMPlay's plugin interface to use XMPZXTUNE.

Malade

  • Posts: 9
Re: Loading and using an xmp dll
« Reply #2 on: 15 Dec '16 - 03:59 »
I have searched on and off for 2 days and found no info about this , Anyone at all know how to call an xmp plugin from your own application?

I looked through the sdk and nothing is there on how to actually get a pointer for init etc.

I did find out that there is something called Face and its called 4 times is it for older versions or something?

         Xmplay = LoadLibrary("plugins//xmp-yourmodule.dll");

         if (Xmplay != NULL) {
            xmpfin = (XMPIN *)GetProcAddress(Xmplay, "XMPIN_GetInterface");
            if (xmpfin)
            {
            
            // yep its been called..

I can get into the dll but thats all I can do I cant see how to get any pointers to functions.

Im guessing here but some dll's do not have any exports so are the functions static/hard coded?

with winamp plugins its simple but seems difficult with xmp.
« Last Edit: 15 Dec '16 - 04:07 by Malade »

Dotpitch

  • Posts: 2871
Re: Loading and using an xmp dll
« Reply #3 on: 15 Dec '16 - 06:41 »
You can look at the sourcecode of xmp-zxtune.

saga

  • Posts: 2179
Re: Loading and using an xmp dll
« Reply #4 on: 15 Dec '16 - 20:59 »
Quote
Im guessing here but some dll's do not have any exports so are the functions static/hard coded?
XMPIN_GetInterface is the only exported function because that's the only function you need. All other function pointers can be derived from its return value, which is a pointer to an XMPIN struct. There are plenty of examples in the XMPlay plugin SDK, you just need to look at them from the side of a host rather than from the plugin side.
But as Dotpitch said, unless you really want to code a media player that is compatible with XMPlay plugins, you should rather use BASSZXTUNE (or any other library that can decode this file type) to achieve your goal.

Malade

  • Posts: 9
Re: Loading and using an xmp dll
« Reply #5 on: 16 Dec '16 - 04:10 »
The problem I have now is dealing with the return pointer.

            if (xmpfin)
            {

               sprintf(DEBUG,"0x%X",xmpfin);
               MessageBox(NULL,DEBUG,"",1);
               DWORD returned_func; // XMPFUNC_IN_FACE
               DWORD returned_func2; // XMPFUNC_MISC_FACE
               DWORD returned_func3; // XMPFUNC_FILE_FACE

               __asm{
                     pushad
                     push  Window
                     push  4 // << xmplay version for plugin
                     call xmpfin
                     //.... what next?
   
                     popad

                         }

« Last Edit: 16 Dec '16 - 04:15 by Malade »

saga

  • Posts: 2179
Re: Loading and using an xmp dll
« Reply #6 on: 16 Dec '16 - 14:24 »
Why don't you get the XMPlay Plugin SDK? You don't need to guess all these things, the XMPIN struct is documented there. There is no need to use any assembly.

If you want to see how XMPlay and plugins "interact", you can write a demo plugin that logs all the function calls that XMPlay makes to the plugin.

Malade

  • Posts: 9
Re: Loading and using an xmp dll
« Reply #7 on: 26 Jan '17 - 02:32 »
It's working , thank you for the info.