|
|
#1 |
|
Junior Member
Join Date: Mar 2002
Posts: 5
|
Need Help @ getting the current file name, please
Hello,
i have a small prob with winamp. i try to get the filename of the current track. I read the faq on the winamp hp, but there was only a c++ source and i'm trying to make an vb app ![]() Dim index index = SendMessage(WinAMP_FindWindow, WM_USER, 0, 121) Label2.Caption = SendMessage(WinAMP_FindWindow, WM_USER, index, ???) I tryed to get first the current playlist item and then the filename, but i don't know the correct number ![]() can someone help me please ? cu |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
if your not a plugin, you cant get it anyway, at least I dont think, I tried several times but gave up, but going about it is a lil more difficult than the code you have, here's how I know of to get it..
first off, the number you need is 211 secondly, if you manage to get that far, what that returns wont be a string, but rather a pointer to a string in memory, here's where you need to get smooth. Declare a fixed length string of 256 characters in length, fill it with 0's, meaning zeros, next, using the CopyMemory Api in windows to copy the string from the pointer given you, to the string you created.. Declare Sub CopyMemory Lib "kernel32" Alias "RtlCopyMemory" _ (ByVal Dest As Long, ByVal Source As Long, strLength As Long) in reverse order again, strLength is 256, Source is the LONG POINTER!, nothing else, no string, no nothing, make sure you Declare Source as long, this is what gets returned by the 211 function, it must be long or it will crash, and remember, it's only a pointer. Dest is also a pointer, but the pointer to your own string..for reasons I still dont understand, I cant simply pass a string to it, it doesnt work , so what you do, is this, Dest = StrPtr(YourDestVar)That will return a pointer to the contents of YourDestVar, which the copymemory api should fill up with the filename called by the 211 function! hehe, now if you follow those near gibberish instructions, your in luck, if not, I'm used to it, ask, and I'll dig up some code Scrag that, I'll make it easy, but remember, this will only work if you compile to a referencable dll that winamp can load.. Dim index As Long Dim Dest As Long Dim Source As Long Dim DestString As String * 256 index = SendMessage(WinAMP_FindWindow, WM_USER, 0, 125) Source = SendMessage(WinAMP_FindWindow, WM_USER, index, 211) Dest = StrPtr(DestString) CopyMemory Dest, Source, 256 Label2.Caption = DestString ''' And I think that's it, if it doesnt work, has a beef, slags your computer, or eats your pets, dont gripe at me, that code should work
|
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Mar 2002
Posts: 5
|
Hello,
This code: Declare Sub CopyMemory Lib "kernel32" Alias "RtlCopyMemory" _ (ByVal Dest As Long, ByVal Source As Long, strLength As Long) don`t works on my system, my kernel32 don'`t have a RtlCopyMemory Sektion. i have win xp, but i don't know what win98 or other windows say In the MSDN Library is a text : Quote:
This would be enough
Last edited by TOT1; 14th March 2002 at 12:02. |
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
your right, you dont have a copymemory section, you have a move memory section with a twist, sorry about that
, here's the proper Declare...Public Declare Sub CopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (ByVal DestinationPointer As Long, ByVal SourcePointer As Long, ByVal Length As Long) I think that's all I screwed up, but I dont know for sure P.S. no, I've never seen a way to get the ticker, I think it's just created from the data you can get with the api Last edited by Gourou; 14th March 2002 at 20:19. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2002
Posts: 5
|
hello,
sorry but the source doesn't work can you please write me the hole code ? I have tryed to test the code, but then my prog shuts down with a memory failiture (this problemn is on other machines, too). I would be very happy if u can help me ![]() cu |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Mar 2002
Posts: 5
|
Hello
i have tetsed the source, but i came to no result if i use a plugin or an stand alone exe, is the same. But i'm already serching for a solution ![]() cu |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
here dude, this was my solution http://www.csc.uvic.ca/~karvanit/winamp/
I have no clue if it will actually help you or not, my programs were web based anyway, so tossing it a request on local host is close enough to instantaneous that it didnt matter, I just dont know if you'll have the same luck..as a note tho, making 6500 queries for my playlist takes about 10 minutes, so I hope you can find a better solution, I've been looking for one also, so I'll tell you if I find anything |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2000
Posts: 5
|
Currrent Filename
Grab a copy of the WinampCOM plugin then use the .CurrentFilename property. Simple as that!
|
|
|
|
|
|
#10 |
|
Member
|
Adding to this topic...
Is there any open source plugin/VB6 code that will allow me to get the file path of the song currently being played in WinAmp? I don't want the file name, but the path to the file. Anyone know if this can be done using VB code? If it can be done, please post some quick sample code. Thanks! Ethan |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
To ChrisRGZ: WinampCom grabs the current filename, all nice and dandy, but what I needed was the filename of every song in the playlist, in order..not an easy thing to ask for, I think he might need the same thing, my reason was I needed the filename so I could toss it to my cgi plugin and have it make a url from the filename so ppl can download the song, current would have worked, but I wanted based also on the previously played list, and the full list, not all 200k plus songs I own, just the ones in the list..
To wa21guy: Grab the filename, which should be the full name, path and all, and grab everything to the left of the last "\", InStrRev() is the easiest function for this, as it will return the index position of the last "\" in the filename, then you can use a Left() to grab everything at index -1, so on and so forth, you get the drift |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Mar 2002
Posts: 5
|
ChrisRGZ
Thanks for your tip, this is what i want ![]() cu PS. Thanks to everybody who tryed to helh me too
|
|
|
|
|
|
#13 |
|
Member
|
So the above examples that get the filename actually get the full path and filename? For example, they return:
c:\myfolder\myfolder\testsong.mp3 ?? If so, then this is exactly what I need. Is there anyway to do this extrernally without actually being a "plug-in" of winamp (using VB)? Thanks a bunch guys. |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
I did some rooting around and unknown to me before, WinampCom DOES have the ability to give you back the filename for any name in the playlist, just download that, follow the example, and you should have all you need, with a much easier way to nab em.
|
|
|
|
|
|
#15 |
|
Member
|
Yep, just got WinampCOM last night and it works perfect! Much easier.
Now, for another question. Does anyone know how to read/write ID3v2 tags (specifically the album cover picture in the tag) in a plug-in written in VB6? Thanks! |
|
|
|
|
|
#16 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
lol, you dont ask much dude
I honestly have never found a way to do ID3 tags with vb, I know you can, but here's a warning, vb gets messy with pointers if you arent careful, and as you saw before, pointers dont work very well in visual basic. Winamp doesnt have much support, but see if you can find the 'official' home page for ID3, and check around in their forums for some programming help, your sure to find it |
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Mar 2002
Posts: 2
|
I just had myself an Eureka! experience trying out the WinampCOM plugin. But does anyone know where to find a listing of the different properties (like oWinamp.Play, oWinamp.Stop etc.)?
|
|
|
|
|
|
#18 |
|
Member
|
There is a great MP3 ID3 Tag manipulater DLL by www.audiopimp.com called ID3Edit.dll. I'm using it in my plug-in and so far it works awsome!
As far as the oWinamp stuff, all you need to do is Reference the DLL in Visual Basic and by typing "oWinamp." a whole list should come up after the dot. If no, just right click and go to "List Properties/Methods" Ethan |
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
an obscure yet nice feature, is the object browser, just press F2, then select your object from the list where it says <All libraries>, then maximize the window and look through the lists of classes and members (methods and properties) that the object supports
![]() Also, if the object isnt listed, then you need to reference the dll, then put it as a new object, that's in the readme help for the dll, dont forget to do that |
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Mar 2002
Posts: 2
|
Thank you, Ethan and Gourou! That helped a lot.. I'm pretty new to VB, and actually forgot about this autolist feature. And that F2 function was just wonderful, Gourou. Thanks.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|