Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 30th May 2004, 09:12   #1
ARossius
Junior Member
 
Join Date: May 2004
Location: Germany
Posts: 6
How to program VB plugin that reads the title and artist from Winamp?

Hello all,

i want to program a Visual Basic plug in for Winamp that displays the currently playing title and artist on an LC Display (the available plug ins don't work for me as my LCD has a different protocol). LCD interfacing is no problem, but how can I make a plug in for Winamp (that is started and exited together with Winamp) and how can I read the title/artist/state (stopped, paused, playing, ...) from within the plugin? It would also be nice to have an interrupt (event) whenever anything changes in Winamp, as the LCD only needs to be changed when anything in winamp changes.

If anyone has a template (without the LCD part, only displaying the information to screen or anything), please post it! I think it will have to compile to a DLL file if I understood the tutorial correctly.

Thanks in Advance!

Last edited by ARossius; 30th May 2004 at 10:03.
ARossius is offline   Reply With Quote
Old 30th May 2004, 21:02   #2
omni96
Junior Member
 
Join Date: May 2004
Posts: 6
i have almost the same problem and i posted it here...i was thinking about an LCD display too...how did u managed to send output to the LCD?
omni96 is offline   Reply With Quote
Old 31st May 2004, 19:41   #3
ARossius
Junior Member
 
Join Date: May 2004
Location: Germany
Posts: 6
If you don't know how to get the data to the LCD, you probably have an LCD that is already supported by an existing plug in. If not: I used a DLL file called inpout32.dll to directly control the I/O lines of the PC's parallel port. The interfacing (commands, timing) is described in the datasheet of the LED's controller, if you don't have that, you won't be able to write any useable LCD plug in at all (use Google to find the datasheet of your controller).
But the LCD I want the plug in for is a LCD connected via serial Port and uses a protocol I 'invented' myself, so there is no plug in available that supports my protocol! That's why, I will have to write one myself, but I don't know how to program C or C++, unfortunately.
I don't know how fast the usual reply times are here, but is there noone who has a plug in written in Visual Basic that's capable of reading the title and artist from Winamp?

Thanks again, if anyone can help me.
ARossius is offline   Reply With Quote
Old 31st May 2004, 21:46   #4
CaboWaboAddict
Forum Sot
(Major Dude)
 
CaboWaboAddict's Avatar
 
Join Date: Mar 2004
Location: Marietta, Ga. U.S.A.
Posts: 3,915
See this...

http://forums.winamp.com/showthread....hreadid=179978

Idiot's Advocate
My site (under construction)
CaboWaboAddict is offline   Reply With Quote
Old 31st May 2004, 22:00   #5
omni96
Junior Member
 
Join Date: May 2004
Posts: 6
this thread's title is "How to program VB plugin that reads the title and artist from Winamp?"
so that gen w. thing don't solve the problem persented here...:\
omni96 is offline   Reply With Quote
Old 1st June 2004, 02:31   #6
CaboWaboAddict
Forum Sot
(Major Dude)
 
CaboWaboAddict's Avatar
 
Join Date: Mar 2004
Location: Marietta, Ga. U.S.A.
Posts: 3,915
Sorry, I thought someone asked how to do a Gen Plugin in VB...
Quote:
Originally posted by ARossius
If anyone has a template (without the LCD part, only displaying the information to screen or anything), please post it! I think it will have to compile to a DLL file if I understood the tutorial correctly.
This does the basics on how to do the DLL part, just add the code you need.

Idiot's Advocate
My site (under construction)
CaboWaboAddict is offline   Reply With Quote
Old 1st June 2004, 10:26   #7
ARossius
Junior Member
 
Join Date: May 2004
Location: Germany
Posts: 6
Thanks, thatb template helps a lot! I managed to create a working plug in by now that outputs some hard coded text to the LCD when Winamp is started.
Now the second problem: the plugin needs, of course, to know the title and artist of the currently playing song (if Winamp is stopped, it may be empty strings or something, that doesn't matter). I've had a look at http://forums.winamp.com/showthread....hreadid=180383
but the ZIP file there doesn't seem to include an approbiate function (I'm using VB6, if that's of interest).
I hope this is possible at all, if yes, please tell me how!

Thanks!
ARossius is offline   Reply With Quote
Old 1st June 2004, 12:16   #8
CaboWaboAddict
Forum Sot
(Major Dude)
 
CaboWaboAddict's Avatar
 
Join Date: Mar 2004
Location: Marietta, Ga. U.S.A.
Posts: 3,915
Glad to help.

Quote:
Originally posted by ARossius
... the plugin needs, of course, to know the title and artist of the currently playing song (if Winamp is stopped, it may be empty strings or something, that doesn't matter). I've had a look at http://forums.winamp.com/showthread....hreadid=180383
but the ZIP file there doesn't seem to include an approbiate function ...
All of the code that is used in external programs, can be used in a plugin. Search for VB and/or Basic in this forum.

Also, look at:http://forums.winamp.com/showthread....hreadid=180297

All of the commands in this listing can be used with the plugin code.

Idiot's Advocate
My site (under construction)
CaboWaboAddict is offline   Reply With Quote
Old 1st June 2004, 19:31   #9
ARossius
Junior Member
 
Join Date: May 2004
Location: Germany
Posts: 6
I couldn't find a way to get the title and artist via window messages in the link you gave me, but the idea with using Winamp's window title was nice. I have used that for now and it works nicely, thus I consider my plug in as finished now. If anyone is interested in parts of the code, contact me here:
http://home.pages.at/arnerossius/kontakt.htm
the circuit for the serial LCD is described here (german!), the plug in will be available there soon:
http://home.pages.at/arnerossius/sch...ro/ser2lcd.htm

Thanks again for all your help and thanks to the programmers of Winamp, of course!
ARossius is offline   Reply With Quote
Old 1st June 2004, 19:42   #10
CaboWaboAddict
Forum Sot
(Major Dude)
 
CaboWaboAddict's Avatar
 
Join Date: Mar 2004
Location: Marietta, Ga. U.S.A.
Posts: 3,915
Did you get the LCD output working?

If so what one are you using - homebrew or purchased?

Idiot's Advocate
My site (under construction)
CaboWaboAddict is offline   Reply With Quote
Old 1st June 2004, 22:20   #11
omni96
Junior Member
 
Join Date: May 2004
Posts: 6
:\ i still want the code for finding the title with window msgs
omni96 is offline   Reply With Quote
Old 2nd June 2004, 10:18   #12
ARossius
Junior Member
 
Join Date: May 2004
Location: Germany
Posts: 6
The LCD output wasn't a problem to me as I had written other programs interfacing to LCDs before. I used a normal HD44780 LCD (with two controllers as it was 4x27 in size, which exceeds the 80 characters one controller can interface) and designed, built and programmed an RS232-to-HD44780 interface converter. You can see the LCD and the circuit on the photos located at the bottom of the second link I posted.

Quote:
i still want the code for finding the title with window msgs
That would be the better way, of course, but as I wasn't able to find that code, the other way will have to work for now. If you find the other code, please post it in this thread! Thanks!
ARossius is offline   Reply With Quote
Old 12th January 2007, 09:41   #13
polomaniac
Junior Member
 
Join Date: Nov 2006
Posts: 10
Quote:
Originally posted by omni96
:\ i still want the code for finding the title with window msgs
i've writtin this for a ms office macro so i can control winamp while type my reports. it prevents inoing switching between screens of ms office and winamp.
you're needed peace is WinAmp_SongInfo

code:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long

Private Const WM_GETTEXT = &HD
Private Const WM_SETTEXT = &HC

'#######3
'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpszClassName As String, ByVal lpszWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private hWndWinamp As Long
Private Const MAX_PATH As Long = 260
Private Const WM_USER As Long = &H400
Private Const WM_COMMAND = &H111
Private Const wPREVIOUSTRACK As Long = 40044
Private Const wPLAY As Long = 40045
Private Const wPAUSE As Long = 40046
Private Const wSTOP As Long = 40047
Private Const wNEXTTRACK As Long = 40048

Dim Temp As String
Dim WinAmpSong As String * 256

Private Function GetWinampWindow() As Long
GetWinampWindow = FindWindow("Winamp v1.x", vbNullString)
End Function

Sub WinAmp_NextTrack()
'
' AcceptAllChanges Macro
' Macro gemaakt op 28-12-2006 door IKKE
'
winamphwnd = GetWinampWindow
SendMessage winamphwnd, WM_COMMAND, wNEXTTRACK, 0&

End Sub


Sub WinAmp_PrevTrack()
'
' AcceptAllChanges Macro
' Macro gemaakt op 28-12-2006 door IKKE
'
winamphwnd = GetWinampWindow
SendMessage winamphwnd, WM_COMMAND, wPREVIOUSTRACK, 0&

End Sub



Sub WinAmp_Play()
'
' AcceptAllChanges Macro
' Macro gemaakt op 28-12-2006 door IKKE
'
winamphwnd = GetWinampWindow
SendMessage winamphwnd, WM_COMMAND, wPLAY, 0&

End Sub
Sub WinAmp_Pause()
'
' AcceptAllChanges Macro
' Macro gemaakt op 28-12-2006 door IKKE
'
winamphwnd = GetWinampWindow
SendMessage winamphwnd, WM_COMMAND, wPAUSE, 0&

End Sub

Sub WinAmp_Stop()
'
' AcceptAllChanges Macro
' Macro gemaakt op 28-12-2006 door IKKE
'
winamphwnd = GetWinampWindow
SendMessage winamphwnd, WM_COMMAND, wSTOP, 0&

End Sub


Sub WinAmp_GetSongInfo()

Dim lWord As Long
Dim lWinamp As Long
Dim sCaption As String * 256

Temp = ActiveDocument.Name

lWord = FindWindow("OpusApp", vbNullString)

lWinamp = GetWinampWindow

SendMessageSTRING lWinamp, WM_GETTEXT, 256, WinAmpSong

If InStr(1, WinAmpSong, "Winamp", vbTextCompare) > 4 Then
WinAmpSong = " | | " & Left(WinAmpSong, InStr(1, WinAmpSong, "Winamp", vbTextCompare) - 3)
Else
WinAmpSong = " | | " & Left(WinAmpSong, 11)
End If

sCaption = Temp & " - Microsoft Word" & WinAmpSong

SendMessageSTRING lWord, WM_SETTEXT, 256, sCaption


End Sub

polomaniac is offline   Reply With Quote
Reply
Go Back   Winamp 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