|
|
#1 |
|
Junior Member
Join Date: Oct 2003
Posts: 5
|
Reading ID3 tags from file playing in Winamp
I'm using the code unearthed in here to get the path to the currently playing file in Winamp, then using some Delphi code to read the ID3 tag information:
code: This works fine when the MP3 is paused or not open in Winamp, but when Winamp is playing the file I get errors along the lines of "Cannot open file for read access". Someone else I've been talking to has written something similar in C++ and he uses code: to do the same thing and it works like a charm for him. Why does it work for him in C++ and not for me in Delphi?? It's really bugging me
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2001
Location: smspower.org
Posts: 107
|
Delphi has a fair few different ways of opening files, some of which allow you to open a file with read-only shared access and some which don't. Try changing the last parameter in the TFileStream.Create() to whatever the shard option is (something like fmOpenReadShared, F1 is your friend).
However, if your program will always be running at the same time as Winamp (and possibly when it isn't if you link directly to in_mp3.dll, which is a bit dodgy and harder) I would recommend you make use of the new(ish) winampGetExtendedFileInfo() calls/messages, which allow you to query tag fields in all (supported) formats using in_mp3's code, so you get automatic support for a lot more cool stuff like id3v2. Maxim |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2003
Posts: 5
|
I had already tried all those other file modes and none of them worked either. I ended up using lower-level file I/O routines.
Where can I find out about this winampGetExtendedFileInfo() function? I haven't heard of that one before (tried searching the forums and it doesn't seem to be in the API). |
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Mar 2001
Location: smspower.org
Posts: 107
|
In the 2.90 SDK:
Quote:
code: This is assuming you're in-process to be able to pass the pointers. If not... it's harder. You can link directly to in_mp3.dll which contains the function that services this message, although you shouldn't really do that I suppose (and it reduces your support to only those formats in_mp3 supports). Or, you can use some of the tricks for stealing memory from Winamp's buffers to use yourself - the minibrowser URL's a good one to steal, since it's 4KB. See here for some details on doing that. Maxim |
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2005
Posts: 1
|
I it's gonna sound sound kinda idiot, but I can't get my code to work with IPC_GET_EXTENDED_FILE_INFO in C++ (DevC++)
with something like: char buffer[512] = {0}; extendedFileInfoStruct object; UINT plpos = SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_GETLISTPOS); char *faka = (char*)SendMessage(plugin.hwndParent, WM_WA_IPC, plpos, IPC_GETPLAYLISTFILE); object.filename= faka; object.metadata = "Artist"; object.ret = buffer; object.retlen = 512; I get *always* empty fields... ![]() And by the way, what are the possible values for the metadata field of a extendedFileInfoStruct ? |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|