by drakinite » Fri Nov 15, 2024 1:36 am
peter_h wrote: ↑Tue Nov 12, 2024 3:27 am
Wow! Now that's a
bloody brilliantly detailed tutorial, Drak! Awesome!
Of course --
for the docs project! -- I'm happy to let you know what further questions it brings up for me...

....
Lovely to hear

and thanks!
peter_h wrote: ↑Tue Nov 12, 2024 3:27 am
e.g. So what's all this about "overides"? How do they work? What can you do with them? How universally applicable are they? What's the overall design of the overide system? What do I have to be careful not to break when I use or misuse them?
I've got a little explanation of "overrides" here:
https://www.mediamonkey.com/wiki/Import ... )#Override
You can technically
access the "override" method on any variable, but it'll only work on objects. The intended use is to let you make modifications to the functions/methods that belong to objects/classes, respectively, e.g. to add code that runs before or after the original code. The idea is to make it easier to make these modifications, so folks don't need to resort to
replacing a function completely, by copying the original function implementation and making their modifications that way.
peter_h wrote: ↑Tue Nov 12, 2024 3:27 am
And -- I didn't realise -- we have to edit .TS files, not the .JS files?
Ah, I realize I haven't written any explanation about the TS files anywhere in the documentation. The TS (TypeScript) files are the "source code", which can include helpful extra information on variable types and stuff. The
API documentation is based on the TS files. It then gets "compiled" into JS (JavaScript), which is run by MM.
I've made a couple attempts at providing an officially supported method of writing addons in TS, complete with type hinting for the whole MM code environment (and then making my pack-mmip tool compile the TS for you before it packages the addon), but haven't had any success, so currently addons need to be written in pure JS.
In other words: The .ts source files are helpful to inspect, but the files that are actually read and executed by MM's engine are .js, so the files you will be writing/editing are JS.
peter_h wrote: ↑Tue Nov 12, 2024 3:27 am
Also, "popup" seems to crop up quite a bit. What is MM's exact meaning of it? Is there a consistent naming scheme throughout for it? (A question to be answered in the "Overview" section).
Uuunfortunately, it's not consistent. In
most places, "popup" is used to refer to "popup menus", which is MM's name for
context menus. Under the hood, it opens these popups in a separate window, similar to dialogs but without any window controls. iirc, Dropdown controls use the same code as popupmenus, i.e. they also open in a separate window. You can inspect all the different windows that MM controls by going to localhost:9222.
In the context of list views, "popup" refers to this, well, popup where you click on an album or artist and then a list of albums or songs appears below where you clicked.
I did a quick cursory search and I didn't see any obvious hints of a third use of the term popup, so I think those are the only two.
peter_h wrote: ↑Tue Nov 12, 2024 3:27 am
And yes, I reckon it's worth looking into the AI assistance -- I've been wondering if all of MM's docs, wiki, forum, API, etc could be fed into a "CustomGPT" and be useful?
https://www.georgerouse.com/explain/custom-gpt/. I think though, we'd have to be careful that it's fed only MM5-relevant data, not any of the MM4 stuff -- which might confuse things.
Ooooo, this might be pretty good. Though it'd probably be kinda junk if we fed it forum posts, so we'd probably have to wait until we've got much more documentation before making a custom GPT

[quote=peter_h post_id=523121 time=1731400065 user_id=7363]
Wow! Now that's a [i]bloody brilliantly detailed [/i]tutorial, Drak! Awesome! :)
Of course -- [i]for the docs project! [/i]-- I'm happy to let you know what further questions it brings up for me... ;) ....
[/quote]
Lovely to hear :slight_smile: and thanks!
[quote=peter_h post_id=523121 time=1731400065 user_id=7363]
e.g. So what's all this about "overides"? How do they work? What can you do with them? How universally applicable are they? What's the overall design of the overide system? What do I have to be careful not to break when I use or misuse them?
[/quote]
I've got a little explanation of "overrides" here: https://www.mediamonkey.com/wiki/Important_Methods_and_Utilities_(Addons)#Override
You can technically [i]access[/i] the "override" method on any variable, but it'll only work on objects. The intended use is to let you make modifications to the functions/methods that belong to objects/classes, respectively, e.g. to add code that runs before or after the original code. The idea is to make it easier to make these modifications, so folks don't need to resort to [i]replacing[/i] a function completely, by copying the original function implementation and making their modifications that way.
[quote=peter_h post_id=523121 time=1731400065 user_id=7363]
And -- I didn't realise -- we have to edit .TS files, not the .JS files?[/quote]
Ah, I realize I haven't written any explanation about the TS files anywhere in the documentation. The TS (TypeScript) files are the "source code", which can include helpful extra information on variable types and stuff. The [url=https://www.mediamonkey.com/docs/api/]API documentation[/url] is based on the TS files. It then gets "compiled" into JS (JavaScript), which is run by MM.
I've made a couple attempts at providing an officially supported method of writing addons in TS, complete with type hinting for the whole MM code environment (and then making my pack-mmip tool compile the TS for you before it packages the addon), but haven't had any success, so currently addons need to be written in pure JS.
In other words: The .ts source files are helpful to inspect, but the files that are actually read and executed by MM's engine are .js, so the files you will be writing/editing are JS.
[quote=peter_h post_id=523121 time=1731400065 user_id=7363]
Also, "popup" seems to crop up quite a bit. What is MM's exact meaning of it? Is there a consistent naming scheme throughout for it? (A question to be answered in the "Overview" section).
[/quote]
Uuunfortunately, it's not consistent. In [i]most[/i] places, "popup" is used to refer to "popup menus", which is MM's name for [url=https://en.wikipedia.org/wiki/Context_menu]context menus[/url]. Under the hood, it opens these popups in a separate window, similar to dialogs but without any window controls. iirc, Dropdown controls use the same code as popupmenus, i.e. they also open in a separate window. You can inspect all the different windows that MM controls by going to localhost:9222.
In the context of list views, "popup" refers to this, well, popup where you click on an album or artist and then a list of albums or songs appears below where you clicked.
I did a quick cursory search and I didn't see any obvious hints of a third use of the term popup, so I think those are the only two.
[quote=peter_h post_id=523121 time=1731400065 user_id=7363]
And yes, I reckon it's worth looking into the AI assistance -- I've been wondering if all of MM's docs, wiki, forum, API, etc could be fed into a "CustomGPT" and be useful? https://www.georgerouse.com/explain/custom-gpt/. I think though, we'd have to be careful that it's fed only MM5-relevant data, not any of the MM4 stuff -- which might confuse things.
[/quote]
Ooooo, this might be pretty good. Though it'd probably be kinda junk if we fed it forum posts, so we'd probably have to wait until we've got much more documentation before making a custom GPT :sweat_smile: