new plugin (cmod-xmplay)

Started by herotyc,

herotyc

Btw, today I made this plug-in

https://github.com/jllodra/cmod-xmplay

I made it for myself, but I though it could be interesting to someone.

Is there any chance it can get added to your plugins page? I'd say it's a general plugin.

Best wishes

herotyc

I have a question, is there any DDE command (or a combination of) that "adds a file to the playlist at th end and plays it". I have only seen "open" (plays a song clearing the playlist) and "list" (adds a song at the end of the playlist but it does not play the song)

Ian @ un4seen

Quote from: herotycBtw, today I made this plug-in

https://github.com/jllodra/cmod-xmplay

I made it for myself, but I though it could be interesting to someone.

Is there any chance it can get added to your plugins page? I'd say it's a general plugin.

That's nice work. Is there a particular reason for the "cmod" name? "xmp-modland" would seem more descriptive. Perhaps you're not using that because you plan to add support for other MOD repositories?

Another little suggestion is that you could use XMPlay's built-in download and unzip support, to simplify things and avoid writing temporary files. For example, like this:

XMPFILE file = xmpffile->Open("https://modland.com/allmods.zip|allmods.txt");
if (file) {
// read and process file here
xmpffile->Close(file);
}

Quote from: herotycI have a question, is there any DDE command (or a combination of) that "adds a file to the playlist at th end and plays it". I have only seen "open" (plays a song clearing the playlist) and "list" (adds a song at the end of the playlist but it does not play the song)

You could use the "key372" command to play the new track. A list of available "key" commands can be found on the support site, here:

    https://support.xmplay.com/article.php?id=113

It's also possible to change the "list" command's default behaviour via the "Play listed tracks" option in the "Integration" options page. The behaviour of the "open" command can also be changed there via the "Default action" option.

herotyc

> That's nice work. Is there a particular reason for the "cmod" name? "xmp-modland" would seem more descriptive. Perhaps you're not using that because you plan to add support for other MOD repositories?

Thanks. The name... I like the name because it honors to a textmode player I wrote when I was a young little man: https://github.com/jllodra/cmod

The idea of extending to other MOD repos is good, don't think I will have the time but the source is there if anyone is willing to put some effort!

> Another little suggestion is that you could use XMPlay's built-in download and unzip support, to simplify things and avoid writing temporary files.

Good one! Didn't know that. I really could rewrite the db rebuilding part and avoid writing files at all, I should do some resource locking too but nobody is perfect

> You could use the "key372" command to play the new track. A list of available "key" commands can be found on the support site, here:

I will try that, my intention is to be able to "add to playlist (at the end) and play", it saves me a click

> It's also possible to change the "list" command's default behaviour via the "Play listed tracks" option in the "Integration" options page. The behaviour of the "open" command can also be changed there via the "Default action" option.

Will investigate that too

---

Btw, someone reported a weird issue, my conclusion is that in its computer the `Plugin_Init` function did not run when the plugin initialized (`void *(WINAPI *New)();`). Do you have any idea why could be happening? I tested on 2 computers (win 10, win 11, and a sandboxed win 10), and worked perfectly! Here you can read the issue: https://github.com/jllodra/cmod-xmplay/issues/1




herotyc

I removed miniz and I'm using xmpffile->Open now. No issues so far, thanks

Ian @ un4seen

Quote from: herotycBtw, someone reported a weird issue, my conclusion is that in its computer the `Plugin_Init` function did not run when the plugin initialized (`void *(WINAPI *New)();`). Do you have any idea why could be happening? I tested on 2 computers (win 10, win 11, and a sandboxed win 10), and worked perfectly! Here you can read the issue: https://github.com/jllodra/cmod-xmplay/issues/1

A plugin's "New" function is only called when it's enabled by the user in the DSP/Plugins options, but a shortcut will work without that. So your OpenSearchShortcut function should first check that the plugin is currently enabled, ie. Plugin_Init has been called (and not Plugin_Exit). Alternatively, you could make it so the plugin doesn't need to be enabled by putting the initialization code in the OpenSearchShortcut function, and having Plugin_Init just display a "use the shortcut" message and fail (return 0).


Ian @ un4seen

This plugin is up on the support site now:

    https://support.xmplay.com/files_view.php?file_id=742

If you post version update notifications here then they can also be included in XMPlay's built-in update notifications.

herotyc

Quote from: Ian @ un4seenThis plugin is up on the support site now:

    https://support.xmplay.com/files_view.php?file_id=742

If you post version update notifications here then they can also be included in XMPlay's built-in update notifications.

Thanks Ian, can you give me a hint on how to implement the update notifications? is there any example in the xmp-sdk? Will try to do that next week probably

herotyc

Ah ok you meant I have to post updates manually here? I'm a bit confused, I have to do nothing then, just post the new .zip here?

Ian @ un4seen

Yeah, you would post a notice here when a new version of the plugin is available, and then that info can be included in XMPlay's update notifications. You wouldn't need to post the files, as they can be fetched from your GitHub repo.

Btw, as the plugin doesn't need to be enabled in the DSP/Plugins options, I think it would be a good idea to prevent it being enabled by having your Plugin_Init function just return NULL. You could also add an About function that tells to set a shortcut key, for users that don't bother with "readme" files :)

herotyc

Quote from: Ian @ un4seenYeah, you would post a notice here when a new version of the plugin is available, and then that info can be included in XMPlay's update notifications. You wouldn't need to post the files, as they can be fetched from your GitHub repo.

Btw, as the plugin doesn't need to be enabled in the DSP/Plugins options, I think it would be a good idea to prevent it being enabled by having your Plugin_Init function just return NULL. You could also add an About function that tells to set a shortcut key, for users that don't bother with "readme" files :)

Sure, will do in the next version