The Mix Rock-live

« Older   Newer »
  Share  
xdmisterx
CAT_IMG Posted on 24/7/2009, 19:56     +1   -1




Siccome mi sono innamorato di questa radio, ho creato questo semplicissimo programma per ascoltarlo in streaming senza il bisogno di aprire internet explorer:
CODICE
#include <GuiConstants.au3>

GUICreate("The mix rock-live",635,340)
$obj=ObjCreate("shell.explorer.2")
$guiobj=GUICtrlCreateObj($obj,0,0,635,280)
$aggiorna=GUICtrlCreateButton("Aggiorna",0,290,635,40)
$obj.navigate("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")

GUISetState()
While 1
       $msg=GUIGetMsg()
       Switch $msg
       Case $gui_event_close
               Exit
       Case $aggiorna
               $obj.navigate("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")
       EndSwitch
WEnd

Testato e perfettamente funzionante.
Se la radio salta è normale, non è colpa del programma, ma del server :)
ciao :)

Download attachment
The_Mix_Rock_live.rar ( Number of downloads: 4 )

 
Top
xEdox
CAT_IMG Posted on 24/7/2009, 20:49     +1   -1




abbastanza semplice.. comunque ti consiglio di lasciare un po' di spazi nel source, per farlo leggere meglio, ad esempio così:

CODICE
#include <GUIConstants.au3>

GUICreate ("The mix rock-live" , 635 , 340)
$obj = ObjCreate ("shell.explorer.2")
$guiobj = GUICtrlCreateObj ($obj , 0 , 0 , 635 , 280)
$aggiorna = GUICtrlCreateButton ("Aggiorna" , 0 , 290 , 635 , 40)
$obj.navigate ("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")

GUISetState ()
While 1
       $msg = GUIGetMsg ()
   Switch $msg
               Case $gui_event_close
                       Exit
               Case $aggiorna
                       $obj.navigate ("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")
       EndSwitch
WEnd
 
Top
xdmisterx
CAT_IMG Posted on 25/7/2009, 12:47     +1   -1




Versione aggiornata:
CODICE
#NoTrayIcon
#include <GuiConstants.au3>
#include <IE.au3>

;creazione oggetti
$obj=ObjCreate("shell.explorer.2")

;GUICreate
GUICreate("The mix rock-live",635,360)
$guiobj=GUICtrlCreateObj($obj,0,0,635,280)
$aggiorna=GUICtrlCreateButton("Aggiorna",0,290,635,40)
$menu=GUICtrlCreateMenu("In esecuzione: "& musica("http://nowplaying.loudcity.net/now_playing/show/0ccdcf00-28e1-012b-f1eb-f278e03f6eb7"))
$them=GUICtrlCreateMenuItem("The Mix Rock.com",$menu)
$live=GUICtrlCreateMenuItem("Radio",$menu)
$obj.navigate("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")

GUISetState()
While 1
       If @SEC=00 Then
               GUICtrlSetData($menu,"In esecuzione => "& musica("http://nowplaying.loudcity.net/now_playing/show/0ccdcf00-28e1-012b-f1eb-f278e03f6eb7"))
       EndIf
       $msg=GUIGetMsg()
       Switch $msg
       Case $gui_event_close
               Exit
       Case $aggiorna
               $obj.navigate("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")
               GUICtrlSetData($menu,"In esecuzione => "& musica("http://nowplaying.loudcity.net/now_playing/show/0ccdcf00-28e1-012b-f1eb-f278e03f6eb7"))
       Case $them
               _IECreate("www.themixrock.com")
       Case $live
               _IECreate("http://loudcity.com/stations/themixrock/files/show/themixrockplayer.html")
       EndSwitch
WEnd
Func musica($sito)
       $ie=_IECreate($sito,"",0)
       $source=_IEDocReadHTML($ie)
       If Not FileExists(@ScriptDir &"\source.txt") Then _FileCreate(@ScriptDir &"\source.txt")
       $file=FileOpen(@ScriptDir &"\source.txt",2)
       FileWrite($file,$source)
       FileClose($file)
       $srcl=StringTrimLeft($source,821)
       $srcr=StringTrimRight($srcl,40)
       ProcessClose("iexplore.exe")
       Return $srcr
EndFunc


adesso ti dice anche che canzone stai ascoltando.
probabilmente ci metterà un pò ad avviarsi per via che il server è lentuccio :P
ciao :)

Download attachment
The_Mix_Rock_live_v0.2.rar ( Number of downloads: 6 )

 
Top
eyobi
CAT_IMG Posted on 27/7/2009, 13:28     +1   -1




utile
 
Top
3 replies since 24/7/2009, 19:56   98 views
  Share