Old 25th March 2004, 06:53   #1
torsius
Junior Member
 
Join Date: Dec 2003
Posts: 15
general purpose non-plugin winamp interface

I put together this simple set of functions that allow you to access winamp as though you are a local to winamp's process... it enabled me to access extended winamp song info from an external app in another project.

It was nice since I didn't have to include a winamp-side plugin to interface with to get to the info

Here's the functions packaged in a nice VC6 sample app that shows the magic in action!

http://iceomni.webhop.net/WinampMagic.zip

I'm sure someone out there will find it useful, well, that's my hope anyways
torsius is offline   Reply With Quote
Old 12th April 2004, 22:10   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
torsius: just had a quick look and it works quite well though it's a bit ropey with retrieving video information i found.

but nice clean code in there and will go well with the vb equivalent that i plan to link / document

-daz
DrO is offline   Reply With Quote
Old 14th April 2004, 23:39   #3
torsius
Junior Member
 
Join Date: Dec 2003
Posts: 15
i'm sure it could be improved, if there's anything imparticular that doesn't work that should actually be possibly to do from a remote process.
torsius is offline   Reply With Quote
Old 28th May 2004, 11:12   #4
TheRealWhoever
Junior Member
 
Join Date: May 2004
Location: Denmark
Posts: 1
thanks!

TheRealWhoever is offline   Reply With Quote
Old 1st June 2004, 16:11   #5
mjcumming
Junior Member
 
Join Date: Jun 2004
Posts: 20
I will look at this tonight. Anyone know if this allows you to access the media library from an external app?

Mike
mjcumming is offline   Reply With Quote
Old 10th December 2004, 13:30   #6
jyeee
Junior Member
 
Join Date: Dec 2004
Location: US
Posts: 9
Send a message via ICQ to jyeee Send a message via AIM to jyeee
thanks!!!
jyeee is offline   Reply With Quote
Old 28th December 2004, 10:21   #7
Vernochan
Junior Member
 
Join Date: Dec 2004
Posts: 1
Send a message via ICQ to Vernochan
Hi there.

That's exactly what i was looking for


But it does not work...
It "show's" me alwas just something like this:

Quote:
Currently Playing song: C:\My Music\blah.mp3

Artist:
Title:
Album:
Year:
Bitrate: kbps
Length: 0:00

Although ID3v1 and ID3v2 are included the MP3
So it retrieves the song filename, but not the additional information.


Could it be, that it is because of my Winamp version? (i'm using 2.91 - and don't try me to use other Versions )

I would be very glad if this could be done "for me"... Cause i don't want to write a small Plugin since it is possible to do that on other Way's.


As said before.. i would be glad, if there is any helpp for me


Thanks and bye,
Verno =)


EDIT: ah i forgot. I tryed this on a Win2kSP4 and WinXPSP1 pc.

Last edited by Vernochan; 28th December 2004 at 10:45.
Vernochan is offline   Reply With Quote
Old 11th February 2005, 01:56   #8
amertahir
Junior Member
 
Join Date: Feb 2005
Posts: 9
can someone make a dll out of it which exports GetMetaInfo function..........

i really need it to be used from Visual Basic. I tried to port this to VB but the pointers problem in VB crashes winamp.

would anyone be kind enough to make a dll for this.....pleaseeeeeeee

i can't make it myself bcoz i don't have VC++ and also i have little knowledge of C++ .......
amertahir is offline   Reply With Quote
Old 11th February 2005, 03:32   #9
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
This is what ActiveWinamp is for, as I posted in another thread. It is a COM object which lets you interact with Winamp out of process. There is no direct GetMetaInfo call, it is abstracted to higher level calls, which get the meta info from the media library if its available, or from the extendedinfo call if not.

If you dont want to use COM, you have to create a proxy plugin that does WM_COPYDATA or similar calls, which Im guessing is more or less what this plugin does. It seems to support getmetainfo but I havent looked into it much.

/EDIT: actually its doing readprocessmemory/writeprocessmemory calls. You can do this from VB, here is some info that should get you started:

http://msmvps.com/ch21st/archive/2004/02/26/3279.aspx

However, in general I would steer clear of readprocessmemory etc calls. Im not positive, but I think you may need debug priviliges or osmething similar to do that under XP. ie, it may cause problems if your running as non-admin or under terminal services or something like that.
shaneh is offline   Reply With Quote
Old 11th February 2005, 18:50   #10
amertahir
Junior Member
 
Join Date: Feb 2005
Posts: 9
VC++ help needed...

i'm trying to create a WinampMagic dll named MetaInfo which exports GetMetaInfo function which can be used in VB.

now, i want to if it makes any difference when preferred for VB calling:

char __stdcall *GetMetaInfo(char *whichInfo)

char __stdcall *GetMetaInfo(LPCSTR whichInfo)

what is more appropriate to use in this case???
amertahir is offline   Reply With Quote
Old 11th February 2005, 18:59   #11
amertahir
Junior Member
 
Join Date: Feb 2005
Posts: 9
can someone compile this for me pleaseeeeeeee..............

can anyone compile this dll for me, coz i don't have VC++.

i hope there won't be any errors, but if still there's an error, please please please try to fix them, i don't think there would be any major issues coz the code has been borrowed from WinampMagic which is errorfree...

i'm trying to use this dll from VB, i hope it works when compiled.......

actually i'm in DANGEROUS need for this dll and for that i got to have it compiled.....

YOUR HELP WOULD BE HIGHLY APPRECIATED AND I WOULD BE GRATEFUL TO YOU!
Attached Files
File Type: zip metainfo dll.zip (10.8 KB, 1269 views)
amertahir is offline   Reply With Quote
Old 28th February 2005, 04:51   #12
eh?one
Senior Member
 
eh?one's Avatar
 
Join Date: Feb 2003
Location: canada, eh?
Posts: 296
WinampVB6

version 0.1

Download

thanks for pointing me in the right direction you guys
example included
eh?one is offline   Reply With Quote
Old 14th March 2005, 08:09   #13
amertahir
Junior Member
 
Join Date: Feb 2005
Posts: 9
getting song rating...

i was successful in making a MetaInfo dll, however, i have a new issue to deal with....

i want to get the song's rating, i tried it using IPC_GET_EXTENDED_FILE_INFO and passing "RATING" as the metadata parameter, but i didn't get the rating. Does anyone know of any other way i can get the song's rating???
amertahir is offline   Reply With Quote
Old 14th March 2005, 10:35   #14
tracerh
Banned
 
Join Date: Feb 2005
Posts: 84
Get DrO's modified SDK from one of the sticky threads
tracerh is offline   Reply With Quote
Old 18th May 2005, 15:18   #15
khiemprincess
Junior Member
 
khiemprincess's Avatar
 
Join Date: May 2005
Location: Australia
Posts: 3
Hi torsius,

I've downloaded your project and compile it in VC++.NET 2003. However, when I run the executable file, a sort-of DOS promt (with the black windows) just popup and disappear.

So sozzzy for a very dump question, but I dont know by what way can I use your project, ie. is it a sample project about Winamp plugin, or just for any other purpose ? Very sorry about that, but since i'm completely new in forum as well as know nearly nothing about Winamp plugin although I'm having a university project to build an application about that !!!

Thank you for any of your further explanation and please bear with my lack of acknowledgement !

Best regards
khiemprincess is offline   Reply With Quote
Old 12th June 2005, 02:18   #16
AkaneTendo
Junior Member
 
AkaneTendo's Avatar
 
Join Date: Jun 2005
Location: California, USA
Posts: 16
Send a message via AIM to AkaneTendo
Run it from the command line.

Edit: btw where is this modified SDK I read mentioned once? In addition, is there documentation on how to retrieve data from other api calls? I want waveform data .

Last edited by AkaneTendo; 12th June 2005 at 03:02.
AkaneTendo is offline   Reply With Quote
Old 16th June 2005, 00:14   #17
AkaneTendo
Junior Member
 
AkaneTendo's Avatar
 
Join Date: Jun 2005
Location: California, USA
Posts: 16
Send a message via AIM to AkaneTendo
I mean comamnd prompt! Run -> command.
AkaneTendo is offline   Reply With Quote
Old 2nd October 2005, 18:19   #18
burgales
Junior Member
 
Join Date: Sep 2005
Posts: 3
hi.
I was wondering if is there a way of knowing if a change of song is produced...
burgales is offline   Reply With Quote
Old 15th February 2006, 13:19   #19
Volki
Junior Member
 
Join Date: Feb 2006
Posts: 1
First of all, thanks for the provided code, it helped me a lot.

But may it be possible, that there is a memory leak in your code?
Quote:
char *GetMetaInfo(char *whichInfo, char *returnVal)
{
char *remoteBuf, *whichBuf, *structBuf;
static extendedFileInfoStruct xstruct;

// allocate the memory in winamp's space
remoteBuf = (char *)AllocWinamp(METASIZE);
whichBuf = (char *)AllocWinamp(sizeof(whichInfo));
structBuf = (char *)AllocWinamp(sizeof(xstruct));

// fill in ext struct
xstruct.filename = (char *)SendMessage(hwndWinamp, WM_WA_IPC, GetPlayingTrack(), IPC_GETPLAYLISTFILE);
xstruct.metadata = whichBuf;
xstruct.ret = remoteBuf;
xstruct.retlen = METASIZE;

// write the local buffers to winamp's space
WriteLocalToWinamp(whichInfo, whichBuf, strlen(whichInfo));
WriteLocalToWinamp(&xstruct, structBuf, sizeof(xstruct));

// send the "get ext info call"
if(!SendMessage(hwndWinamp,WM_WA_IPC,(int)structBuf,IPC_GET_EXTENDED_FILE_INFO_HOOKABLE))
{
printf("Extended file information not available.\n");
return "no_ex";
}

// copy the remote buffer to local space
ReadWinampToLocal(remoteBuf, returnVal, METASIZE);

// free up the memory we allocated in winamp's space
FreeWinamp(remoteBuf, METASIZE);
FreeWinamp(whichBuf, sizeof(whichBuf));
FreeWinamp(structBuf, sizeof(xstruct));
return returnVal;
}
If there is no extended file information, you aren't releasing the allocated memory. Am I right?

Greetings
Volki
Volki is offline   Reply With Quote
Old 15th February 2006, 13:28   #20
DrO
 
Join Date: Sep 2003
Posts: 27,873
that's correct. there is an implementation of the AllocWinamp(..) and FreeWinamp(..) hopefully to make it's way into 5.2 as an api which handles the correct freeing of memory if it is failed to be freed by the calling app, details will come after the 5.2 release

-daz
DrO is offline   Reply With Quote
Old 14th October 2006, 22:06   #21
lopardo2003
Junior Member
 
Join Date: Nov 2002
Location: Argentina
Posts: 38
I finally found the source for this.

I converted the code to Delphi. Now I'm trying to make it work with Unicode tags, but I failed miserably. Can somebody help? Thanks.
lopardo2003 is offline   Reply With Quote
Old 25th October 2006, 12:41   #22
moltencheese
Junior Member
 
Join Date: Oct 2006
Posts: 5
Has anyone managed to ever make this WinampMagic into a dll, which can be accessed through COM?
moltencheese is offline   Reply With Quote
Old 25th October 2006, 12:43   #23
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
You could just use ActiveWinamp perhaps? It is a winamp plugin which exposes a lot of the Winamp API through COM.
shaneh is offline   Reply With Quote
Old 25th October 2006, 12:53   #24
moltencheese
Junior Member
 
Join Date: Oct 2006
Posts: 5
Right, but activewinamp needs to be present in the winamp directory itself.

I know that people have created a dll out of winampmagic, I just have limited knowledge of C++, which I'm trying to learn. I was just wondering if I could poke around and look through a winampmagic dll project.
moltencheese is offline   Reply With Quote
Old 25th October 2006, 12:57   #25
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Oh... theres not much point in making it a COM server if its not running in the winamp process space. May as well just link dynamically/statically, it would ge a pretty thin wrapper.
shaneh is offline   Reply With Quote
Old 25th October 2006, 13:00   #26
moltencheese
Junior Member
 
Join Date: Oct 2006
Posts: 5
I have to use jscript or vbscript, yes I know everyone will question why but I have to for a school project.

Anyways, I assumed the only way to connect with these languages would be by using a COM server (kind of like how MediaMonkey pulls it off).
moltencheese is offline   Reply With Quote
Old 25th October 2006, 13:08   #27
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Hmm... you would still have to register the COM server in the registry. Which involves an installation step, in which case you may as well use ActiveWinamp. This would make more sense with regards to interfacing with Winamp - as the COM server is hosted within Winamp so the calls are marshalled in and out to the Winamp processs space in a sensible manner.

Otherwise.. you have winampmagic using readprocess memory hacks. But it wouldnt have to be installed within the winamp plugins directory, but it would still have to be installed and registereted somewhere.
shaneh is offline   Reply With Quote
Old 25th October 2006, 13:12   #28
moltencheese
Junior Member
 
Join Date: Oct 2006
Posts: 5
Ya, I was looking at AmerTahir's, look above, winampremote for konfabulator - it seems to register a com object from such a dll. You are right that I would have to regsiter the com server... I guess I'll just play around more and see if I can figure this out on my own - and come back when i figure out a solution.

If you have any links that would help me w/ figuring out how to construct dll's thatd be awesome. BTW - thanks for the quick responses.
moltencheese is offline   Reply With Quote
Old 8th December 2009, 23:20   #29
Tsuyo
Junior Member
 
Join Date: Dec 2009
Posts: 37
Hey, sorry for Bumping. Does someone have the Vb Sample?
The Link is down

Greetings
Tsuyo is offline   Reply With Quote
Old 11th December 2009, 17:00   #30
moltencheese
Junior Member
 
Join Date: Oct 2006
Posts: 5
Sorry Tsuyo,

I lost all my code since then, new computers since then and such. Do you have any specific question ?
moltencheese is offline   Reply With Quote
Old 19th December 2009, 15:38   #31
Tsuyo
Junior Member
 
Join Date: Dec 2009
Posts: 37
The Problem is to get the VU Meter in Visual Basic. I Cannot Code C++ so i have to it with Vb.Net, Atm i try to create a Plugin that makes somethin like that, but in Vb it would be nicer.
Tsuyo is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

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