List icon files in directory.

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

gb63
Posts: 3
Joined: Fri Jun 17, 2022 2:11 am
Location: Fr

List icon files in directory.

Post by gb63 »

I'm trying to develop an addon for MediaMonkey that will list and display icons (*.svg) from a directory.
example :
+----------------+---+
| Close.svg | X |
+----------------+---+
| Play.svg ...| > |
+----------------+---+

I managed to create an option inspired by "pnl_InputPlugins.js".
But I'm stuck on the list feed (Gridview):

From the model code:
LV.controlClass.dataSource = app.player.getInputPlugins();//return plugin list
I created
LV.controlClass.dataSource = getSVGlist(Directory);
with
function getSVGlist(path) {
if (!path) return;
var svglist = app.utils.createSharedList();
var folder = app.filesystem.getFolderFromString(path, true /* temporary */ );
// here: how do to feed svglist? (name and content)
// with "scanForMedia"? with "fastForEach"
// I try, try and retry but not nothing :(
return svglist;
}



Do you have a solution for me?
I saw a post talking about "getFileList" for version v5.0.4: a possibility?

I also tried another solution to write directly in an html table:
<td><img src="file:///C:/Program Files (x86)/MediaMonkey 5/skin/icon/close.svg" alt="close.svg" width="25" height="25" ></td>
but i'm also stuck.

Once unlocked I will try to publish my addon. I also have a skin being finalized.
I'am an old school programmer (jurassic period), so I'm having a little trouble. More examples would be welcome on the APIs page.
I'm a big fan of Media Monkey (MM4 and MM5).
Thank you very much for your work.
Ludek
Posts: 4945
Joined: Fri Mar 09, 2007 9:00 am

Re: List icon files in directory.

Post by Ludek »

Yes, using getFileList introduced in 5.0.4 will work for you:
https://www.mediamonkey.com/docs/api/cl ... etFileList

The first 5.0.4 build has been just released as alpha: https://www.mediamonkey.com/forum/viewt ... 86639&sd=d
gb63
Posts: 3
Joined: Fri Jun 17, 2022 2:11 am
Location: Fr

Re: List icon files in directory.

Post by gb63 »

I have develop an addon working for v5.0.4 . Waiting for approval.
I try to reply @drakinite but I cannot compose message :
"We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more in discussions to be able to use this feature."
Sorry but I'am very bad with "submit addon" tool and also with messaging :( .
I hope my addon will be better :roll:
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: List icon files in directory.

Post by drakinite »

Approved! https://www.mediamonkey.com/addons/brow ... nd-manage/

I added a little blurb at the top explaining to users that it requires the 5.0.4 beta, since most probably won't have it installed & it may cause confusion. You or I can remove that once 5.0.4 is released.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
Post Reply