|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 |
Join Date: Sep 2003
Posts: 27,873
|
Useful Info -> What info should you know when making plugins?
Finding those little extra bits of info for making your plugin can be hard especially when you don't know what you're searching for. Remember searching for hours to try and find out about something and fail
![]() Well my thought is to add to the forum a "useful info" sticky which should point to relevant info, etc. As well i'm looking at providing example code for most of the api messages (taken also from examples other members have posted just to make it easier when you first start using the api) with an updated sdk installer coming in the next few weeks. So what other info do you think should be made part of this sticky? Post here and i'll sort through it in the next few weeks as i finish doing the bits i'm working on. -daz |
![]() |
![]() |
![]() |
#2 |
Member
Join Date: Apr 2003
Location: Never Never Land
Posts: 69
|
Empty plugins like the generic empty project for all types of plugins.
.. starting with the ml_type first ![]() |
![]() |
![]() |
![]() |
#3 |
Join Date: Sep 2003
Posts: 27,873
|
what about ml_ex in the sdk? though it needs some more documenting i think
![]() -daz |
![]() |
![]() |
![]() |
#4 |
Member
Join Date: Apr 2003
Location: Never Never Land
Posts: 69
|
Yeah it does need more documenting and it is not exactly "Empty", but it is what I am using at the moment.
|
![]() |
![]() |
![]() |
#5 |
Join Date: Sep 2003
Posts: 27,873
|
lol, no pleasing some people
![]() point noted and i'll get a ml_basic added as soon as i can though for some of the plugins, you need the 'extra' parts in to see what's going on ie input, output and vis though ml and gen can be stripped to a basic level -daz |
![]() |
![]() |
![]() |
#6 |
Member
Join Date: Apr 2003
Location: Never Never Land
Posts: 69
|
Hey, I am just being a helpful newbie .... giving you an insight in to the mind of a person who has no idea what he is doing but is still building a plugin
![]() It is good to have both ml_basic as a foundation to build your own and ml_ex with all the 'extras' so you can see what you can do with it. Buttom up building vs top down. |
![]() |
![]() |
![]() |
#7 |
Join Date: Sep 2003
Posts: 27,873
|
that's good since the aim is to help newbies get on without having to search for hours on end. the aim also is to have ml_basic, ml_ex and the original version of ml_www in there as well.
-daz |
![]() |
![]() |
![]() |
#8 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Although not for a plugin as such, I think some info on how to do all the IPC calls from an external app would be nice, as I think quite a few people start off by writing an external app (even though its harder!). An explanation on these issues would be good too.
I also took part in a thread on how to catch song changes, which isn't really documented in the SDK. The newer 'PLAYINGFILE' or whatever IPC is only new, and doesn't catch http title changes. (the 666 message does though). Some docs on how to subclass the various windows could be good. These issues are mainly for general plugins, theres probably heaps more for input/output/vis plugins. @petepan: I think the ml_ex is probably pretty good as a basic skeleton type code. Its not too difficult to cull the stuff you dont need, but at the same time it provides a good framework for the stuff that many ml plugins would need. You were obviously able to get it going in a couple days, which is not bad considering how much effort goes into getting some other undocumented stuff going. |
![]() |
![]() |
![]() |
#9 |
Join Date: Sep 2003
Posts: 27,873
|
shaneh: i agree with you there, the number of times i've seen that over the few years i've been active/browsing it would make sense to have something on that (issue noted).
i'd better get browsing then ![]() -daz |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Dec 2003
Posts: 15
|
I posted some very simple code that provides a general interface for interacting with winamp from an external process that allows most (if not all) of the plugin api calls. I even included a sample vc++ project demonstrating how to use it, should help lots of folks out (even though noone responded to it in the thread
![]() here it is |
![]() |
![]() |
![]() |
#11 |
Senior Member
Join Date: Jul 2003
Posts: 248
|
And once again, I think it would be appreciable if the WM_COMMAND parameters for winamp were in their own header file
![]() |
![]() |
![]() |
![]() |
#12 |
Join Date: Sep 2003
Posts: 27,873
|
do you mean something like this?
-daz [edit] will need to comment out the defines in wa_ipc.h at the bottom for it to compile fine + fixed an issue with the header not compiling (v1.0a attached) anyone noticed the typo mistakes in wa_ipc.h? ![]() [/edit] |
![]() |
![]() |
![]() |
#13 |
Join Date: Sep 2003
Posts: 27,873
|
and another file sorted, i've gone through ipc_pe.h adding in some info with working example code as needed.
-daz |
![]() |
![]() |
![]() |
#14 |
Senior Member
Join Date: Jul 2003
Posts: 248
|
you're doing a great work DrO, thanks a lot
![]() |
![]() |
![]() |
![]() |
#15 | |
Join Date: Sep 2003
Posts: 27,873
|
Quote:
-daz |
|
![]() |
![]() |
![]() |
#16 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Some useful info I found in the audioscrobblers sources. I knew about the 666 message, but this explains it a little better. It is relative to the PE window. Credit to Spib from the audioscrobbler plugin for this.
#define WA_STATE_CHANGE 0x0000029A PEWndproc: if(message == WM_USER) { if(wParam == WA_STATE_CHANGE) { int nType = HIWORD(lParam); int nTrack = LOWORD(lParam); // Ignore the double issue play message if(nType != 16384) return TRUE; if(SendMessage(m_hWndWinamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1) { DWORD dwNow = GetTickCount(); // Winamp Sends two quick song change notifications so // here we check if the last notification arrived less than // 400 milliseconds after the last in which case we ignore it. if((dwNow - m_dwLastPlay) < 400) { // Ignore second notifcation } else { m_dwLastPlay = dwNow; //Track changed } } } This is more useful than the 'PLAYING_FILE' IPC, as it also catches track changes within http streams. Be careful though, as it is called multiple times with http streams for the same title, so you need to check that it has actually changed. I think the 'GetLibraryWndIPC' or whatever it is plus the other library ipc calls should be added in ml.h or somewhere. I have written up a brief summary under 'Unodocmented APIs' [sic]. |
![]() |
![]() |
![]() |
#17 |
Senior Member
Join Date: Jun 2000
Posts: 289
|
Something useful now might be a how to compile using the Microsoft Visual C++ Toolkit 2003 that they recently released for free. Command line how to I mean, dunno. thought it sounded like an ok suggestion.
|
![]() |
![]() |
![]() |
#18 |
Join Date: Sep 2003
Posts: 27,873
|
SarCaSM: i'll see if i can have a play with it once i find and download it
shaneh: ta, will document that as well as my version in a bit. as for the ml header, i'll add them into the version i'm making though i'll see if we can get the devs to better document the ml.h file (saves me some work as well) -daz |
![]() |
![]() |
![]() |
#19 |
Join Date: Sep 2003
Posts: 27,873
|
wa_hotkeys.h... another one done and ready to go
![]() this should show how easy it is to add a global hotkey, enjoy -daz |
![]() |
![]() |
![]() |
#20 | |
Senior Member
|
Quote:
Album List for Winamp - Download: v1.43, v2.06, v2.07 beta Wallpaper for Playlist Editor - Download: v1.06 |
|
![]() |
![]() |
![]() |
#21 | |
Join Date: Sep 2003
Posts: 27,873
|
Quote:
![]() -daz |
|
![]() |
![]() |
![]() |
#22 |
Junior Member
Join Date: May 2004
Posts: 3
|
How about an example of using winamp's dlg, for a none ml_ex plugin.... just a suggestion....although im sure most people could figure it out faily quickly.
|
![]() |
![]() |
![]() |
#23 | |
Join Date: Sep 2003
Posts: 27,873
|
Quote:
![]() ![]() -daz |
|
![]() |
![]() |
![]() |
#24 |
Junior Member
Join Date: May 2004
Posts: 3
|
actually i am talking about wa_dlg.h....but if that is what gen_mandy uses then that would be a yes....not neccessarly skining the dlg....but just using winamps built in functions for a dlg. if it skins it for you already...then that would be a plus....im more or less just trying to get more information on using winamps built in functions for a dlg....it would actually save alot of time on coding a plugin for winamp as thats less code u have to write for your dlg's and what not... Thanks for the reply.
-kaldo |
![]() |
![]() |
![]() |
#25 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Winamp only allows to create the outer window skinned. Buttons and scroll bars etc have to be manually skinned by picking apart bitmaps and bitblting them around the place.
|
![]() |
![]() |
![]() |
#26 |
Junior Member
Join Date: May 2004
Posts: 3
|
im not actually refering to skining the dlg at all..im just trying to get more information on using winamps built in functions for a dlg for a plugin...like an example of showing how to use it, or more information on how to do it...
-kaldo |
![]() |
![]() |
![]() |
#27 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
There are no built in functions for a dialog, you just create your own with CreateDialog, common controls and wndprocs etc. Any tutorial which shows you how to create a dialog using bare bones API calls will work, and is how it is done.
|
![]() |
![]() |
![]() |
#28 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Re: Skinning and Dialogs
How does the Media Library skin the scrollbars and the headers in the list-view. Does it subclass the scroll bar?? Re: Song change notifications I just run some code in the WM_TIMER case in Winamp's subclass window procedure and compare the previous filename of playing song with the current. If it's not the same, then we have a song change. I previously did this in the WM_SETTEXT case since Winamp is changing it's Window title when the song playing changes. Nullsoft should have implemented a more robust and efficient notifications API, like: code: Which is NOT implemented now! |
![]() |
![]() |
![]() |
#29 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
I suspect it does owner draw type stuff for the scrollbars etc.
The 666 message seems to be what winamp sends on a song change. Something sends it to the playlist whenever the title changes (ie includes everything, including 'buffering...' type stuff, internet stream title changes etc). As it is the nullsoft trademark '666' number Id suspect this is quite intentional, and has been there for a while. Its probably used internally to tell the different components about the new title. The newer 'playing_file' message doesnt catch stream title changes. I dont like using a timer, as you are restricted by the resolution of the timer, have to do a strcmp every split second, which is redundant, and various other problems. You are better off just catching 666 in the playlist wndproc, as it is sent whenever there is a title change, and seems fairly compatible with all versions. |
![]() |
![]() |
![]() |
#30 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
I know that WM_TIMER is a bit redudant, but catching WM_SETTEXT is what I actually used in my NxS Balloon Tip plug-in. And to catch the '666' trick (number of the animal/devil) you would need to subclass the playlist window which I don't like to do as I'm not touching the playlist editor in NxS Balloon Tip. I know that checking the filename isn't a good solution as people may have the same song appearing multiple times in a row in the playlist, so I may very well investigate into the '666' trick. As I previously said: There should be a more staright-forward way of doing this.
Subclassing is not a robust way of doing things since there is a risk of interfering with other plug-ins then. A proper notification registration system must be implemented in Winamp's core. |
![]() |
![]() |
![]() |
#31 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
I'm now using the '666' trick in NxS Balloon Tip. Thanks to all!
|
![]() |
![]() |
![]() |
#32 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Just watch out for duplicate messages when listening to streams. The 666 message is sent whenever there is a title update, and I guess title updates are sent every few seconds on a stream. For some reason there is also an additional 666 message sent when winamp first starts up.
|
![]() |
![]() |
![]() |
#33 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
I was recently going through wa_ipc.h where I discovered that you could subclass Winamp's main window (plugin.hwndParent) and do this (taken from NxS Balloon Tip's source):
code: |
![]() |
![]() |
![]() |
#34 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Hmm... makes sense :P What is '..MISC_STATUS' for?
Why arent you using the ..MISC_TITLE? wouldnt that be the title change? Funny I never noticed those with spy++. I think there were too many _WA_IPC messages so I filtered them maybe. edit; i guess status is for switching from play to stop etc. |
![]() |
![]() |
![]() |
#35 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
I'm using IPC_CB_MISC_TITLE in my plug-in. It was just not included in the post.
IPC_CB_MISC_STATUS is triggered when playback status changes. case IPC_CB_MISC_INFO is triggered when info like kbps and channels change. likewise with case IPC_CB_MISC_VIDEOINFO. IPC_CB_MISC_TITLE is also triggered multiple times if playing a HTTP stream (ShoutCAST, e.t.c). How do you check if a song is a HTTP stream reliably. Just scanning for "http://" in the filename isn't a good idea, or what?? |
![]() |
![]() |
![]() |
#36 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
I couldve sworn I tried those CB.. but couldnt get them to work. Every plugin Ive seen uses the 0x29a/666 method. Perhaps they are only available in later versions of winamp or something.
Every bit of code Ive seen also seems to scan for http: to detect http streams. Its lame I know, but Ive done a bit of reverse engineering and I seem to recall even winamp doing that internally. It does it in the modern skin notifer wasabi code. Itd be good if the input plugin returned something for getextendedinfo("server") or something, but Im pretty sure it doesnt. |
![]() |
![]() |
![]() |
#37 | |
Junior Member
Join Date: Sep 2004
Location: is it just me or it's hot in here?
Posts: 15
|
Quote:
Is there a way to obtain the name of the artist and the song already separated? I've seen in a post something about IPC_GET_EXTENDED_FILE_INFO, but I couldn't make it work. |
|
![]() |
![]() |
![]() |
#38 |
Junior Member
Join Date: Sep 2007
Location: gwalior,india
Posts: 7
|
API functions of winamp
i am not able to find API functions , and without API functions , how can i build program for creating plugins for winamp
|
![]() |
![]() |
![]() |
#39 |
Join Date: Sep 2003
Posts: 27,873
|
it's all in in.h, out.h, gen.h, vis.h ml.h and wa_ipc.h (and other header files in the sdk depending on the plugin you're making) and assumes you know about win32 and c/c++ so you can correctly build the plugin (using the relevant examples in the sdk as a framework).
-daz |
![]() |
![]() |
![]() |
#40 |
Member
Join Date: Mar 2006
Posts: 52
|
My main questions at this time center around getting the language that Winamp is configured for so I can choose appropriate resources in the plug-in to match. It seems lame to request that the user configure the language for Winamp and then configure the language for each plug-in separately. But I don't see anything in the API that supplies language Winamp is configured to use.
Also, for those who have internationalized your plug-ins, what method did you use to do so (separate build for each language, one build with all supported languages included within, main build in English with smaller language "packs" that can be added on, something else)? Other than that for right now, the biggest problem I had developing my plug-in initially was understanding the sequence of events that the player would subject the plug-in to. It was clear from the SDK headers what callbacks existed, but I needed to figure out on my own what the sequence of the callbacks would be and there tended to be a lot of variation depending on the input plug-in being used (for the output plug-in at least). Also, certain callbacks are issued from the player's main thread and others seem to come from another thread (or maybe a couple others). Some callbacks can be issued in parallel to others and some have a serial relationship with certain other callbacks. A few details on multi-threading issues would probably help new plug-in developers avoid a lot of problems. Remote Speakers Output Plug-In Stream audio from Nullsoft Winamp to the Apple AirPort Express (aka AirTunes) |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|