List of event types for app.listen?
Moderators: jiri, drakinite, Addon Administrators
List of event types for app.listen?
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?
And more generally, is there a list of events somewhere that I could look up?
Re: List of event types for app.listen?
I think this should work:
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.
Code: Select all
app.listen( player.getSongList(), 'change', ()=>{
// playing list changed
});
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.
Re: List of event types for app.listen?
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!
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!
-
- Posts: 1
- Joined: Thu Jan 20, 2022 6:44 am
- Location: Los anagles, California
- Contact:
Re: List of event types for app.listen?
Thanks for providing event list to make app.listen.
-
- Posts: 906
- Joined: Sun May 28, 2006 4:22 am
- Location: Australia
- Contact:
Re: List of event types for app.listen?
omg. I'd also missed the event tab. Thanks for mentioning it.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!
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Re: List of event types for app.listen?
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.
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.
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.
-
- Posts: 906
- Joined: Sun May 28, 2006 4:22 am
- Location: Australia
- Contact:
Re: List of event types for app.listen?
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.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.
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.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Re: List of event types for app.listen?
Glad to hear it's more helpful now!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.
Just to make sure I understand, are you speaking about just the old documentation, or do you feel the same about the new documentation?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.
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.
-
- Posts: 906
- Joined: Sun May 28, 2006 4:22 am
- Location: Australia
- Contact:
Re: List of event types for app.listen?
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.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
-
- Posts: 906
- Joined: Sun May 28, 2006 4:22 am
- Location: Australia
- Contact:
Re: List of event types for app.listen?
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
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!
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).
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.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.