Sign in to follow this  
Followers 0
1Munkey

Winamp script help

5 posts in this topic

Hey guys, I'm relatively new to AutoIt. I've been writing several small scripts for use in my carpc for use at mp3car.com . I'm now trying to write a script that will pull details from a winamp window which contains details about streaming audio. My problem is that I have is that I have to send the main winamp window !3 in order to open the info window to pull the details. I have to close this window and reopen it each time in case I have switched to the next stream in my playlist.

WinActivate("classname=Winamp v1.x")

controlsend("classname=Winamp v1.x","","","!3")

WinSetState("MP3 Stream Info Box","",@SW_MINIMIZE)

The problem is every time I send the !3 to the main window the info box flashes for a brief second before it minimizes.....very annoying. Is there a way to send !3 to winamp and have the subsequent popup autmatically minimized in order to avoid this "blink"?

Thanks a bunch

Share this post


Link to post
Share on other sites



Hi!

Show the rest of the code, with that code that you post, i have no problems that you say, the winamp window is activated, and the info window is shows, and nothing is not flashing - and also, why do you need WinSetState("MP3 Stream Info Box","",@SW_MINIMIZE) after showing the info window? it do nothing :whistle: .


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Hi!

Show the rest of the code, with that code that you post, i have no problems that you say, the winamp window is activated, and the info window is shows, and nothing is not flashing - and also, why do you need WinSetState("MP3 Stream Info Box","",@SW_MINIMIZE) after showing the info window? it do nothing :whistle: .

Global $title, $net, $server, $content, $received, $interval, $stream

AutoItSetOption("WinDetectHiddenText", 1)
opt("wintitlematchmode", 4)
$rr = ObjCreate("RoadRunner.SDK")
$hotkey = 1
HotKeySet("!c","Close")

while WinExists("classname=Winamp v1.x") and $hotkey = 1
$exists = WinExists("MP3 Stream Info Box","")
If $exists = 0 Then
    WinActivate("classname=Winamp v1.x")
    controlsend("classname=Winamp v1.x","","","!3")
    WinSetState("MP3 Stream Info Box","",@SW_MINIMIZE)
    EndIf
$text = WinGetText("MP3 Stream Info Box","")
$1 = stringinstr($text,"Network received")
$2 = stringinstr($text,"Server:")
$3 = StringInStr($text,"Content-Type:")
$4 = stringinstr($text,"Metadata received")
$5 = stringinstr($text,"Metadata interval")
$6 = stringinstr($text,"Stream name:")
$7 = stringinstr($text,"Current title:")
$8 = stringlen($text)
$net1 = StringLeft($text,$2-1)
$net = Stringright($net1,$2-$1-17)
$server1 = stringleft($text,$3-1)
$server = stringright($server1,$3-$2-7)
$content1 = stringleft($text,$4-1)
$content = stringright($content1,$4-$3-13)
$received1 = stringleft($text,$5-1)
$received = stringright($received1,$5-$4-18)
$interval1 = stringleft($text,$6-1)
$interval = stringright($interval1,$6-$5-18)
$stream1 = stringleft($text,$7-1)
$stream = stringright($stream1,$7-$6-12)
$title1 = stringright($text,$8-$7-14)
$title = stringleft($title1,$8-$7-35)
$rr.Execute("SETLABEL;customradio;" & $title & "||" & "SETLABEL;customradio2;" & $net & "||" & "SETLABEL;customradio3;" & $server & "||" & "SETLABEL;customradio4;" & $content & "||" & "SETLABEL;customradio5;" & $received & "||" & "SETLABEL;customradio6;" & $interval & "||" & "SETLABEL;customradio7;" & $stream)
winclose("MP3 Stream Info Box","")
sleep(100)
WEnd
Func Close()
    $hotkey = 0
EndFunc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There's a com object that can be downloaded and installed for easy automation, you can find it, and it's documentation on this link: http://www.pretentiousname.com/gen_scripting/index.html

I hope it helps :whistle:

Edit:

There's also some other automation library on this forum, search it :)

Edited by FreeFry

Share this post


Link to post
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
Sign in to follow this  
Followers 0