|
![]() |
#1 |
Junior Member
Join Date: Jul 2010
Posts: 3
|
Winamp and Java (JNI) problem
Hi,
I'm trying to write a Winamp plugin in Java with use of JNI. this is my JavaNative class: code: this is the (important) code in gen_wmpTest: code: When I configure my plugin in Winamp it will start playing (as it should). But when I make a call to playPause() in Java it doesn't i DO get the message "jni call" in my command prompt. Anyone has a clue on what I am doing wrong? Thanks, Theepot |
![]() |
![]() |
![]() |
#2 |
Join Date: Sep 2003
Posts: 27,873
|
if you're getting the printf(..) on playPause(..) then either the value of plugin.hwndParent has changed / become invalid or maybe Winamp is already playing and it's possible sending that message again will have no effect (i can't remember what the expected behaviour is and am not in a position to try out actual code).
you could try using SendMessage(plugin.hwndParent, WM_COMMAND, MAKEWPARAM(WINAMP_BUTTON3, 0), 0); to toggle the paused state (as i'll assume is what you're trying to achieve with that function. -daz |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jul 2010
Posts: 3
|
when winamp is playing it will just jump to the start of the song
plugin.hwndParent might have changed but I'm not sure how that part works ![]() I'll try your suggestion and post the results EDIT: i tried your line of code and it worked in the config() function but not in playPause(). think your right about the value of plugin.hwndParent having changed, got no clue on how to fix that though. ~Theepot Last edited by theepot; 29th July 2010 at 23:14. |
![]() |
![]() |
![]() |
#4 |
Join Date: Sep 2003
Posts: 27,873
|
the only thing i can think off is to do a test on plugin.hwndParent in playPause(..) and check that it is a valid HWND (can use IsWindow(..) ) and try to work it out from there as i've no idea how JNI works with plug-ins and if it keeps loading the plug-in dll again causing the plugin.hwndParent member to become invalid or never get filled in.
-daz |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Jul 2010
Posts: 3
|
that's something to look in to.
well thanks for the help I'll try to figure it out! ~Theepot |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|