|
|
#1 |
|
Junior Member
Join Date: Jul 2007
Posts: 10
|
ipc_set_shuffle crash
I'm trying to prevent the user with my loaded plugin to accidentially activate playlist shuffle.
I've set it up this way. In the WndProc method I'm listening for the IPC_SET_SHUFFLE message to detect if the user has pressed the toggle shuffle button. So in that case, I'm calling a SendMessage(hwnd, WM_WA_IPC, 0, IPC_SET_SHUFFLE) to set it back to 'disabled' again. Though this results in Winamp crashing... Toggling IPC_SET_SHUFFLE on other messages work perfectly however. Any ideas for getting around this? Thanks |
|
|
|
|
|
#2 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,483
|
sending IPC_SET_SHUFFLE effectively re-triggers the toggle action and i'm sure if you checked the code, you end up in an endless loop and cause a stack fault. instead try using SendMessage(hwnd,WM_COMMAND,MAKEWPARAM(40023,0),0)
which should work better (though you need to ideally keep a check on the state you're already in). funnily enough i made some time back this which already does what you're trying to do) -daz |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2007
Posts: 10
|
Thanks for a quick reply. Your plugin works a lot better than mine, but I'd really want to implement the same thing in mine. I substituted my endless loop of IPC_SET_SHUFFLE's with something that looks like this:
code: This has no visible effect. The playback is still random and clicking the toggle button still works properly. You mentioned that I need to keep a check on the state, but as I can't see what MAKEWPARAM(40023,0) is accomplishing, I don't see how I should act if it's enabled or disabled. |
|
|
|
|
|
#4 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,483
|
oops, i missed the part of your post saying you were waiting on IPC_SET_SHUFFLE (that's only used by other plugins and not general by winamp or from any user interactions). obviously disabling it from working with other plugins isn't a good thing to do, just user interactions
40023 is the menu id of the shuffle menu item (right-click on the shuffle button) and it is used as the internal message id for the shuffle command when you toggle it from any of the other windows (that obviously pass/implement the common keyboard handling in winamp). here's what i have as the window proc for that plugin - it handles the keyboard accelerator and should work correctly irrespective of the skin in use (classic/modern) -dazcode: |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jul 2007
Posts: 10
|
Cool stuff. That's a lot of help for me! Is there a list of these menu id's somewhere, so I can look other stuff up as well?
I noticed however that you can invoke a random jump occasionally, for example when playback is stopped. It seems to always be working when the playback is running though. Strange. I guess there are some more secret id's I don't know about. :P Also, I find it really confusing that the "light bulb" that tells me if the shuffle is on or off lights up, even though the shuffle isn't activated. Can this be turned off with one of these id's too? That would be *awesome* Really appreciate your help and devotion for this SDK. |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jul 2007
Posts: 10
|
Hmm, I just found out that this is true only for the modern skin. Winamp classic is behaving just as one would expect.
So, what's up with the modern skins? |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jul 2007
Posts: 10
|
I've figured out a sneaky solution that fixes shuffle sporadicalness when the player is stopped. I changed the WPARAM value of 'S' to 's', so Winamp never detects the S key.
code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|