|
|
#1 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Minibrowser API Support for Winamp 5.22+
Since winamp 5.22, the minibrowser API is "gone for good"..
I don't like this, so I made a plugin for minibrowser API support! With this plugin, your plugin with minibrowser should work fine. Source code included. If you have any comment, please reply this thread.. though I don't ensure I will answer.. |
|
|
|
|
|
#2 |
|
Join Date: Sep 2003
Posts: 27,873
|
the plugin needs to be multi-user compatible (have a look below some example code) otherwise i've not had a chance to give it a look over since i see you've also submitted it to the winamp.com site. btw the future of the minibrowser apis is still somewhat unclear (the reason it doesn't working in 5.22+ is because it was all stripped out when things were split up in gen_ml for the 5.22 release) but may/may not be re-implemented natively (though if this works well then it could save the devs time having to reimplement and just let other authors rebundle this with their plugins as needed could be an option).
anyway example code for getting winamp.ini correctly for all winamp versions is... -dazcode: |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Minibrowser API Support 0.2 for Winamp 5.22+
Thanks for DrO, I added multi-user support to the plugin.
Also, there is a problem on 0.1 that winamp does not quit successfully.. Sorry about this. It is fixed (kinda) with 0.2 with ExitProcess().. but if anybody knows a better solution, please let me know. (ps) But.. yeah, this plugin is for winamp 5.22+... it is not necessory (or, 99.9% happens side-effect, I think) under 5.21.. Should I care for winamp 5.21 (and less) users? Last edited by whoami; 30th June 2006 at 03:28. |
|
|
|
|
|
#4 |
|
Join Date: Sep 2003
Posts: 27,873
|
using ExitProcess(..) is really not a good idea to be doing since you're blasting the winamp process space out of memory so something has got to be messed up if it's not closing correctly for you. i'll try to have a look at this later today (unless i'm beaten to it) to see if i can help out. also with regards to handling for 5.21 and below, a version check on startup for 0x5021 and below to then return the opposite of the normal return code so Winamp then won't load it. you could add in a messagebox or something to indicate that this was the case.
-daz |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
Looks like whoami is doing great work here!
One thing missing is a way for other plugins to find out if gen_mbapi is alreay loaded. Or can this already be done with that "extern winampGeneralPurposePlugin *gen_plugins[256];" thing in gen.h? I never understood this or how to use it. Can anybody explain to me? Otherwise maybe an extra message for mbapi-are-you-there would a good idea. Any news on that ExitProcess() trouble?   |
|
|
|
|
|
#6 |
|
Join Date: Sep 2003
Posts: 27,873
|
need to replace
withcode: that fixes issues with the unsubclassing of the subclass chain. as for the bit about identifying itself, i guess you could either use an api registration message like with how the gen_hotkeys does or just check for the message return values or something (i've not had a chance to check things over fully still so i'm not sure on the best way to advise things)code: -daz |
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
No. not this way...
Quote:
The problem is, at quit(), the hwndParent (Winamp windows handle) is already invalid.. therefore SetWindowLong() always fails, giving always NULL. I think I should restore lpWinampProc earlier than that, which means gen_tray source of wa_sdk is buggy.. Does anybody have any better idea? Come to think of it, I guess ExitProcess() doesn't do much harm to Winamp because it is already in the middle of closing when quit()... but of course, doing job with assuming could be critical. For identifying gen_mbapi, returning some id code (lets say, 1) on an ipc call (lets say, IPC_MBBLOCK) with an invalid value (maybe -1 or something) may be okay.. how's this idea? (ps) - oh what ps lover I am!.. I will (not now) try hooking instead of subclassing, if that subclassing is the cause.. |
|
|
|
|
|
|
#8 |
|
Join Date: Sep 2003
Posts: 27,873
|
well that code is the same as i use in all of my plugins, in the updated gen_tray 2.0 source code and i think the devs use it as well (i know benski thought it good ages ago) and using it i didn't have any crash issue on exit whereas with what's in your 0.2 code i could get a crash on close if the ExitProcess(..) wasn't there.
hmm, just tried and the window handle is invalid at that stage and i don't think that should be the case. all i know is that the devs are happy with the code i pasted otherwise they'd have pulled it out of the gen_tray 2.0 source after it had been vetted. ExitProcess(..) is not a solution and it shouldn't be used since you have no idea where in the subclass/plugin load order that you are and if you call that function you're blowing Winamp out of the system memory so anyother plugins and winamp itself can't save any other settings. with the settings thing why not leave the apis alone so that they mirror the original code (as would be expected) and do something like did you get the installer version of the sdk since that should have the fixed gen_tray source code in itcode: -daz |
|
|
|
|
|
#9 | |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Quote:
Anyway, in my system (win xp sp2 Korean version) winamp stops silently with its process still live in the memory... not crashing. That's why I did not notice the flaw on 0.1. I have to go out shortly, so I cannot test any code.. I will try anything when I have time to do so. Oh, Thanks for your help always. |
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
I am sure the subclassing alone cannot be the problem.
Btw ExitProcess() does harm here - some plugins do not save their config anymore. |
|
|
|
|
|
#11 |
|
Ben Allison
Former Winamp Developer Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
|
@dllmain:
in_wm crashes on close in 5.23/5.24. Might be worth disabling it while you're debugging. One easy way to identify your presence is to use IPC_REGISTER_WINAMP_IPCMESSAGE, and handle the corresponding WM_WA_IPC in your window procedure. Winamp returns 1 from WM_WA_IPC if it doesn't understand the LPARAM. If you return 0, then other plugins can call IPC_REGISTER_WINAMP_IPCMESSAGE and then call that IPC and see if it returns 0. e.g. code: extern winampGeneralPurposePlugin *gen_plugins[256]; is used inside of Winamp. It doesn't really belong there (and the next SDK release won't have it) |
|
|
|
|
|
#12 |
|
Join Date: Sep 2003
Posts: 27,873
|
dunno why i posted what i did with benski repeating what i'd said, heh
![]() -daz |
|
|
|
|
|
#13 | |
|
Ben Allison
Former Winamp Developer Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
|
Quote:
|
|
|
|
|
|
|
#14 |
|
Join Date: Sep 2003
Posts: 27,873
|
i've been trying to tell myself that for years
![]() -daz |
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Minibrowser API Support 0.3 for Winamp 5.22+
Finally fixed "winamp does not quit correctly" problem!
Well, actually it was my bad. on the article I referred already contained the fix. code: This code is NEEDED to get IHTMLDocument2 safely, but I ignored it because I already had IHTMLDocument2 on ObjectFromLresult was called. I thought this code is just a part of example code. And, well. I added ipc message for "Hey, gen_mbapi, are you there?" . I chose "gen_mbapi" for check string, for it is that simple string.. see readme.txt for details.For un-subclassing issue.. I followed DrO's solution, but I still get IsWindow(plugin.hwndParent) == FALSE. The plugin is working fine, though. If we (you all and I) cannot find any other issue, I will re-submit this plugin to winamp plug-in section. Would you mind looking for issue(s) for me?
|
|
|
|
|
|
#16 | |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Quote:
|
|
|
|
|
|
|
#17 |
|
Senior Member
Join Date: Nov 2004
Location: Valencia, CA
Posts: 304
|
I just upgraded to 5.24, and the HTML Viewer plugin stopped working. I used this to get it back. Nice work!
|
|
|
|
|
|
#18 | |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
JW:
Why, thanks for using this plugin! And.. about your private message.. I think the message is not so "private".. and I usually do not check private messages. To not forget your request, I just post it here: Quote:
Long answer (well, I could not resist to say this! ), it is possible but I can't remember minibrowser did that under winamp 5.21-...In any case, I will review my plugin and try to add the feature.. as soon as I have time to do so. |
|
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Mar 2001
Location: smspower.org
Posts: 107
|
Hmm, I seem to have a problem. It is installed and the config works, but nothing ever happens as expected - Now Playing works the same as before.
|
|
|
|
|
|
#20 | |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Quote:
Does it work? If yes, that means my plugin has control over the minibrowser. There might be some problem on my plugin, such as fail of subclassing, but in that case, you should receive some warnings.. Try above test and if it works, please notify me your plugin - which is using minibrowser API - name, Winamp version, and your OS. There might be some bugs in my plugin (I always cannot guarantee my program is bug-free), and I will try to fix them IF I can reproduce the symptom. |
|
|
|
|
|
|
#21 | |
|
Senior Member
Join Date: Mar 2001
Location: smspower.org
Posts: 107
|
Sometimes I get:
Quote:
The plugin I am using is one I wrote myself. The code for opening the Minibrowser/Now Playing is: code: This is exactly the code that worked fine with old versions of Winamp. TempHTMLFilename is a fully qualified file path, eg. "c:\temp\file.htm". Debugging through your code, it seems you're not handling the case where szUrl==NULL, which is supposed to activate the Now playing window. Filtering out the NULL doesn't help; manually entering any file:/// address in the config window also seems not to work, so maybe you can debug it that way. I also noticed you aren't implementing some of the internal callback stuff defined in wa_ipc.h, eg. IPC_MBURL. I don't know if any of it is used, or even if you should be catching those callback messages instead of the higher-level ones, or sending them yourself. Some, like IPC_MBGETDESC, aren't used any more anyway. |
|
|
|
|
|
|
#22 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Oh, that.
First of all, my plugin does not work WITH "Now Playing". Actually, there is no information to cooperate with "Now Playing", and I wonder if the author of the plugin adds such a feature. The way my plugin works is, finding ALREADY OPENED "Now Playing"'s browser and control remotely without the help of the plugin. Therefore, my plugin is designed not to work if it cannot find "Now Playing"'s browser, so it is normal (for now, at least) that SendMessage(..., NULL, IPC_MBOPEN) does not work. My plugin does not filter any http: or file:. It just send an URL (even it is not a valid one) to the browser via put_url method of IHTMLDocument2. If file: protocol does not work, it is because M$ made it not to work. Not supporting IPC_MBURL is my bad, because I did not know there were such IPC calls .. I just searched for "minibrowser" and found IPC_MBOPEN(REAL), IPC_MBBLOCK, and IPC_GETMBURL only. You could call me an lazy plugin developer . Thank you for this info.Okay, Minibrowser API support plugin is actually NOT supporting all of APIs well. I admit it, so what? it is not even version 1.0 , and it is not because there is no support for .lks file and an URL button..One good news is, I will review this plugin this weekend, and try to add such features.. but I can not ensure. Stay tuned (hey, since when it becomes a radio station?) and wait for some news. If you cannot wait, do it yourself and let us know. This plugin is in public domain, you see. |
|
|
|
|
|
#23 |
|
Senior Member
Join Date: Mar 2001
Location: smspower.org
Posts: 107
|
I thought there was an easy way to open the Media Library to a particular view, to allow NULL handling to work, but I can't find it right now.
I can see you're just passing the URL to the HTML control, I just thought maybe you'd say "Ah, file:/// URLs require the MSHTML_ALLOW_FILE_URL flag to be set" or something like that (unfortunately, that flag does not exist), and gave you an easy way to test it. |
|
|
|
|
|
#24 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Minibrowser API Support 0.4 for Winamp 5.22+
I feel when I use the program, and Spy++ rocks!
Since the SDK is for 5.04, and many things changed/undocumented on 5.22+.. so I have to spy all things from Winamp program itself.. Woe is me.Here we go, a new version. a lot has been added.. thanks to Maxim I learned that there were LOTS of minibrowser features I hadn't noticed, and tried to put them into this version... So, here is the changelog: Fixed : This plugin is now add "http://" to URL if no protocol is specified. Fixed : SendMessage(..., NULL, IPC_MBURL) IPC call now opens "Now Playing" window. Added : "Visit last URL when Winamp starts" feature Added : This plugin proceeds following IPC calls : IPC_MBURL (works the same as IPC_MBOPEN) IPC_MBGETCURURL (works the same as IPC_GETMBURL) IPC_MBCMD (without MBCMD_MISC) IPC_MBREFRESH IPC_GETWND (with IPC_GETWND_MB, returns the hwnd of Internet Explorer_Server) IPC_ISWNDVISIBLE (with IPC_GETWND_MB) and, todos (will it ever do?) are: - No .lks support - No URL button on the minibrowser - Supporting protocols other than "http:" - Following IPC calls are not proceeded : IPC_MBGETDESC (no .lks support) IPC_MBCHECKLOCFILE (no idea what this does) IPC_MBGETDEFURL (no .lks support) IPC_MBCMD with MBCMD_MISC (no idea what this does) I think JW's suggestion and Maxim's complaints are solved mostly, so try this new version and inform me if anything needs to be improved. |
|
|
|
|
|
#25 | |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
Version 0.4 behaved a little strange here:
(1) I press "Configure selected plugin" in Winamp's preferences (2) Plugin asks "The minibrowser has not been opened yet. Do you want to open?" (3) I choose "Yes" (4) MiniBrowser opens (5) Plugin says "Please wait until the minibrowser opens and try opening this config window again." I could fix this problem for me by modifing window chain find data. I looked at my local window chain using Winspector and here the "Winamp Library" does not have the first two parents that were searched for in 0.4. Does this have to do with modern skins? I have a classic one here... Quote:
Here is the download of my 0.4.1 code. Base 0.5 on my changes if you like. >> gen_mbapi_041.zip   |
|
|
|
|
|
|
#26 | |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
I just ran the source code analyser AntiC over gen_mbapi.cpp
which revealed a potential operator precedence problem. It can be fixed easily: Quote:
|
|
|
|
|
|
|
#27 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Ah, yes, yes. As dllmain said, there IS a difference between a classic and a modern skin.. and when mbapi comes to 0.4, I put a little "optimization" code on FindWindowChain() and it just backfired.
code: Without this code, it just follows the chain regardless FindWindow(Ex) returns NULL or not. Now it stops if it cannot find a chain. However, on a classic skin, a chain starts from "Winamp Gen"-"Winamp Library", not "Media Library". On the code of 0.3, it continues to find the chain so it can find "Winamp Library" eventually, but 0.4, it can not. About the line 137 of gen_mbapi.cpp, I say "Oops." Hey, I am just a normal human and I can do such a mistake, don't I? .. Well, sometimes that kind of mistake makes a satellite to fall down anyway.I will review dllmain's 0.4.1 code and try to fix these issues today night.. I tend to use "if" rather than "switch-case" when the cases are not much (under 3-4), because "switch-case" has more overhead than "if". Of course if the cases increase, the code should be done refactoring. Thanks for your help, dllmain. Last edited by whoami; 9th July 2006 at 09:08. |
|
|
|
|
|
#28 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Thanks to dllmain, here goes another new version;
(It is a fast version-ups, don't you think? )On 0.5 (based on 0.4.1), we got: - A dumb missing () mistake fixed. (okay, call me a lazy AND careless developer.. )- Modern skin - Classic skin compatibility issue fixed. - Did some refactoring.. I have virtually no experience on NSIS script, but I need some option if one want to install the source code.. If anyone knows how to do this, please let me know (best if one fixes .nsi file within this rar-compressed file )Check this version and inform me if any issue(s) found. |
|
|
|
|
|
#29 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
For some reason I still get "The minibrowser has not been opened yet"
the frist time right after the plugin opened the browser itself. Btw the few "defects" I found do not change the fact that you are doing a great job here! [EDIT] (I just re-read the previous post...) Last edited by dllmain; 9th July 2006 at 14:42. |
|
|
|
|
|
#30 | |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
Quote:
The HTMLControl did not create their children which is why the plugin could not find them. |
|
|
|
|
|
|
#31 | |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
Quote:
now can optionally install the source files. I renamed the readme to gen_mbapi_readme.txt but all other files should be the very same as before: >> gen_mbapi_051_pre.zip   |
|
|
|
|
|
|
#32 |
|
Senior Member
Join Date: Nov 2004
Location: Valencia, CA
Posts: 304
|
Perfect! Thanks!!
|
|
|
|
|
|
#33 |
|
Banned
Join Date: Jun 2006
Location: 439 East District, Mount Paozu
Posts: 57
|
I have winamp 5.22 Lite & I downloaded this plugin in this name (gen mbapi 0 3) in most recent plugin by whoami whoami & Published: Jul. 9, 2006
When I want to configure this plugin in general purpose list category I recieve this message: Minibrowser has not been initialized yet. Please wait a minute and try again. Should I have full or bundle winamp for seeing this plugin? I mean just winamp full or bundle have minibrowser? or this message has another reason or meaning? |
|
|
|
|
|
#34 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
I have no idea but why don't you try again with
a more recent version like gen_mbapi_0.5.rar? |
|
|
|
|
|
#35 |
|
Join Date: Sep 2003
Posts: 27,873
|
i thought the media library was required for this to work and the lite version definitely doesn't have that so you're going to need to re-install with a fuller install.
-daz |
|
|
|
|
|
#36 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
New version, installer with source code included.
Minor improvements mainly. >> gen_mbapi_052_pre_setup.exe   |
|
|
|
|
|
#37 |
|
Banned
Join Date: Jun 2006
Location: 439 East District, Mount Paozu
Posts: 57
|
I test gen_mbapi_0.5.rar but I have same problem & I get this message: The minibrowser has not been opened yet.
Do you want to open? I click yes then I receive this message: Please wait until the minibrowser opens & try opening this config window again. I click ok button but does not happened any thing. Remember I have winamp 5.22 Lite Is it nessasary to have winamp full or bundle? I mean winamp Lite has minibrowser or not? or just winamp full or bundle have minibrowser? I don't know minibrowser what's meaning? |
|
|
|
|
|
#38 | |||
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
Quote:
of a plugin called "Nullsoft Winamp Library" (gen_ml.dll). If you have that file/plugin from an old installation you have a minibrowser - if not you need a full install. Quote:
But if you have the library installed clicking "configure selected plugin" one more time will show the config dialog. Quote:
Internet Explorer embedded into the library plugin window. It can be found under "now playing". Sorry, if I explained something you already knew. Just thought a few words more would be the better choice. |
|||
|
|
|
|
|
#39 |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Minibrowser API Support 0.5.3 for Winamp 5.22+ AND some modification guideline
Yet another version. Sorry about this.
You may call me a LAZY and CARELESS and DUMB developer.. (Gee, I am losing my appetite.. )I forgot to remove some test code from OnIpcMbCmd(). This version, those code are removed. I did not do NSIS for this rar-file because the Winamp forum forbids a file over 102400 bytes, and .exe extension. I will update published plugin with NSIS-based .exe file anyway. And, I think this is the time to announce some modification guideline. Whoa, no, I am not changing its license, public domain. First of all, please do not set version like 053, because the version can be over 0.10 something and then the version number will be confusing. I suggest we should use 0_5_3 instead. Then, if you do some modifications, PLEASE REPORT THEM ON CHANGELOG.TXT! With this little rule, it will be easier for peer developers to review your modification. Lastly, let's settle the source code directory to be "gen_mbapi_source". It seems ridiculous one has series of 'historical' mbapi source directories. I changed the .nsi already to install the source files into "gen_mbapi_source". Okay? If you have any comment for guideline above, please let me know. @dllmain: One thing about the NSIS script: does it need an uninstaller? There is already an uninstall button on Winamp, and one can delete the source code manually if he/she can understand the source code. |
|
|
|
|
|
#40 | |
|
Junior Member
Join Date: Jun 2006
Location: Planet Earth, the Solar system.
Posts: 31
|
Quote:
(ps) hey,another ps! I love it! The published gen_mbapi 0.3 is now unavailable because of updating to 0.5.3. To finish updating, the Winamp staffs' review is needed and 0.5.3 is waiting for the review. Well, I hope (hope?) the version stays until gen_mbapi republished.. but it is one of skyrocketing-version-up plugins.. oh dear.
Last edited by whoami; 10th July 2006 at 15:51. |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|