monitoring current track without on_play

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: monitoring current track without on_play

Post by ZvezdanD »

Sorry folks, I really don't want to be so boring, but just wish to collect some requests in one place. Here are some examples of requested events from the Scripting Wishlist thread, I think that none of those are implemented yet:

1. trixmoto on Mon Jul 03, 2006 - "A useful event would be OnPlaylistAdd. This would be fired when a track is added to a playlist."

2. tj_junk on Mon Mar 05, 2007 - "I would greatly appreciate additional event handling capabilities for the SDB.UI controls. (OnEnter, OnGotFocus, OnSelect, OnLeave, OnLoseFocus, etc)"

3. Steegy on Fri May 11, 2007 - "A OnBeforePlay(long, long, int) : bool event (with return value) could be handy."

4. darchangel on Sat Jun 09, 2007 - "I've found myself in want of such events as: OnClick for the shuffle button, OnClick for the repeat button, OnChanged for now playing tracklist (when items have been moved), OnAdd for now playing tracklist, OnRemove for now playing tracklist. It would also be nice if OnPlay were separated out to when play first occurred vs when it's simply a new track which has started playing."

5. DaledeSilva on Sat Jun 09, 2007 - "I would like an event which is run when a user "starts" dragging a track from the trackview."

6. DaledeSilva on Sat Mar 08, 2008 - "I would like a specific OnChange event for the tracklist window."

7. MoDementia on Thu Apr 17, 2008 - "Please Sub OnTrackDeleted(DeletedTrack As SDBSongData, 0=Deleted from Library 1=Deleted from Library and Computer.)" - AFAIK, this is not same as implemented OnTrackDeleting.

8. caasland on Thu Aug 07, 2008 - "A new ISDBApplicationEvents called OnStartSync. This event would be triggered when a device is synchronized. it would make sense to have a OnStopSync event too, called after the sync but before the device unmounts)"

9. PartialGestalt on Thu Aug 14, 2008 - "it would be quite useful to have a player or application event for when a track finishes (Player.OnTrackFinished?)" - There are several, much older requests for the same thing in another threads. It sounds familiar with this topic, right? :)

Here are some requests from other threads:

1. DiddeLeeDoo on Sun May 14, 2006 - "Would it be an idea to add an OnIdle event, so certain events can simply create a 'to-do' list for whenever MM is idle, instead of doing it right away."

2. colinT on Sun Oct 29, 2006 - "Is there an event of 2on select" or "dbclick select"? I wish to known when a song has been selected for playback by a user rather than from say autodj."

4. Bex on Thu Jan 24, 2008 - "Would it be possible to get a OnShowTreeMenu event to easier show/hide custom menus? Also OnShowMenu_Pop_NP, OnShowMenu_Pop_NP_MainWindow, OnShowMenu_Pop_TrackList, would be nice for the same reason."

5. ZvezdanD on Mon Feb 04, 2008 - could we get one new event after user change something within filter dialog? Also, event after user change something in Options dialog could be useful."

6. ZvezdanD on Sun Dec 14, 2008 - "Their multi-line edit control don't expose OnSelect event."

7. ZvezdanD on Sat Jan 03, 2009 - "Unfortunately, there are not any event like OnTracklistPopulated or something similar to inform you when tracklist is really populated with all tracks which should contain."
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: monitoring current track without on_play

Post by trixmoto »

I agree with you Teknojnky, but maybe a parameter could be added into indicate whether the track changed due to a skip or not, something like...

Code: Select all

Function OnTrackChange(WasSkipped as Bool)
ADDITION: Nice compilation, I'm sure this will make it easier for the developers to see what's been requested. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Re: monitoring current track without on_play

Post by raybeau528 »

I realize that the subject of requested events is related to but off topic of Technojnky's primary request but I'd like to add support to ZvezdanD's comments. Technojnky's request was submitted today, Sunday, and Peke, a developer, responded just a few hours later and a good discussion ensued. ZvezdanD mentioned an "onFinishAdding" event that's been requested on more than one occasion. I requested the same in the MM wishlist forum http://mediamonkey.com/forum/viewtopic.php?f=4&t=35656 TWO WEEKS ago, and there's been no comments/discussion from and of the developers. If it's not feasible, too resource intensive to implement, low on the priority list, nobody gives a sh*t, fine (sort of) but it would be nice (courteous?) to at least be given the feedback. I can relate and empathize with ZvezdanD frustration.

Ray
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: monitoring current track without on_play

Post by trixmoto »

I also understand the frustration and am not trying to suggest it is unwarranted. I can however assure you that the developers do care, although there's no way that they can read every single forum post (nor would you want them to because they'd never get any development done!) which is why there are moderators. They do however try to keep up with important threads, especially requests from scripters.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: monitoring current track without on_play

Post by Peke »

Unfortunately all of you are right :( and this is why I opened open discussion with you all which ended exactly with confusion I initially had when specifying what new player events MM missing and then make them one by one.

Here is my basic reason of asking this and it is related to last.fm plugin:
When v1.0.1.x was created plugin could only use single winamp msg that MM sent on each play, pause, stop. But that made problem how to determine if plugin should scrobble or not :( After some thinking, testing I've found that adding new event (OnTrackEnd+onPlayCounter plugin event MM sends to plugins) it would solve scrobbling issues and it is added to 3.1 and plugin v1.0.2.x, but I also found that it would be nice to get MM able to scrobble updated sync playcounts from iPod (Big_Berny suggestion), but currently there is no way to to that within MM currently and if we add there should be possibility to be used within scripting also which is another feature to implement.

Regarding issues Ignored/Delayed: Check dates of these issues http://www.ventismedia.com/mantis/view.php?id=1553 , http://www.ventismedia.com/mantis/view.php?id=182 , http://www.ventismedia.com/mantis/view.php?id=1318 they are just Delayed and patience is honorable thing. As already said and proved over the time in various applications (and hardware) being rush in most cases made more problems than they solved (I can give at least 5 issues that we all know and agree on).

See this simple Script:

Code: Select all

Dim i
i = true
While i
	sleep(30000)
	i = false
	sleep(30000)
Wend
and if this script is used for example on one OnPlay Event it would MM act at least strange, especially if user do several fast track skips. Same thing would happen in case of 30 scripts are executed in serial order and each needs 1-3 seconds to finish.

Some things have more influence on MM behavior than the others which need to be much better thought than others and often when you go to fix one thing it implies 100 other related things you were not thinking off and all started as simple few hours fix.

I hope my English was good enough to explain some things without offending anyone and would like to get back on topic ant not expanding things further for now (that will be for next opened topic). So from what I currently see in this thread I can conclude these:

"OnTrackEnd" = Fired when MM finishes internal player on trackend events and library updates (player.currensong would still contain playing track data but updated so that scripts can get most updated track info like playcounter and lastplayed)
"OnTrackChange" and/or "OnPlayerStatus" = This will notify any registered scripts to check player status and/or get current track info according to MM actions:
  • Player is stopped action executed Player.Play or Context "Play Now" on selected tracks is executed) = "OnPlay"
  • Player is playing action executed Player.Stop, Player.Pause or in case Player is paused and Player.Play, Player.Pause is executed = "OnPlayerStatus"
  • Player is playing and starting playback of next track in playlist = "OnTrackEnd" -> when new track start to play -> "OnPlay" (With exception of player.previous on first track in playlist and player.previous is executed which is another issue is implicated and not related to this one but still needs to be solved MM should change Player.CurrentSongIndex to Player.CurrentSongList.Count-1 and trigger events or not trigger any event as no change is made to player and Mm playback status)
  • Player is playing and starting playback of new track in playlist due to player.next/previous, Player.CurrentSongIndex execution or Context "Play Now" on selected tracks is executed) = "OnPlay" (this is how MM currently triggers events and again there is exception as in above state/action)
  • Player is stopped action executed player.next/previous executed = "OnPlayerStatus" after SDB.Player.CurrentSongIndex is set (again there is exception as in above two states/actions)
  • Player is stopping playback due the last track on playlist or stop after current is set = "OnTrackEnd" -> when playback is stopped -> "OnPlayerStatus"
Please Note that this examples are only for player events and if we add events for Now Playing changes it would complicate things considerably so lets keep it simple for now and to cover all player event/actions in full. I hope I haven't missed any, but if I did feel free to correct me.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: monitoring current track without on_play

Post by trixmoto »

Jiri wrote:I plan to add at least something new yet to MM 3.1.
Non-committal yet promising :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Re: monitoring current track without on_play

Post by MoDementia »

Firstly I would like to say I very much welcome discussions of this kind, as the onplay event has needed a review for some time.

Unfortunately it has only been generated because of the Last FM plugin requirements/missing functionality :(

I really really want ipod sync Last FM updating (but isn't covered in Pekes summary?)

It is a shame that only "official" MM requirements get this sort of discussion started.

Part of what makes MM better than any other application is the ability to script for it, lets not piss off our scripters too much so that they no longer contribute to the community?
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: monitoring current track without on_play

Post by ZvezdanD »

Here is a PM which raybeau528 and I got from one scripter which want to stay anonymous:
The only reason this is getting a response is because it effects the last FM plugin which Peke is working on.
I'm surprised we have any scripters left. Most of my scripts have poor workarounds, or just work poorly because of scripting bugs or missing functions.
Very Frustrating indeed :(
I didn't want to talk about MM developing anymore, but this post is telling me that I am not alone with my opinions. You know, if MM developers tell me something like "we are busy", or "we have some more important things to do" or something similar, I could understand that and I would shut up. But I don't like answers as "it could slow down program" with some example of Sleep function.

If you are interested, I have more than 25 years of professional programing experience. The computer in the first company where I worked was bigger than my room, and had perfored paper cards and large 12" magnetic tape reels. In my past time I wrote many programs which respond to events and wrote many ActiveX controls and COM objects which generate events. Some of those events had very large transfer data, sending video streams from video capture boards, also worked with some fast acquisitions hardware. So, I think that I really know what events are. That example with Sleep function is senseless. I could do same thing without any event handler and I could slow down a program as explained before. Heck, I could even wrote external program without use of scripts and intentionally slow down only MM program if I want.

Not implementing some event with excuse how some scripter could misapply this is similar to me like you say "cars kill the people, so we should stop manufacturing cars". In fact, drunk and careless drivers kill people, not cars.

It is also funny how "we should not rush with implementation" (or something like that) is used in same post where are mentioned some requirements dating from 2004. :D
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Re: monitoring current track without on_play

Post by MoDementia »

LOL I wonder who the annonymous scripter was, hehehehehehe OMG :P
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: monitoring current track without on_play

Post by ZvezdanD »

MoDementia wrote:LOL I wonder who the annonymous scripter was, hehehehehehe OMG :P
He will find himself :D
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
DazB
Posts: 409
Joined: Mon Jun 11, 2007 4:09 am
Location: Yorkshire, UK

Re: monitoring current track without on_play

Post by DazB »

Hi,

@ZvezdanD: Well said

Daz
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Re: monitoring current track without on_play

Post by Big_Berny »

IMHO OnSkip can't be really replaced by other events without any workarounds. But since I already have a workaround for that in my script I don't really need that feature - specially because this way I can define by myself what's exactly a Skip and what not.
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: monitoring current track without on_play

Post by Peke »

First off, I didn't want to start any fights, but wanted to include all of you Script developers more active in decisions of improvements due obvious reasons that things need to be improved and that devs recognize it.

Re last.fm plugin: It is not added just for last.fm, but that plugin opened this discussion and as I've added new feature in Plugin structure I wanted to expand this to scripting without prioritizing anything. Plugin was an example how things work and how priority gets changed (Like MoDementia said something needed review for some time) and get done. But I would rather say "Bug" than "official" MM requirement triggered this discussion as dev team noting something has waited too long to get reviewed with willingness of dev team to improve things.

re Mantis examples: like Zvezdan if something is missing and I need it I try to make workaround and those Mantis Bugs I posted are to see that I understand Zvezdan frustration and know what that means (let me refer to something I already said while back "I started to use MediaMonkey as all Broadcasting Automatization lacked database management flexible enough to support specific customization thrum Scripting, Plugins, Addons") things needs to mature. Taking for example large companies like M$ where Win 95 needed to mature in Win98 and where Win ME needed to mature and evolve into WinXP and finally Vista which will (hopefully evolve into) Windows 7 (with Outlining TouchScreen Tech which I already used on touch screen notebook with dx386 40Mhz CPU back in '95. That feature took 13 years to get M$ make partially as MediaCenter feature). Personally(highlighting) as 24/7 MM user I more like to see MM stable with available feature than Bloated with tons of rushed/buggy features.

Re iPod Playcount (I would rather call it Portable Device Playcount) sync: Users requests were driving part in adding that feature to list, so instead of making one feature now devs will add multiple features for various parts of MM including last.fm plugin in a single dev frame. BTW it is in Summary as it should fill last.fm cached tracks with Playcounters on Device sync (on devices that support Device -> PC Playcounter sync) and then submit joined cache to last.fm

Re sleep example: It was just example what will happen if 30 event scripts are executed by 1 sec each and it is not matter that we can slow down MM but rather example what needs to be evaded and solved so that it should not happened or at least make sure that it doesn't interfere with MM functionality that much.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: monitoring current track without on_play

Post by Peke »

To keep things on Topic

@big_berny
Can you explain where "OnSkip" event can't be used with conjunction with example in my post here I'm not sure that I understand what player action would not be available (Simply what user would do in MM UI to trigger that action).

@All
Beside my examples I would like to conclude Missing Player Events so that like Jiri wrote "I plan to add at least something new yet to MM 3.1." and begin to add them in MM correctly without need for poor workarounds or with "scripting bugs or missing features". To walk first step needs to be made.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: monitoring current track without on_play

Post by trixmoto »

During the beta cycle the developers are primarily concerned with getting the application stable, once this is done they then focus more on the scripting capabilities and other new features. It has been this way since I started scripting for MM back in 2005. You need a stable base before you can start adding to it, it's as simple as that.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Post Reply