Author Topic: Extended Module Player Library (libXMP) plugin for XMPlay  (Read 65914 times)

bauxite69

  • Posts: 73
Hi everyone !


First try, first plugin  ;D

I've decided to create a native plugin for XMPlay (the best module player in the world  8)).
This plugin supports the Extended Module Player Library (libXMP) from https://github.com/libxmp/libxmp written by Claudio Matsuoka, Hipolito Carraro Jr., Mirko Buffoni and libXMP developers.

Download (OneDrive) the latest version of xmp-libXMP.dll, libxmp.dll, in_xmp.dll and xmp.exe

Changelog : See xmp-libxmp.txt

« Last Edit: 27 Feb '24 - 04:43 by bauxite69 »

Ian @ un4seen

  • Administrator
  • Posts: 26172
Moar plugins! :)

@Ian: How can i tell to XMPlay to restart a song or set position ? I tried with XMPFUNC_MISC->DDE but with no luck.  Maybe i used the wrong syntax. ? 

Do you mean when looping? If so, you signify the end by delivering less data than requested in your Process function, and then XMPlay will call your SetPosition function to go back to the start. If you include XMPIN_FLAG_LOOP in the plugin's flags, then the XMPIN_POS_LOOP or XMPIN_POS_AUTOLOOP value will be used in the SetPosition function to request looping or auto-looping. In the auto-looping case, the function should only loop when a loop has been detected, and otherwise return -1. If the time of the loop start position is known, that should be returned, otherwise -2 can be returned to let the time run on.

saga

  • Posts: 2777
Yay for more plugins indeed. :) Maybe you should call it xmp-xmp! ;D

manx

  • Posts: 77

Seeing the looping API being discussed here: xmp-openmpt appears to have requirements that the current xmplay plugin API can not support.
I'm not sure if this also applies to libxmp as well, so I decided to not hijeck this thread and use the xmp-openmpt thread instead. See
http://www.un4seen.com/forum/?topic=15448.msg112431#msg112431.

bauxite69

  • Posts: 73
Moar plugins! :)

Do you mean when looping? If so, you signify the end by delivering less data than requested in your Process function, and then XMPlay will call your SetPosition function to go back to the start. If you include XMPIN_FLAG_LOOP in the plugin's flags, then the XMPIN_POS_LOOP or XMPIN_POS_AUTOLOOP value will be used in the SetPosition function to request looping or auto-looping. In the auto-looping case, the function should only loop when a loop has been detected, and otherwise return -1. If the time of the loop start position is known, that should be returned, otherwise -2 can be returned to let the time run on.

yep was for looping

Thanks !


But how can i use DDE ? For example : 297 MOD - Interpolation

Ian @ un4seen

  • Administrator
  • Posts: 26172
Are you trying to query XMPlay's MOD interpolation setting? If so, I'm afraid that isn't possible via DDE. If your plugin has interpolation settings, it could provide its own config options for that (via its Config function), which it can store in its own XMPLAY.INI section (via the XMPFUNC_REGISTRY functions). A little demonstration of implementing config options can be found in the FLANGE example included in the plugin SDK.

bauxite69

  • Posts: 73
Are you trying to query XMPlay's MOD interpolation setting? If so, I'm afraid that isn't possible via DDE. If your plugin has interpolation settings, it could provide its own config options for that (via its Config function), which it can store in its own XMPLAY.INI section (via the XMPFUNC_REGISTRY functions). A little demonstration of implementing config options can be found in the FLANGE example included in the plugin SDK.

Everything works fine with the plugin, interpolation and the setting in XMPLAY.INI.

I'm just curious how i can send DDE command through the plugin ?

Ian @ un4seen

  • Administrator
  • Posts: 26172
OK. You need to prefix the command number with "key" when passing it to the DDE function. For example...

Code: [Select]
xmpfmisc->DDE("key297"); // "MOD - Interpolation" command

Note the command numbers are shortcut IDs, so plugin shortcuts/commands can also be accessed this way.

bauxite69

  • Posts: 73
OK. You need to prefix the command number with "key" when passing it to the DDE function. For example...

Code: [Select]
xmpfmisc->DDE("key297"); // "MOD - Interpolation" command

Note the command numbers are shortcut IDs, so plugin shortcuts/commands can also be accessed this way.

Thank you

saga

  • Posts: 2777
Meh... if possible, you should disable support for Adlib formats. xmp's Adlib format support seems to be pretty bad, judging on a few HSC tunes it decided to play. There are already better plugins to handle Adlib formats such as in_adplug.

bauxite69

  • Posts: 73
Meh... if possible, you should disable support for Adlib formats. xmp's Adlib format support seems to be pretty bad, judging on a few HSC tunes it decided to play. There are already better plugins to handle Adlib formats such as in_adplug.

Done.

xmp-libxmp v0.3 changes :

Adlib Formats AMD, HSC and RAD disabled.

Update to LIBXMP 4.3.1

saga

  • Posts: 2777
Thanks a lot!
Are you going to release the source of your plugin sometime?

deus-ex

  • Posts: 288
Hi bauxite69,

nice one, congratulations on your first plugin.  :)

Are you going to add an dialog allowing to en-/disable each of the supported formats separately? Because Xmp-LibXMP is in competition with the plugin Xmp-OpenMPT by saga as both plugins cover a quite similar set of module formats. Currently your plugin grabs every format it supports for playback, disregarding any other installed input plugin.

Btw, I added a little documentation to the distribution of your plugin. I hope it finds your approval: Xmp-LibXMP (eXtended Module Player) v0.3


@Ian:
I think this plugin is a worthy candidate to be added to the XMPlay plugins section.

bauxite69

  • Posts: 73
Hi bauxite69,

nice one, congratulations on your first plugin.  :)

Are you going to add an dialog allowing to en-/disable each of the supported formats separately? Because Xmp-LibXMP is in competition with the plugin Xmp-OpenMPT by saga as both plugins cover a quite similar set of module formats. Currently your plugin grabs every format it supports for playback, disregarding any other installed input plugin.

Btw, I added a little documentation to the distribution of your plugin. I hope it finds your approval: Xmp-LibXMP (eXtended Module Player) v0.3


No problem with the documention, go ahead !

I'll add the updated documentation to the next release.

I'll try to add a dialog to en-/disable each of the supported formats...

Do you need in_xmp.dll and libxmp.dll updated to LIBXMP 4.3.1 (now run on Windows XP) ?


deus-ex

  • Posts: 288
I'll try to add a dialog to en-/disable each of the supported formats...

That's nice to hear. In case you run in any obstacles I'm sure you have at least two very competent programmers following this thread who are surely willing to lend a helping hand (or a snippet of source code example).  :)


Do you need in_xmp.dll and libxmp.dll updated to LIBXMP 4.3.1 (now run on Windows XP) ?

I wasn't going to bother you about this after you released a native XMPlay plugin version. Then again there are sure a lot of Winamp die-hards out there, so if it's not to much to ask for I'd be more than happy to upload an update of the Winamp edition of your plugin.

EDIT: grammar
« Last Edit: 17 Nov '14 - 16:27 by deus-ex »

bauxite69

  • Posts: 73

I wasn't going to bother about this you after you released a native XMPlay plugin version. Then again there are sure a lot of Winamp die-hards out there, so if it's not to much to ask for I'd be more than happy to upload an update of the Winamp edition of your plugin.

in_xmp and libxmp 4.3.1


deus-ex

  • Posts: 288
Thanks, the updated plugin is online now.

Say, you wouldn't happen to have an update of xmp.exe as well? You used to provide it together with the Winamp plugin, and I used to make it available as an alternative download. Latest version online is v4.0.8. ::)

bauxite69

  • Posts: 73
Thanks, the updated plugin is online now.

Say, you wouldn't happen to have an update of xmp.exe as well? You used to provide it together with the Winamp plugin, and I used to make it available as an alternative download. Latest version online is v4.0.8. ::)

xmp.exe 4.0.9

deus-ex

  • Posts: 288
Terrific! Thank you. :)

bauxite69

  • Posts: 73
I'll try to add a dialog to en-/disable each of the supported formats...

That's nice to hear. In case you run in any obstacles I'm sure you have at least two very competent programmers following this thread who are surely willing to lend a helping hand (or a snippet of source code example).  :)


I managed to add a dialog and now you can en-/disable each of the supported formats.

v0.4, 2014-11-17
 · Re-enabled Adlib formats .AMD, .HSC and .RAD
 · Added dialog in plugin configuration to en-/disable each of the supported formats


bauxite69

  • Posts: 73

v0.7, 2014-11-24
 · Added support for subsongs


@Ian: xmp-libxmp works fine with subsongs so far, but i need your help. I can't figure out how to build subsongs tags. Do i need to create a new array ? I've tried a few ideas, but this leads to a crash. Meanwhile, GetFileInfo will receive XMPIN_INFO_NOSUBTAGS.


 

Ian @ un4seen

  • Administrator
  • Posts: 26172
The tags should be delivered as a series of null-terminated strings containing tag names and values, ending with a double-null. The GetTags function should only give the tags of the current subsong. GetFileInfo gives the tags for all subsongs, and when when not using the XMPIN_INFO_NOSUBTAGS option, each subsong's tag block should follow the other. For example, the tags for 2 subsongs could look like this: "FileType\0type\0Title\0title1\0\0FileType\0type\0Title\0title2\0\0" (where "\0" = null). The memory for the tag block should be allocated with the XMPFUNC_MISC Alloc/ReAlloc functions.

bauxite69

  • Posts: 73
The tags should be delivered as a series of null-terminated strings containing tag names and values, ending with a double-null. The GetTags function should only give the tags of the current subsong. GetFileInfo gives the tags for all subsongs, and when when not using the XMPIN_INFO_NOSUBTAGS option, each subsong's tag block should follow the other. For example, the tags for 2 subsongs could look like this: "FileType\0type\0Title\0title1\0\0FileType\0type\0Title\0title2\0\0" (where "\0" = null). The memory for the tag block should be allocated with the XMPFUNC_MISC Alloc/ReAlloc functions.

Thanks !

Now we have xmp-libxmp fully supporting subsongs. :)

bauxite69

  • Posts: 73
Thanks a lot!
Are you going to release the source of your plugin sometime?

In the next release, i'll include the sources.

bauxite69

  • Posts: 73
Thanks, the updated plugin is online now.

Say, you wouldn't happen to have an update of xmp.exe as well? You used to provide it together with the Winamp plugin, and I used to make it available as an alternative download. Latest version online is v4.0.8. ::)

in.xmp.dll 4.0.0
libxmp.dll 4.3.2
xmp.exe 4.0.10

From now on, in_xmp.dll will display the version of libxmp.dll loaded.