Old 30th April 2010, 19:26   #1
Xencito
Junior Member
 
Join Date: Apr 2010
Posts: 2
Input Plugin Api Information / Discussion

Follow to Winamp Input Plugin Api Details link


--------------------------------------------------------------------

Hi
I just love Winamp I was writting an input plugin and everything worked out great until I decided that winamp should be responsible for formatting titles in the playlist. I went on and did some researching and found that I could implement the undocumented winampGetExtendedFileInfoW(...). I quickly ran into some problems using this function:

How should I respond to "type" tag?
How should I respond to "length" tag (how should numeric data be formatted, a hex string etc.)?
And so on...

I guess my real question is whether there is an API somewhere, which I haven't been able to find (I did manage to find an outdated version by Michael Facquet in some zip file in this forum I think, which by the way did not help me all that much).

And why-oh-why is this function not a part of the Winamp SDK, this should not take long to document and make a simple test example. But until then, would anyone please be kind enough to at least give me a hint on how numeric data shoud be "encoded" into the buffer?

Thank you
and "Hello World" from Denmark!
Xencito is offline   Reply With Quote
Old 30th April 2010, 20:25   #2
DrO
 
Join Date: Sep 2003
Posts: 27,880
as i don't have the time to properly document the exported functions i'd suggest either looking at the source code of the 64th Note plug-in or the Wavpack plug-in for how things are done. the 64th Note only has the initial ansi implementation but may be easier to follow for some of the questions you've asked whereas the Wavpack plug-in includes a few other things as well which allow for decoding of audio for the ripper component and a few other things though it's a bit more over the place (is planned to have that plug-in worked on at some point to improve it along with some localisation updates, etc).

and hopefully someone (most likely me) will get around to sorting out a properly documented example at some point (when i've finished the other projects i'm currently working on).

-daz
DrO is offline   Reply With Quote
Old 30th April 2010, 22:34   #3
Xencito
Junior Member
 
Join Date: Apr 2010
Posts: 2
Thank you very much for your (very quick) reply, I'll will have a look at your suggestions.

I appreciate the fact that other projects also requires time and working hours, but this is a pretty critical function, for all input plugin developers, so it is beyond me why this has not been documented a lot sooner. It has been around since version 5 I guess, which was released a long time ago (2003 or something similar?)...

I'm just curious as to why it hasn't been documented, is it considered experimental (still)?

I'm willing to lend a hand writing some documentation for the particular winampGet/winampSet/and so forth functions, because I believe good documentation/API allows even more developers to become involved in a product, making it even better and interesting for the community => good times for the millions of users.

And again thank you.

Regards
Xencito...
Xencito is offline   Reply With Quote
Old 3rd May 2010, 19:22   #4
DrO
 
Join Date: Sep 2003
Posts: 27,880
Quote:
Originally Posted by Xencito View Post
I'm just curious as to why it hasn't been documented, is it considered experimental (still)?
you'd have to ask the old development team why it was never properly documented and why it had to be reverse engineered of sorts.

Quote:
Originally Posted by Xencito View Post
but this is a pretty critical function, for all input plugin developers
my experience with most Winamp input plug-in authors is that they're not too bothered as it means targeting 5.x when they just want to do the minimum which leaves things at a 2.x level (and so excludes the additional api support) and means they're not then doing weird hacks to support more things than XMPlay & other apps able of loading input plug-ins allow.

i agree fully that it's something which should have been documented properly (hence the mass of additions made to some of the sdk files since i've had a chance to work on them) but it's like everything with Winamp, there's just not enough time/resources to do things.

initial documentation of things should be done by the end of the week (i suppose an advantage of me being out of work at the moment).

-daz
DrO is offline   Reply With Quote
Old 7th May 2010, 14:39   #5
DrO
 
Join Date: Sep 2003
Posts: 27,880
Winamp Input Plugin Api Details


I've uploaded an initial documentation for input plug-ins at http://nunzioweb.com/daz//input_plugin_api (this is essentially a 1.0 documentation release so will be subject to change like not all being text files but i'm pushed for time at the moment).

Any issues / things missing / needing more clarification then please do say and i'll answer / update things as required.

-daz
DrO is offline   Reply With Quote
Old 17th June 2011, 11:29   #6
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
What are CreateAudioDecoder and DeleteAudioDecoder for? I found them in in_mp3.dll.

I also found burn_doBurn, GetDS, and GetWave in in_wm.dll.
thinktink is offline   Reply With Quote
Old 17th June 2011, 11:32   #7
DrO
 
Join Date: Sep 2003
Posts: 27,880
they're just internally used exports for use between some aspects of the different plug-ins. not something that falls under the general input plug-in exports.

-daz
DrO is offline   Reply With Quote
Old 17th June 2011, 17:00   #8
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Ah, ok. Does it have anything to do with passing streaming metadata to Winamp? I'm trying to hook all the plugins and when I do it doesn't display any of the metadata for the playing stream in the playlist. I was wondering if maybe those had anything to do with it.
thinktink is offline   Reply With Quote
Old 19th June 2011, 15:55   #9
DrO
 
Join Date: Sep 2003
Posts: 27,880
not that i'm aware of though stream metadata is a bit of a quirky area and ipc_updtitle (or something like) sent by the plug-in itself is the usual trigger for streaming title updates so maybe that isn't getting actioned correctly due to how you're hooking the plug-ins? only thing i can think off as i don't remember seeing such an issue with how i've hooked the input plug-ins in the past.

-daz
DrO is offline   Reply With Quote
Old 19th June 2011, 19:12   #10
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
I know in_mp3 is getting the data and is attempting to tell Winamp to refresh the title with the above mentioned IPC message because I've watched the messages to the main Winamp window with an external message hooker/viewer. It just seems like either Winamp isn't responding correctly or in_mp3 isn't giving the actual stream data. I still can't figure it out. I've solved it with a hack though by updating IPC_HOOK_TITLES with the input plugin's GetFileInfo() function manually. Unfortunately that means subclassing Winamp's main window which I usually try to avoid doing with any plugin.

The way I'm "hooking" the input plugins is by enumerating all DLLs in the plugins folder, loading them, getting the plugin's header, overriding the header's IsOurFile function with my own that always returns FALSE, and then returning TRUE for my IsOurFile if any of the other plugin's original function returns TRUE. I also either emulate or pass-through to the original plugin the winamp[Set|Get|Write|Add|Unified]Extended functions. When Winamp calls for a file my plugin doesn't/can't handle directly (like streaming audio or video files) I just pass through all the calls to Play/Pause/Unpause/SetVolume/SetPan/etc.. to the appropriate plugin with my plugin just acting as a middle-man. For the life of me I can't think of why the streaming metadata wasn't being displayed since I didn't override anything else but IsOurFile. All the other header functions remain unmodified. Even without overriding IsOurFile and just returning true (and passing through all the function calls) for other files the metadata wasn't displayed.

How did you hook the input plugins?

[EDIT /]
Forgot to mention, while testing I discovered that in_mp3 likes to crash (I think) on calls to winampSetExtendedFileInfo(W) if the filename is empty (allocated \0 terminated string with no characters.) No error message or anything is displayed to the user, Winamp just quits unexpectedly.
thinktink is offline   Reply With Quote
Old 19th June 2011, 19:23   #11
DrO
 
Join Date: Sep 2003
Posts: 27,880
pretty much the same way though often i'd replace isourfile with my own version but then make that call the original function if i didn't need to be overriden so original behaviour is observed as that function is primarily there for stream handling.

though i can't remember at what stage and if i'm doing LoadLibrary(..) or GetModuleHandle(..) to get the loaded dll instance as the second i think is more what i try to use as LoadLibrary(..) can cause a different instance to be used instead which isn't initialised quite the same i think.

would be easier if i could access my source code for in_zip then i'd be able to confirm what i'm doing (just can't do that right now) as that's probably the nearest equivalent to what you're trying to do.

-daz
DrO is offline   Reply With Quote
Old 19th June 2011, 22:56   #12
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Zomg I'm a f'ing blind boning bone-head. It said it right there in the SDK and I didn't even see it or even to think to check for it while debugging:

#define GETFILEINFO_TITLE_LENGTH 2048
void (*GetFileInfo)(const in_char *file, in_char *title, int *length_in_ms); // if file == NULL, current playing is used

I never checked for NULL file parameter. GAH!!!!! I've finally got it working right without the /class hack.
thinktink is offline   Reply With Quote
Old 19th June 2011, 23:29   #13
DrO
 
Join Date: Sep 2003
Posts: 27,880
heh, i think that one's caught me out a few times way way back. at least you're sorted now so that's the main thing

-daz
DrO is offline   Reply With Quote
Old 1st August 2011, 23:21   #14
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Would it be possible to document "hi.mp3"? I think I know what it's for but I would like to be sure.
thinktink is offline   Reply With Quote
Old 8th December 2011, 15:44   #15
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Quote:
Originally Posted by thinktink View Post
...document "hi.mp3"?...
/bump
thinktink is offline   Reply With Quote
Old 29th September 2012, 23:34   #16
sheh
Junior Member
 
Join Date: May 2004
Posts: 10
Are there any docs explaining the more exotic functions, like Vis, DSP, etc.?

The input plugin interface is really a surprise. I expected a simple interface for decoding and metadata, and found out the whole playback plugin chain is controlled by the input plugin. Now I know why various things behave strangely depending on input plugin used.
sheh is offline   Reply With Quote
Old 26th November 2013, 18:10   #17
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Quote:
Originally Posted by sheh View Post
Are there any docs explaining the more exotic functions, like Vis, DSP, etc.?

The input plugin interface is really a surprise. I expected a simple interface for decoding and metadata, and found out the whole playback plugin chain is controlled by the input plugin. Now I know why various things behave strangely depending on input plugin used.
No separate docs for the other plugin types you mentioned as far as I know. Just look at the comments in the SDK headers and the example plugins included in the SDK.
thinktink is offline   Reply With Quote
Old 3rd August 2015, 21:42   #18
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
winampSetExtendedFileInfo(W)

[Quandry]

In the documentation "Reading_and_Writing_Extended_Metadata_Information.h" it defines both of the writing function winampSetExtendedFileInfo(W) as both having wchar_t * values but the value parameters for winampGetExtendedFileInfo(W) as char * and wchar_t * respectively.

The following taken from "Reading_and_Writing_Extended_Metadata_Information.h":
code:
extern "C" __declspec(dllexport) int winampGetExtendedFileInfo(const char *fn, const char *data, char *dest, size_t destlen)
extern "C" __declspec(dllexport) int winampGetExtendedFileInfoW(const wchar_t *fn, const char *data, wchar_t *dest, size_t destlen)
extern "C" __declspec(dllexport) int winampSetExtendedFileInfo(const char *fn, const char *data, const wchar_t *val)
extern "C" __declspec(dllexport) int winampSetExtendedFileInfoW(const wchar_t *fn, const char *data, const wchar_t *val)



Is it supposed to be like that or is the documentation wrong on the value parameter for winampSetExtendedFileInfo?
thinktink is offline   Reply With Quote
Old 19th September 2015, 19:44   #19
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,047
hi.mp3 (or hi.ext) is used to find the input plugin associated with the 'default extension' in the preferences.

the unicode variants of the dllexported metadata functions do in fact take the field name as a char * (ascii string)
Benski is offline   Reply With Quote
Old 19th September 2015, 21:03   #20
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Quote:
Originally Posted by Benski View Post
hi.mp3 (or hi.ext) is used to find the input plugin associated with the 'default extension' in the preferences.

...
Oh! Dadgumn was I wrong. Thanks.


Quote:
Originally Posted by Benski View Post
...

the unicode variants of the dllexported metadata functions do in fact take the field name as a char * (ascii string)
Excellent (well, not the documentation part.)
thinktink is offline   Reply With Quote
Old 19th September 2015, 21:48   #21
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Quote:
Originally Posted by Benski View Post
...
the unicode variants of the dllexported metadata functions do in fact take the field name as a char * (ascii string)
Oops, wait a minute, you said "field name." Are you referring to the "data" parameter or the "val" parameter? I was talking about the "val" parameter, "field name" implies the "data" parameter.

Last edited by thinktink; 19th September 2015 at 23:40.
thinktink is offline   Reply With Quote
Old 19th September 2015, 22:23   #22
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,047
ohh. weird. where does it specify that? it should definitely be const char * for winampSetExtendedFileInfo
Benski is offline   Reply With Quote
Old 19th September 2015, 22:38   #23
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Quote:
Originally Posted by Benski View Post
ohh. weird. where does it specify that? ...
In the documentation "Reading_and_Writing_Extended_Metadata_Information.h", at least the copy I got from the SDK download if memory serves. I'll double check that.
thinktink is offline   Reply With Quote
Old 19th September 2015, 23:07   #24
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Quote:
Originally Posted by thinktink View Post
...the copy I got from the SDK download if memory serves. I'll double check that.
Scratch that, it wasn't from the SDK, I think it was an archive from DrO's website that I downloaded a long time ago linked in a post above. DrO has taken it down so I can't verify my statement because I seem to have misplaced the archive download, how I don't know since I still have the original SDK download right in my Downloads folder.
thinktink is offline   Reply With Quote
Old 20th September 2015, 02:26   #25
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Double whoops, I just had a look at the Wayback Machine. It was "Reading_and_Writing_Extended_Metadata_Information.txt", not "Reading_and_Writing_Extended_Metadata_Information.h", I must've renamed the file so that it would pop up and show formatted in my editor. It was also not in an archive, it was just hosted directly as a txt file on his server.
thinktink is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Tags
winampgetextendedfileinfo

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