Old 16th May 2014, 16:49   #1
hifreeo
Junior Member
 
Join Date: Nov 2012
Posts: 6
IPC_PE_DELETEINDEX time limit between calls?

I am using this call to delete the title with position=index from my playlist, which works perfectly fine. (python 3)

code:
win32api.SendMessage(self.__playlistHWND, self.WM_WA_IPC, self.IPC_PE_DELETEINDEX, index)


The problem is, it seems there is a time limit between the calls. I simply have to WAIT until the song played at least exactly 9 seconds, until this call works again. The return value is always 0, but the call has no effect, if I don't wait 9 secs.

Is there any way to reset the time limit, so I can send the call faster than that? Or is there even any alternative for deleting a title from my currently active playlist?

Thank you for you help!
hifreeo is offline   Reply With Quote
Old 16th May 2014, 16:55   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
there is no time limit in place in the code for the IPC_PE_DELETEINDEX method or any of the other API methods provided (it'd just be how long it takes to process the request).

if you're experiencing such an issue then it could be down to what you're using to interact with Winamp (maybe it's spawning multiple processes and that's the time limit on things) or even a 3rd party plug-in you've installed into the Winamp install. and it could even be a problem with the Winamp version being used (as the current release is v5.666 build 3516 -> http://forums.winamp.com/showthread....74929#download along with plug-in updates from http://forums.winamp.com/showthread....373755#updates).

if you're only doing one removal at a time, you could try using PostMessage(..) instead of SendMessage(..) though that introduces the possibility of the wrong item being removed if something happens between the message being posted and subsequently received by Winamp.
DrO is offline   Reply With Quote
Old 16th May 2014, 20:28   #3
hifreeo
Junior Member
 
Join Date: Nov 2012
Posts: 6
I've played around a bit more and finally found, that somehow the NOTIFICATION BUBBLE MESSAGE is resonsible for blocking the call! As long as the notification is displayed, the call has no effect. When I disable notifications ("Never show"), I can correctly send the call as often and as fast as I want.

DrO, do you know what is going on here? Is there any way to keep notifications without blocking the call?
Btw, I've tried 'safe mode', which had no effect on the problem - it persisted.
I'm using Winamp 5.666 Build 3516.
hifreeo is offline   Reply With Quote
Old 16th May 2014, 20:57   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
safe mode would not help in such a situation unless it was caused by a 3rd party plug-in.

as you're doing this externally of Winamp, i'd have to suspect that you're not getting the correct HWND for Winamp when the notification is shown. so as a starting point, i'd make sure that you've got a valid HWND.
DrO is offline   Reply With Quote
Old 19th May 2014, 14:53   #5
hifreeo
Junior Member
 
Join Date: Nov 2012
Posts: 6
I'm very sure I got the correct HWND. Here's an excerpt from the code (from pywinamp)

code:
self.__playlistHWND = self.__findWindow([("BaseWindow_RootWnd", None),
("BaseWindow_RootWnd", "Playlist Editor"),
("Winamp PE", "Winamp Playlist Editor")])



code:
def __findWindow(self, windowList):
"""Gets a handle to the lowest window in the given windows hierarchy.
The given list should be in format of [<Window Class>, <Window Name>]."""
currentWindow = None
for i in range(len(windowList)):
if currentWindow is None:
currentWindow = win32gui.FindWindow(windowList[i][0],
windowList[i][1])
else:
currentWindow = win32gui.FindWindowEx(currentWindow, 0,
windowList[i][0], windowList[i][1])
return currentWindow



The only thing I think is strange is that AutoHotKey's Window Spy tells me, that Winamps Playlist Editor has the classname "BaseWindow_RootWnd2". But when I insert the 2 then my script doesn't work anymore.
Assuming the HWND is correct, what would be the next step?

Last edited by hifreeo; 19th May 2014 at 14:55. Reason: improve formatting
hifreeo is offline   Reply With Quote
Old 19th May 2014, 15:41   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
you're doing a skin specific check for the playlist editor HWND which is why it's going to fail. you really need to get the main Winamp HWND ("Winamp v1.x" is usually the class and not a BaseWindow_RootWnd type window) and then use SendMessage(hwnd_winamp,WM_WA_IPC,IPC_GETWND_PE,IPC_GETWND) to get the playlist editor HWND that way (which is then done skin independent).
DrO is offline   Reply With Quote
Old 19th May 2014, 16:24   #7
hifreeo
Junior Member
 
Join Date: Nov 2012
Posts: 6
Thank you DrO! Works perfectly now!
hifreeo is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump