shows played song
;MODIFIED =20110909 ;CREATED =20051110 ;Script =AHK_L 1.1.03.00 ( for httpQuery ) ;Player =http://smplayer.sourceforge.net/ ;-where =http://www.autohotkey.com/forum/topic6307.html ;-tagx =internetradio internet radio shoutcast NAME =InternetRadio [ Esc=Mute ON/OFF ] vlcx =%A_programfiles%\SMPlayer\mplayer\mplayer.exe ;- [PLAY] this player can run hidden ifnotexist,%vlcx% { msgbox,See settings for variable vlcx`nUse a player which can start url and start hidden exitapp } ;--- Hotkey Escape for Mute ON/OFF ----------- HK1=Esc Hotkey,%hk1%,mute1,ON SM2:=100 ;wave for MP3directCut SM3:=100 ;volume soundset,0,master,mute ;SPEAKER=MASTER ON SoundSet,%SM3%,master ;SPEAKER=MASTER volume soundset, 0,WAVE,mute ;WAVE ON SoundSet,%SM2%,WAVE ;WAVE volume Gui,2: Color, 000000 Gui,2: Font, S10 CDefault , FixedSys Gui,2:add, GroupBox, x5 y38 w250 h60 Gui,2:Add,Button, x10 y10 w110 h20 gPL1,Philippines Gui,2:Add,Button, x130 y10 w110 h20 gPL2,Hawaii Gui,2:Add,Button, x250 y10 w110 h20 gPL3,Suomi Gui,2:Add,Button, x370 y10 w110 h20 gPL4,Portugal Gui,2:Add,Button, x490 y10 w110 h20 gPL5,China Gui,2:Add,Button, x610 y10 w110 h20 gPL6,Nederland Gui,2:Add,Button, x730 y10 w110 h20 gPL7,Country Gui,2:Add,Button, x850 y10 w110 h20 gPL8,Brasilia Gui,2:Add,Button, x10 y50 w110 h20 gStop1,STOP Gui,2:Add,Button, x10 y72 w110 h20 gMUTE1,MUTE_ON/OFF Gui,2:Add,Slider, x130 y50 w110 h20 vVolume Range0-100 gVolumeX,%SM3% Gui,2:Add,Edit, right x130 y72 w110 h20 vEditText2 gEdit2, Gui,2:Add,Edit, cYellow x270 y47 w510 h20 vName1 readonly, Gui,2:Font, S10, Verdana Gui,2:Add,Edit, cRed x270 y77 w700 h20 vCurrent readonly, Gui,2: Show, x10 y0 h110 w990 ,%NAME% gosub,volumex return ;-------------------------------------------------------------------- stop1: settimer,aas4,off Hotkey,%hk1%,mute1,OFF process,close,%PID1% process,exist,mplayer.exe process,close,mplayer.exe GuiControl,2:,name1, GuiControl,2:,url1 , return PL1: P=http://109.169.26.78:9246 T=Philippines GOSUB GS1 return PL2: P=http://198.104.24.138:8000 T=Hawaii GOSUB GS1 return PL3: P=http://212.50.217.50:8000 T=Suomi GOSUB GS1 return PL4: P=http://38.96.148.24:5212 T=Portugal GOSUB GS1 return PL5: P=http://174.37.194.139:8086 T=China GOSUB GS1 return PL6: P=http://server-06.stream-server.nl:8010 T=Nederland GOSUB GS1 return PL7: P=http://130.166.82.14:8006 T=Country GOSUB GS1 return PL8: P=http://50.30.35.23:8132 T=Brasilia GOSUB GS1 return GS1: settimer,aas4,OFF Hotkey,%hk1%,mute1,ON process,close,%pid1% Process, WaitClose, %pid1%, if ErrorLevel=0 { run,%vlcx% %P%,,hide,pid1 GuiControl,2:,name1,%t% -- %p% if (t="Nederland" or t="Suomi") { GuiControl,2:,Current,No Text return } else { settimer,aas4,10000 gosub,aas4 } } return aas4: httpQuery(aaa,P) xx4=Current Song StringReplace,aaa,aaa,</tr>,$, All Loop,parse,aaa,$, { if A_loopfield contains %xx4% { aa:=RegExReplace( A_loopfield, "<.*?>" ) stringreplace,aa,aa,Current Song,,all break } } GuiControl,2:,Current ,%aa% return ;---------------------------------- ;--------- volume slider ---------------- VolumeX: Gui,2: Submit, NoHide SoundSet,%volume%,master GuiControl,2:, EditText2,%volume% Return Edit2: Gui,2: Submit, Nohide GuiControl,2:,volume,%EditText2% Return ;----------------------------------------- MUTE1: soundset,+1,master,mute return ;------------------------------------------ 2GuiClose: process,close,%PID1% process,exist,mplayer.exe process,close,mplayer.exe ExitApp ;=============================================================== ; - IsNull http://de.autohotkey.com/forum/post-71924.html#71924 ;-- used instead of urldownloadtofile command httpQuery(byref Result, lpszUrl, POSTDATA="", HEADERS="") { WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1") WebRequest.Open("GET", lpszUrl) WebRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") WebRequest.Send(POSTDATA) Result := WebRequest.ResponseText WebRequest := "" } ;====================== END script =======================
EXAMPLE-2 Ahk_Basic
;2005-11-10 garry, InternetRadio_test.ahk (easy) ;============================================================================ ;record1: ;streamripper = http://streamripper.sourceforge.net/ ; (streamripper.exe and tre.dll) ; recorded music in folder stream ; ;record2 when not possible with streamripper: ;record direct the sound you hear (select first the path where to save the music) , cut MP3 ;MP3directCut = http://www.mpesch3.de/ ; record :stereoMix (analog:8) must be selected ; speaker:wave ;============================================================================= #NoTrayIcon NAME=InternetRadio TR=ANGOLA;http://67.15.82.69:8092;USA-Country;http://130.166.72.1:8006;Mauritius;rtsp://realserver.intnet.mu:554/tplus_encoder/taalfm.rm;TV-Suomi;http://ra.yle.fi/ramgen/yle24/video/uusin_rk.rm run,%COMSPEC% /C if not exist \STREAM\NUL MD STREAM,,hide run,%COMSPEC% /C if not exist \PLAYLIST\NUL MD PLAYLIST,,hide SM1:=12 ;record Stereo Mix for MP3directCut SM2:=50 ;wave for MP3directCut SM3:=100 ;volume soundset,0,master,mute ;SPEAKER=MASTER ON SoundSet,%SM3%,master ;SPEAKER=MASTER volume soundset, 0,WAVE,mute ;WAVE ON SoundSet,%SM2%,WAVE ;WAVE volume soundset, 0,ANALOG:8,mute ;activate doesn`t work SoundSet,%SM1%,ANALOG:8 ;Stereo Mix recording work Gui, Color, 000000 Gui, Font, S10 CDefault , FixedSys Gui, Show, x300 y0 w500 h175,%NAME% Gui,add,button,x10 y35 w110 h20,Record1 Gui,add,button,x130 y35 w110 h20,Record2 Gui,add,button,x250 y35 w110 h20,Record3 Gui,add,button,x370 y35 w110 h20,Record4 Gui,Add,Button,x10 y70 w110 h20,Shout-Cast Gui,Add,Button,x130 y70 w110 h20,Winamp Gui,Add,Button,x250 y70 w110 h20,Radio-Search Gui,Add,Button,x370 y70 w110 h20,TV-Search Gui,Add,Button,x10 y150 w110 h20,RECORD Gui,Add,Button,x130 y150 w110 h20,DirectCut Gui,Add,Button,x250 y150 w110 h20,STREAM ;here recorded mp3 with streamripper Gui,Add,Button,x370 y150 w110 h20,PLAYLIST ;store here PLS/RAM/WPL/m3u... Gui,add, GroupBox, x5 y88 w480 h60 Gui,Add,Button,x130 y122 w110 h20,MIXER Gui,Add,Button,x250 y122 w110 h20,MUTE_ON/OFF Gui,Add,Text,cred x125 y100 w110 h20,<REC 05-40 Gui,Add,Slider, x10 y100 w110 h20 vSlider Range5-40 gSliderRel,%SM1% Gui,Add,Edit,cred x10 y122 w110 h20 vEditText1 gEdit1, Gui,Add,Text,cwhite x300 y100 w70 h20,VOLUME> Gui,Add,Slider, x370 y100 w110 h20 vVolume Range0-100 gVolumeX,%SM3% Gui,Add,Edit, x370 y122 w110 h20 vEditText2 gEdit2, StringSplit,BX,TR,`; Loop, %BX0% Gui, Add, button,gButton1 x10 y10 w110 h20,%BX1% Gui, Add, button,gButton2 x130 y10 w110 h20,%BX3% Gui, Add, button,gButton3 x250 y10 w110 h20,%BX5% Gui, Add, button,gButton4 x370 y10 w110 h20,%BX7% return ;-------------------------------------------------------------------- SliderRel: Gui, Submit, NoHide SoundSet,%slider%,Analog:8 GuiControl,, EditText1, %Slider% Return Edit1: Gui, Submit, Nohide GuiControl,, Slider, %EditText1% Return ;---------------------------------------- VolumeX: Gui, Submit, NoHide SoundSet,%volume%,master GuiControl,, EditText2,%volume% Return Edit2: Gui, Submit, Nohide GuiControl,,volume,%EditText2% Return ;----------------------------------------- buttonMUTE_ON/OFF: soundset,+1,master,mute return ;------------------------------------------ buttonRecord: ifexist, %A_ScriptDir%\MP3directCut\mp3directcut.exe run,"%A_ScriptDir%\MP3directCut\mp3directcut.exe" "/r" return buttonDirectCut: ifexist, %A_ScriptDir%\MP3directCut\mp3directcut.exe run,%A_ScriptDir%\MP3directCut\mp3directcut.exe return buttonSTREAM: run,%A_ScriptDir%\STREAM return buttonPLAYLIST: run,%A_ScriptDir%\PLAYLIST return ;------------------------------------------ Gui,submit,nohide button1: P=%BX2% GOSUB GS1 return button2: P=%BX4% GOSUB GS1 return button3: P=%BX6% GOSUB GS1 return button4: P=%BX8% GOSUB GS1 return GS1: ;ifexist,%A_ProgramFiles%\REAL10-5GOLD\realplay.exe ;run,"%A_ProgramFiles%\REAL10-5GOLD\realplay.exe" "%P%" ifexist,%A_ProgramFiles%\REALPLAYER\realplay.exe run,"%A_ProgramFiles%\REALPLAYER\realplay.exe" "%P%" return buttonRecord1: P=%BX2% ifexist, %A_ScriptDir%\streamripper.exe run,%COMSPEC% /K streamripper.exe %P% --xs_padding=5000:5000 -t -d STREAM return buttonRecord2: P=%BX4% ifexist, %A_ScriptDir%\streamripper.exe run,%COMSPEC% /K streamripper.exe %P% --xs_padding=5000:5000 -t -d STREAM return buttonRecord3: P=%BX6% ifexist, %A_ScriptDir%\MP3directCut\mp3directcut.exe run,"%A_ScriptDir%\MP3directCut\mp3directcut.exe" "/r" return buttonRecord4: P=%BX8% msgbox,record for %BX8% not possible return buttonMixer: run,sndvol32.exe CN=RunDLL32.EXE shell32.dll,Control_RunDLL mmsys.cpl,,1 run,%CN% return buttonShout-cast: run,http://www.shoutcast.com return buttonRadio-search: run,http://www.radio-locator.com/cgi-bin/home return buttonTV-search: ;run,%A_ProgramFiles%\Internet Explorer\IEXPLORE.EXE http://www.wwitv.com/portal.htm?http://www.wwitv.com/television/index.html ;run,%A_ProgramFiles%\Mozilla Firefox\firefox.exe http://www.wwitv.com/portal.htm?http://www.wwitv.com/television/index.html run,http://www.wwitv.com/portal.htm?http://www.wwitv.com/television/index.html return buttonWinAmp: run,%A_ProgramFiles%\Winamp\winamp.exe return GuiClose: ExitApp
MODIFIED =20111011 AHK_L