View Issue Details

IDProjectCategoryView StatusLast Update
0006719MMW v4Framework: Scripts/Extensionspublic2011-05-28 00:41
Reporterzvezdan Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status feedbackResolutionreopened 
Fixed in Version4.0 
Summary0006719: Bugs with OnNowPlayingSelectionChanged, OnTrackListSelectionChanged and OnTrackListFilled (and problem with OnChangedSelection)
DescriptionThese event are almost unusable because of their current implementation, especially when you switch to the empty tracklist.
Steps To ReproduceHere is the test script:
Option Explicit

Sub OnStartup()
    Script.RegisterEvent SDB, "OnNowPlayingSelectionChanged", _
            "OnNowPlayingSelectionChanged"
    Script.RegisterEvent SDB, "OnTrackListSelectionChanged", _
            "OnTrackListSelectionChanged"
    Script.RegisterEvent SDB, "OnTrackListFilled", "OnTrackListFilled"
End Sub

Sub OnTrackListFilled()
    SDB.MessageBox "OnTrackListFilled", mtInformation, Array(mbYes)
End Sub

Sub OnNowPlayingSelectionChanged()
    SDB.MessageBox "OnNowPlayingSelectionChanged", mtInformation, Array(mbYes)
End Sub

Function OnTrackListSelectionChanged()
    SDB.MessageBox "OnTrackListSelectionChanged", mtInformation, Array(mbYes)
End Function
Additional InformationI have really serious problems with my scripts because MM doesn't generate events when tracklist is emptied (http://www.mediamonkey.com/forum/viewtopic.php?p=187596#p187596). My scripts are waiting for OnTrackListSelectionChanged and OnTrackListFilled events to do something whenever user (or script itself) change the current node, but with empty nodes they could wait in the endless loop forever.

For example, if I have tracklist with some tracks, and if I click on the Classification, Files to Edit or similar node, MM doesn't generate any event. Well, it generates OnTrackListFilling and OnChangedSelection, but I need an event on finished list filling, not on the begin.

Much more confusing is because such behavior is not consistent. For example, OnTrackListFilled event is not generated with empty tracks from Classification, Files to Edit, My Computer, Network (from My Computer)..., but it is generated with another empty sub-nodes from My Computer, e.g. C:\, D:\, My Documents, My Desktop... Virtual CD, Playlists, Podcast Subscription, ... are also empty, but generates that event.

I have one more observation about OnNowPlayingSelectionChanged and OnTrackListSelectionChanged events and I think this is a bug. Let say that I have exactly one track in the main tracklist and exactly one track in the Now Playing panel and let say that both tracks are selected. We have two scenarios:
1. scenario:
- click on the track in the tracklist;
- click on the track in the NP panel, but exactly on the text part of a cell (for example, if Artist is Pink Floyd you should click on that text in the cell area) -> OnNowPlayingSelectionChanged is generated.

2. scenario:
- click on the track in the tracklist;
- click on the track in the NP panel, but not on the text, i.e. you should click on the cell area after the text -> OnNowPlayingSelectionChanged is not generated!

Same behavior we also have in opposite direction when we click on the text/non-text part of table cells in the main tracklist -> OnTrackListSelectionChanged event is generated only if we click on the text in the table. Note that you should click on the track that is already selected before (which is already a case with tracklist that has only one track).

This is very inconsistent and because of that I cannot detect in my script when some user has changed current panel. Well, I could use OnChangedSelection event instead, which is always generated when I switch between main tracklist and NP panel (without a regard if I click on the text or not), but I want to avoid use of that event because I have another serious problems with it.

OnChangedSelection event is especially problematic after you changed its behavior in 3.1.0.1251. which you didn't mention anywhere, 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 (http://www.mediamonkey.com/forum/viewtopic.php?p=250960#p250960).

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. Because of such new behavior I need to use additional Timer control and such solutions are always just unreliable hacks.

You know, I am not satisfied with the answer which I got from Jiri ("you can use OnChangedSelection event which is fired anytime"). Oh please, if I need to use OnChangedSelection and some timers to avoid the mentioned problems with OnTrackListSelectionChanged and OnTrackListFilled events, then why did you add these new events at all? I am not using them because of these problems and I doubt that anybody is using them as well. We don't need something which sometimes works as it should and sometimes doesn't work. I suppose that you don't need unreliable scripts as well.
TagsNo tags attached.
Fixed in build1365

Relationships

related to 0007680 assignedLudek ISDBApplicationEvents::OnNodeLeave, OnNodeFocusing and OnNodeFocused events needed 
related to 0009024 closedLudek OnChangedSelection is not firing when user change selection in Now Playing panel since b1367 

Activities

jiri

2010-11-25 10:29

administrator   ~0021471

Ludek, please look into OnChangedSelection, whether its generation is correct, or whether we could generate it in more useful moment.

Then I suppose that we should generate OnTrackListFilled for all empty nodes.

Ludek

2011-01-20 14:58

developer   ~0022491

Last edited: 2011-01-20 15:04

The problem with OnTrackListFilled is fixed in build 1345.

The problems with OnNowPlayingSelectionChanged and OnTrackListSelectionChanged - I haven't been able to reproduce, despite the fact whether I click on the text area or not the event is always fired (tested MM 3.2, MM 4.0 - both skinned and skinless)

The problem with OnChangedSelection is that it is called twice, once when tracklist is cleared and the populating starts and then it is called second time (once tracklist is populated) together with OnTrackListFilled.
Verified with build 1344 and by using:
SDB.MessageBox "OnChangedSelection " & SDB.CurrentSongList.Count, mtInformation, Array(mbYes)
The behaviour shouldn't cause any trouble and might be useful, why you need to use a timer?

zvezdan

2011-01-20 20:02

updater   ~0022503

Last edited: 2011-01-20 20:18

Well, I really don't know what you are doing, but you have different behavior with every version. Here is slightly changed script:

Option Explicit

Sub OnStartup()
    Script.RegisterEvent SDB, "OnNowPlayingSelectionChanged", _
            "OnNowPlayingSelectionChanged"
    Script.RegisterEvent SDB, "OnTrackListSelectionChanged", _
            "OnTrackListSelectionChanged"
    Script.RegisterEvent SDB, "OnChangedSelection", "OnChangedSelection"
    Script.RegisterEvent SDB, "OnTrackListFilled", "OnTrackListFilled"
End Sub

Sub OnChangedSelection()
    Dim sTmp

    If Not SDB.MainTree.CurrentNode Is Nothing Then
        sTmp = vbCr & SDB.MainTree.CurrentNode.Caption
    End If
    sTmp = sTmp & vbCr & "Visible tracks:" & SDB.AllVisibleSongList.Count
    SDB.MessageBox "OnChangedSelection" & sTmp, mtInformation, Array(mbYes)
End Sub

Sub OnTrackListFilled()
    SDB.MessageBox "OnTrackListFilled", mtInformation, Array(mbYes)
End Sub

Sub OnNowPlayingSelectionChanged()
    SDB.MessageBox "OnNowPlayingSelectionChanged", mtInformation, Array(mbYes)
End Sub

Function OnTrackListSelectionChanged()
    SDB.MessageBox "OnTrackListSelectionChanged", mtInformation, Array(mbYes)
End Function

Steps to reproduce:
1. Clear Now Playing panel and put one track in it, e.g. using drag&drop;
2. find some node which has only one track in the main tracklist (let say that it is different then track in the NP since I had such condition);
2. select that track in tracklist and ignore all message boxes;
3. select track in the NP and ignore all message boxes;
4. now, select again track in tracklist, but click on some part of its row without text;
5. select track in NP, but click on some part of its row without text;
6. repeat 4. and 5. several times, sometimes for example by click on the text part of row.

Here is what is happening with different versions:
MM 3.2.0.1294 - only OnChangedSelection event generated, not matter if you click on the text part or empty part;

MM 4.0.0.1333 - when you click on empty part of row nothing is happening, when you click on text part of row OnChangedSelection event is generated and OnNowPlayingSelectionChanged or OnTrackListSelectionChanged depending on which panel you have clicked (tracklist or NP);

MM 4.0.0.1344 - OnChangedSelection event is always generated and OnNowPlayingSelectionChanged or OnTrackListSelectionChanged are generated depending on which panel clicked (tracklist or NP) not matter if you click on text part or empty part, however those two events are generated even if you click on the same row again, i.e. you clicked on the row of tracklist and clicked again on that same row of the tracklist; these events should not be generated in that case since you didn't change any selection, nor you changed panel.

Here is another test and steps to reproduce with the same script:
1. Find two nodes one, e.g. one with one track and another with 3 tracks (it is not matter how many tracks, but just as an example, there shuld be different numbers of tracks);
2. click on node with one track, then click on another with 3 tracks and ignore all message boxes;
3. now, click on the first node with one track -> observe displayed node caption and number of tracks in the OnChangedSelection message box;
4. click on the second node with 3 tracks -> observe same;
5. repeat 4. and 5. several times.

Here is what is happening depending of version:
MM 3.2.0.1294 - OnChangedSlection generated only once per node switch, message box generated in that event handler displays caption of the new node, but the number of tracks from the old node; requires timer to get correct number of tracks for new node;

MM 4.0.0.1333 - OnChangedSlection generated only once per node switch, message box generated in that event handler displays caption of the new node and the number of tracks from the new node; this behavior is the best;

MM 4.0.0.1344 - OnChangedSlection generated twice per node switch, both times displays caption of new node, first time displays number of tracks from old node, the second time displays number of tracks from new node; IIRC I think that you had such behavior with old versions (< 3.1.0.1251), but if you want to generate that event twice then it should return caption of the old node when it is first generated (you know, it is not the caption of node which is only important, but whole node object with all its properties, e.g. CustomNodeID...).

Ludek

2011-01-24 13:02

developer   ~0022553

Fixed in build 1345:
- OnNowPlayingSelectionChanged and OnTrackListSelectionChanged are now called only if selection was indeed changed
- OnChangedSelection is called only once after node change
- OnTrackListFilled is called for the empty nodes too

zvezdan

2011-01-25 12:32

updater   ~0022604

The mentioned events are not generated for all empty nodes in 1345:
- Files To Edit, Preview, Virtual CD, Playlists, Net Radio (and probably all other built-in empty nodes) -> only OnTrackListFilled generated;
- Magic Nodes, Play History (and probably all other custom nodes) -> none event is generated.

When you switch to some empty node all 3 mentioned events should be generated (OnChangedSelection, OnTrackListFilled and OnTrackListSelectionChanged).

zvezdan

2011-01-25 12:57

updater   ~0022607

There is one more problem with the current realization, here are steps to reproduce with the previous test script:

1. put several tracks in Now Playing panel and choose some node which has displayed several tracks in the main tracklist;
2. select one track in NP and ignore all message boxes;
3. select one track in tracklist and ignore all message boxes;
4. click on the same (already selected) track in NP -> none event is generated.

Similar apply to the main tracklist, i.e. if you click on the already selected track in the tracklist none event is generated.

This is very bad behavior because we don't have any way to detect when user has changed panel. You should generate OnChangedSelection at least as it was before.

Ludek

2011-01-27 18:11

developer   ~0022669

Fixed in build 1346

zvezdan

2011-02-09 21:55

updater   ~0022973

Confirmed with 1348. Thanks you so much and please don't change anything about it anymore. It is perfect as it now.

zvezdan

2011-02-09 22:44

updater   ~0022978

I am so sorry, I tested only the latest reported issue. The previous one is still unresolved:

The mentioned events are not generated for all empty nodes in 1348:
- Files To Edit, Preview, Virtual CD, Playlists, Net Radio (and probably all other built-in empty nodes) -> only OnTrackListFilled generated;
- Magic Nodes, Play History (and probably all other custom nodes) -> none event is generated.

When you switch to some empty node all 3 mentioned events should be generated (OnChangedSelection, OnTrackListFilled and OnTrackListSelectionChanged).

Ludek

2011-02-09 23:01

developer   ~0022982

Thanks, fixed in build 1349.

zvezdan

2011-02-16 11:44

updater   ~0023135

I am sorry, but I cannot see any difference between 1348 and 1349. When you click on:
- Files To Edit, Preview, Virtual CD, Playlists, Net Radio (and probably all other built-in empty nodes) -> only OnTrackListFilled is generated;

When you click on:
- Magic Nodes, Play History (and probably all other custom nodes) -> none event is generated.

The same event(s) should be fired not matter which node is selected, the custom or the built-in one. Beside of OnTrackListFilled, the empty nodes should fire OnChangedSelection and OnTrackListSelectionChanged at least when you switch from a node with selected track(s) to some empty node since the selection is changed in that case as well.

Ludek

2011-02-16 14:41

developer   ~0023145

Zvezdan, please re-test.

It works fine for me in build 1349 for all nodes (Files To Edit, Preview, Virtual CD, Magic Nodes, ...)

zvezdan

2011-02-16 15:46

updater   ~0023149

Sorry, I didn't post the exact results. Here is exactly what I have with 1349:
1. all nodes with one or more tracks, except Now Playing node -> OnChangedSelection, then OnTrackListSelectionChanged, then OnTrackListFilled;

2. Now Playing node with 2 tracks -> only OnTrackListFilled is generated (why is it not same as 1. case since it is not empty?);

3. empty Files To Edit, Multiple Artist Album, Duplicate Content, Playlists, My Computer, Net Radio nodes -> OnTrackListFilled, then OnChangedSelection; then OnTrackListSelectionChanged (why is it different order of execution of events then in 1. case?);

4. empty Unorganized files, Preview, Virtual CD, Podcast, UPnP Servers, Search Results nodes -> only OnTrackListFilled is generated;

5. empty Magic Nodes, Play History & Stats nodes -> none event is generated.

I am talking about nodes with the specified captions, not about their sub-nodes.

You see, we have 5 different cases which is not really consistent.

Ludek

2011-04-11 19:25

developer   ~0024229

Issues 1, 3, 5 fixed in build 1364.
Issue 2 is not reproducable here.
Issue 4 is not issue from my perspective, because tracklist selection isn't changed if you switch from an empty node to another empty node.

zvezdan

2011-04-11 19:49

updater   ~0024233

Sorry, but when did I say that I switched from an empty node to another empty node? Here is my words: "the empty nodes should fire OnChangedSelection and OnTrackListSelectionChanged at least when you switch from a node with selected track(s) to some empty node"

Here is steps to reproduce:
1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
2. select Preview node (assuming that it is empty) -> only OnTrackListFilled is generated; why its behavior is different from Files To Edit node?

Here is another steps to reproduce:
1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
2. select Now Playing node (assuming that NP has one or more tracks) -> on my computer only OnTrackListFilled is generated; do you want to say that your computer fires other events as well?

From my perspective those are issues since they are not consistent.

zvezdan

2011-04-14 08:06

updater   ~0024308

Tested 1364, and there are still some of the mentioned issues. Actually, the mentioned issue 1 was not an issue, it was the correct behavior; issues 3 and 5 are fixed, but 2 and 4 are not fixed.

Here is the correct behavior again, now as the case A:
A1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
A2. select any node with one or more tracks (except Now Playing node) -> OnChangedSelection, then OnTrackListSelectionChanged, then OnTrackListFilled.

Here is another correct behavior, now as the case B:
B1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
B2. select Files To Edit or Multiple Artist Album or Duplicate Content or Playlists or My Computer or Net Radio or some custom node like Magic Nodes or Play History & Stats (assuming it is empty) -> OnChangedSelection, then OnTrackListSelectionChanged, then OnTrackListFilled; this is correct since the selection is changed.

Here is another (unintentional) correct behavior, now as the case C:
C1. select Files To Edit or any other node from B2 (assuming it is empty) and ignore all message boxes;
C2. select Unorganized files or Preview or Virtual CD or Subscriptions or Podcast Directories or Podcast (on the topmost level) or Media Servers or Search Results node (assuming that it is empty) -> only OnTrackListFilled is generated, which is correct since you switched from one empty node to another empty node.

Steps to reproduce, the new issue 1:
1.1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
1.2. select Now Playing node (assuming that NP has one or more tracks) -> only OnTrackListFilled is generated; why it is different from the case A?

Steps to reproduce, the new issue 2:
2.1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
2.2. select Unorganized files or Preview or Virtual CD or Subscriptions or Podcast Directories or Podcast (on the topmost level) or Media Servers or Search Results node (assuming that it is empty) -> only OnTrackListFilled is generated; why its behavior is different from the case B since in both cases we switched from the filled node to the empty node?

You told me that you didn't correct the previous issue 4. because from your perspective "tracklist selection isn't changed if you switch from an empty node to another empty node". However, you have the next issue which is opposite to your words, now as the new issue 3:
3.1. select Files To Edit or any other node from B2 (assuming it is empty) and ignore all message boxes;
3.2. select any other node from B2, e.g. Multiple Artist Album or Playlists (again, assuming it is empty) -> OnChangedSelection, then OnTrackListSelectionChanged, then OnTrackListFilled are fired; how is that, shouldn't be fired only OnTrackListFilled?

To summarize, if you want the consistent behavior:
A. switching from a filled node to any other filled node should fire all 3 events;
B. switching from a filled node to any empty node should fire all 3 events;
C. switching from an empty node to any other empty node should fire only OnTrackListFilled;
D. switching from an empty node to any filled node should fire all 3 events.

Ludek

2011-04-14 09:52

developer   ~0024310

Last edited: 2011-04-14 09:56

There are some other problems. Some scripts like MonkeyTunes uses OnChangedSelection event to set visibility of Media Tree context-menu items. The problem is that OnChangedSelection is now called only once after the track list is fully filled.

Suggested approaches:
1. Revert it back so that OnChangedSelection is called twice
- first time when a Media Tree node is changed and track list is empty
- second time when track list is fully filled

2. Add another OnMediaTreeChangedSelection method, but this would not solve the backward compatibility issues

zvezdan

2011-04-14 11:34

updater   ~0024311

I don't mind if you revert it back to that OnChangedSelection is called twice. However, I have another suggestion when you should fire that event, i.e. what should happen in the corresponding event handler:
- first time SDB.MainTree.CurrentNode should return the old node object, SDB.AllVisibleSongList should return tracks from the old tracklist;
- the second time SDB.MainTree.CurrentNode should return the new node object, SDB.AllVisibleSongList should return tracks from the new tracklist.

Your old behavior:
- first time SDB.MainTree.CurrentNode returned the new node object (wrong!) and SDB.AllVisibleSongList returned tracks from the old tracklist;
- second time SDB.MainTree.CurrentNode returned the new node object, SDB.AllVisibleSongList returned tracks from the new tracklist.

Ludek

2011-04-14 11:42

developer   ~0024313

I think that correct behaviour (to be backward compatible) should be:

- first time SDB.MainTree.CurrentNode returns the new node object and SDB.AllVisibleSongList returns no tracks (because track list isn't filled yet)
- second time SDB.MainTree.CurrentNode returns the new node object, SDB.AllVisibleSongList returns all tracks once filling of tracklist is finished.

The reason here is that MonkeyTunes needs to reflects node change immediatelly so that it could set up correct context menu items, it is too late to do this once tracklist is full

zvezdan

2011-04-14 11:49

updater   ~0024314

Last edited: 2011-04-14 12:02

You are wrong, to be backward compatible you should have the same behavior as before. I just tested 3.1.0.1224 and it has the behavior which I mentioned:
- first time SDB.AllVisibleSongList returns tracks from the old tracklist, not empty list.

However, when I think more about it, your suggestion is more logical, but as I said it is not backward compatible.

Ludek

2011-04-14 12:01

developer   ~0024316

Ok, but this was wrong behaviour, it doesn't make sense to return new node and old tracklist, the point here is that changing a node needs to be reflected ASAP therefore I believe that the best would be the behaviour I suggested in the note 24313

zvezdan

2011-04-14 12:05

updater   ~0024317

Yes, I agree as I wrote in the edited previous post.

Ludek

2011-04-14 13:58

developer   ~0024321

Fixed in build 1365.

zvezdan

2011-04-18 22:52

updater   ~0024374

You still haven't resolved the issues which I mentioned in note 24310, but just added one more OnChangedSelection call for non-empty nodes. Here is what we have now:

The correct behavior A (switching from a filled node to any other filled node):
A1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
A2. select any node with one or more tracks (except Now Playing node) -> OnChangedSelection fired twice, then OnTrackListSelectionChanged, then OnTrackListFilled.

The correct behavior B (switching from a filled node to any empty node):
B1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
B2. select Files To Edit or Multiple Artist Album or Duplicate Content or Playlists or My Computer or Net Radio or some custom node like Magic Nodes or Play History & Stats (assuming it is empty) -> OnChangedSelection fired once, then OnTrackListSelectionChanged, then OnTrackListFilled.

The correct (discussable) behavior C (switching from an empty node to any other empty node):
C1. select Files To Edit or any other node from B2 (assuming it is empty) and ignore all message boxes;
C2. select Unorganized files or Preview or Virtual CD or Subscriptions or Podcast Directories or Podcast (on the topmost level) or Media Servers or Search Results node (assuming that it is empty) -> OnChangedSelection fired once, then OnTrackListFilled; why OnChangedSelection event is fired at all since the selection is not changed?

The issue 1:
1.1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
1.2. select Now Playing node (assuming that NP has one or more tracks) -> OnChangedSelection fired just once (the second call after the trackslist is filled), then OnTrackListFilled; why it is different from the case A (the first OnChangedSelection call and OnTrackListSelectionChanged are missing) since in both cases we switched from a filled node to another filled node?

The issue 2:
2.1. select Music or any other node which has displayed one or more tracks and ignore all message boxes;
2.2. select Unorganized files or Preview or Virtual CD or Subscriptions or Podcast Directories or Podcast (on the topmost level) or Media Servers or Search Results node (assuming that it is empty) -> OnChangedSelection fired once, then OnTrackListFilled; why its behavior is different from the case B (here OnTrackListSelectionChanged is missing) since in both cases we switched from the filled node to the empty node?

The issue 3:
3.1. select Files To Edit or any other node from B2 (assuming it is empty) and ignore all message boxes;
3.2. select any other node from B2, e.g. Multiple Artist Album or Playlists (again, assuming it is empty) -> OnChangedSelection fired once, then OnTrackListSelectionChanged, then OnTrackListFilled; why its behavior is different from the case C, i.e why you fired OnTrackListSelectionChanged here?

zvezdan

2011-04-18 23:09

updater   ~0024376

There is one more issue with OnChangedSelection, I think it was resolved (I cannot find that report), but it is back.

Steps to reproduce:
1. click on some node which have non-empty tracklist and ignore all message boxes (I am still talking about the test script from note 22503);
2. click on some track from tracklist and ignore all message boxes;
3. click on the same track, even the same cell -> OnChangedSelection is fired although the selection is not changed.

Ludek

2011-04-18 23:18

developer   ~0024377

Well, maybe it still isn't 100% consistent (reason is that we handle different groups of nodes different way internally), but I think that it generally works much better than before and is backward compatible.

Ludek

2011-04-18 23:25

developer   ~0024379

Last edited: 2011-04-18 23:35

The last issue with OnChangedSelection (#c24376)) will be fixed in build 1366.

zvezdan

2011-04-18 23:46

updater   ~0024380

Well, you could state whatever excuse you want, but those are still unresolved issues. You already agreed that the current behavior is not backward compatible, but has more sense. Besides, resolving the inconsistent behaviors doesn't mean that you would break the compatibility.

How about your insisting to return back the old behavior with two OnChangedSelection calls because of some script, but you still have the issue 1 (Now Playing node) where you are not firing the first call of that event with the empty tracklist? By the way, I really don't understand why some script would need two calls of that event and to create the context menu items when the tracklist is empty, but not when it is already filled.

Ludek

2011-04-19 01:22

developer   ~0024390

Last edited: 2011-04-19 01:28

Look here: http://www.mediamonkey.com/forum/viewtopic.php?f=19&t=54732
the 'Monkey Tunes' script wants to set up visibility of the context menu item like 'Pair Device...' for the particular node despite the fact whether the track list has been already filled or not. And the script uses OnChangedSelection event for detection of node change.

zvezdan

2011-04-19 07:24

updater   ~0024393

Your are contradicting yourself. Here is your old words: "The reason here is that MonkeyTunes needs to reflects node change immediatelly so that it could set up correct context menu items, it is too late to do this once tracklist is full". However, you are now telling that "the 'Monkey Tunes' script wants to set up visibility of the context menu item like 'Pair Device...' for the particular node despite the fact whether the track list has been already filled or not".

If it is too late to create the context menu once the tracklist is full as you stated before, then his script still has a problem with the Now Playing node because you are not firing OnChangedSelection event for that node when the tracklist is emptied, but only when it is fully filled.

What about script which are handling OnTrackListSelectionChanged event? They would work correctly only with some nodes, but not all, since that event has totally inconsistent behavior.