Maybe not a bug but certainly inefficient
Changing from 1 node to the other i.e. from artist & album artist to album artist
Selected sequence
First track in AAA
First track in AAA
First track in AAA
First track in AA
Triggered 4 times for what is effectively 1 changed selection (maybe 2 if you count the node)
then within the track list changing selection results in
First track
First track
New track
After that it is just 1 per selection change.
I just had a message pop up every time the event was triggered displaying artist
I thought my script was looping some how but now think the event is getting triggered too many times
Event OnChangedSelection between nodes
Moderator: Gurus
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
Re: Event OnChangedSelection between nodes
Not in Mantis
Save as OnSelection.vbs in Scripts\Auto\
Save as OnSelection.vbs in Scripts\Auto\
Code: Select all
Sub OnStartup
Script.RegisterEvent SDB, "OnChangedSelection","OnSelection"
End Sub
Sub OnSelection
SDB.MessageBox "Onselection Triggered", mtError, Array(mbOk)
End Sub
Re: Event OnChangedSelection between nodes
This is caused by the way how events are handled internally in MM. So, unless it causes serious problems in some cases (please describe, if you have an example), I'd prefer not fixing this, since it could introduce other problems, particularly for already existing scripts.
Jiri
Jiri
Re: Event OnChangedSelection between nodes
Not sure what problems it could cause by fixing, but I know that it would help avoid problems caused by a script being called multiple times when it does not have some time type of mutex to ensure that it not called multiple times in rapid succession for what should be a single event.
see also
http://www.mediamonkey.com/forum/viewto ... =2&t=36256
see also
http://www.mediamonkey.com/forum/viewto ... =2&t=36256
New script:
Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page


Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page

Re: Event OnChangedSelection between nodes
Oh well. You MM developers are not serious and don't respect your scripters at all. I mean, it is great if you decide to implement suggestions of some scripters, even if they are breaking compatibility with some existing scripts, but I expect at least to see some public information about that. You didn't mention anywhere that you changed OnChangedSelection behavior with 3.1.0.1251. even not in the wiki. I spent several hours trying to find what is wrong with my script with the latest MM version, knowing that it worked fine with older MM versions.
Well, now I know that OnChangedSelection is generated only once when some node changed, but it is very discussable if you should generate that event before (as it is now implemented) or after some node is changed. I expect in my event handler that it is generated after the current node is already changed, not before. Well, if you want to be really attentive, you should add one more event, let say OnChangingSelection, which should be generated before some node is changed.
Well, now I know that OnChangedSelection is generated only once when some node changed, but it is very discussable if you should generate that event before (as it is now implemented) or after some node is changed. I expect in my event handler that it is generated after the current node is already changed, not before. Well, if you want to be really attentive, you should add one more event, let say OnChangingSelection, which should be generated before some node is changed.
● 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