List of event types for app.listen?

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

Moderators: jiri, drakinite, Addon Administrators

Degeim
Posts: 49
Joined: Fri Sep 02, 2011 3:34 am
Location: Trondheim, Norway

List of event types for app.listen?

Post by Degeim »

I would like to listen to various events in order to track the playback state of MediaMonkey 5. Per now, I have found the relevant "playbackState", "shufflechange" and "repeatchange" events, but I need to detect changes in the current playback queue (player.getSongList()) as well. Is there an event for this?

And more generally, is there a list of events somewhere that I could look up?
Ludek
Posts: 4945
Joined: Fri Mar 09, 2007 9:00 am

Re: List of event types for app.listen?

Post by Ludek »

I think this should work:

Code: Select all

app.listen( player.getSongList(), 'change', ()=>{
	// playing list changed
});
BTW seeing that in our documentation the events are incorrectly prepended with 'on' prefix (like 'onChange' while it should be just 'change') :
https://www.mediamonkey.com/webhelp/MM5 ... dList.html

Similarly within the app object:
https://www.mediamonkey.com/webhelp/MM5 ... s/App.html

I'll correct this and ask for updating the docs.
Workaround is to remove the on prefix and lower-case it.
Degeim
Posts: 49
Joined: Fri Sep 02, 2011 3:34 am
Location: Trondheim, Norway

Re: List of event types for app.listen?

Post by Degeim »

The "change" event works; it seems to fire twice when a track is added to the list, but I can work my way around that. It's still a lot faster than the MM4 COM API!

I had completely missed the event tab in the documentation. I'll make sure to remove the prefix and lower-case them.

Thank you very much!
Rama smith
Posts: 1
Joined: Thu Jan 20, 2022 6:44 am
Location: Los anagles, California
Contact:

Re: List of event types for app.listen?

Post by Rama smith »

Thanks for providing event list to make app.listen.
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Re: List of event types for app.listen?

Post by DaledeSilva »

Degeim wrote: Thu Sep 09, 2021 2:50 am The "change" event works; it seems to fire twice when a track is added to the list, but I can work my way around that. It's still a lot faster than the MM4 COM API!

I had completely missed the event tab in the documentation. I'll make sure to remove the prefix and lower-case them.

Thank you very much!
omg. I'd also missed the event tab. Thanks for mentioning it.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: List of event types for app.listen?

Post by drakinite »

FYI, there's been a new development since the last discussion on this thread. I've written code which parses our Delphi code declarations and translates it into TypeScript, meaning that we now have much more complete documentation for native classes, functions/methods, and events. Before, only classes/methods/events that had JSDoc comments manually written out were included in the API documentation. The new site is a work in progress, but you can see the documentation for Player here: https://www.mediamonkey.com/docs/apinew ... layer.html
Note that the actual events don't have "event_" before it. It's just a quirk of how I had to get the parser to work with TypeDoc.
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.
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Re: List of event types for app.listen?

Post by DaledeSilva »

drakinite wrote: Mon Jun 12, 2023 6:36 pm FYI, there's been a new development since the last discussion on this thread. I've written code which parses our Delphi code declarations and translates it into TypeScript, meaning that we now have much more complete documentation for native classes, functions/methods, and events. Before, only classes/methods/events that had JSDoc comments manually written out were included in the API documentation. The new site is a work in progress, but you can see the documentation for Player here: https://www.mediamonkey.com/docs/apinew ... layer.html
Note that the actual events don't have "event_" before it. It's just a quirk of how I had to get the parser to work with TypeDoc.
I haven't used your link much yet, but just the fact that I can do a search and have it search more than class and module names (ie. I can search by method or event names), is fantastic.

The developer documentation has been is soooo hard to figure anything out :(
I really feel like I'm missing a link that everyone else has or something.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: List of event types for app.listen?

Post by drakinite »

DaledeSilva wrote: Fri Jul 21, 2023 10:08 am I haven't used your link much yet, but just the fact that I can do a search and have it search more than class and module names (ie. I can search by method or event names), is fantastic.
Glad to hear it's more helpful now!
DaledeSilva wrote: Fri Jul 21, 2023 10:08 am The developer documentation has been is soooo hard to figure anything out :(
I really feel like I'm missing a link that everyone else has or something.
Just to make sure I understand, are you speaking about just the old documentation, or do you feel the same about the new documentation?
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.
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Re: List of event types for app.listen?

Post by DaledeSilva »

drakinite wrote: Mon Jul 31, 2023 12:57 pm Just to make sure I understand, are you speaking about just the old documentation, or do you feel the same about the new documentation?
Apologies for taking so long to reply.
I was talking only about this API reference:
https://www.mediamonkey.com/docs/api/

However, I have been jumping between that and these two:
https://www.mediamonkey.com/wiki/Gettin ... 8Addons%29
http://mediamonkey.com/wiki/Important_M ... s_(Addons)

And find the fact that they're all separate difficult in itself as I will often be spending time in the API only to realise there's important knowledge I need to consider from the other two.
At a base level, for example, one that I can quantify is that I don't believe it's possible to know that an API method you're looking at in the API reference will only work if called from a specific file.

I know all that's more than you asked for, but just putting here in case it helps.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Re: List of event types for app.listen?

Post by DaledeSilva »

Just thought I'd have a deeper think about your new link so I could give you some feedback.
To start off, please note that it's way nicer to use, but here's something that I think could help.

When I look at the page, I still find that I get a strong overload of visual noise that makes it hard to scan the page without an overwhelming and slightly lost feeling.

I think there's a few things that can help with this if you have that level of control and don't mind me suggesting.
I'll reference this page: https://www.mediamonkey.com/docs/apinew ... indow.html
  • The left padding of the main body area could be 3-4 times as large to allow it some space to breath and feel more seperate.
  • In the main body area, if the breadcrumb and title were sticky as the user scrolled the page, it would help them stay oriented.
  • In the main body area, you could drop the icons nexts to each method name, interface name, etc. And just put the icon next to the headings for those sections. This will remove a lot of noise on the page and also help highlight the hierarchy of the headings.
    (Note, I'm not talking about the menu on the left, it's really good that they're on every line there).
Here's a quick example. You might notice that I've de-emphasised the H3s a little so that they're not competing with everything else on the page, and I've added some vertical padding between boxes.

Image


Also, at this point I realised I've give a lot of unrequested feedback and in a thread about something else, so please forgive my digression! Use only what you feel helps you!
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Post Reply