Jump to content

Winamp current song information


Recommended Posts

Hi everyone, just registered here and this is my first post :shocked:

I have done few searchs but have found nothing so I made own thread about this.

How to see current song playing in winamp with AutoIt? Do I need any .dlls to do it?

I need only artist and song :(

Thanks!

Link to comment
Share on other sites

Hi everyone, just registered here and this is my first post :shocked:

I have done few searchs but have found nothing so I made own thread about this.

How to see current song playing in winamp with AutoIt? Do I need any .dlls to do it?

I need only artist and song :(

Thanks!

Try doing a google search on winamp + object. You should get something that can help you :P....

Link to comment
Share on other sites

Uhmm... The easy way:

#include <ARray.au3>

$a = WinampGet()
If @error Then
    MsgBox(0, "", "no songs are played")
Else
    MsgBox(0, "", $a)
EndIf

Func WinampGet()
    Opt("WinTitleMatchMode",2 )
    $sTitle = WinGetTitle(" - Winamp")
    If $sTitle = 0 Then
        SetError(1)
        Return 0 ;no songs are being played.
    Else
        $sTitle = StringReplace($sTitle, " - Winamp", "")
        While 1
            If StringLeft($sTitle,1) <> "." Then
                $sTitle = StringTrimLeft($sTitle,1)
            Else
                $sTitle = StringTrimLeft($sTitle,1)
                ExitLoop
            EndIf
        WEnd
        
        $string = StringSplit($sTitle, " - ", 1)
        
        If StringRight($string[2], 8) = "[Paused]" Then
            $string[2] = StringTrimRight($string[2], 9)
        ElseIf StringRight($string[2], 9) = "[Stopped]" Then
            $string[2] = StringTrimRight($string[2], 10)
        EndIf
        $string[1] = StringStripWS($string[1],7) ;artist
        $string[2] = StringStripWS($string[2],7) ;song
        
        Return $string[2]
    EndIf
EndFunc

This is some of my ancient stuff.. :shocked:

Edited by Manadar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...