Andava eu a inventar e lembrei me de acabar este player que fiz para ouvir radio online mas depois fiz de maneira que a pessoa possa configurar ao seu gosto desde o ip da radio ,titulo,
ate mesmo dizer no about que foi feito por ti.
Sinceramente so testei umas 10 radios diferentes e com sucesso se n der em algumas espero que digam aqui.
Código:
Open "WinInet" For DLL As #wininet
Struct pdw, Flags As ULong
CallDLL #wininet, "InternetGetConnectedState", _
pdw As Struct, _
0 As Long, _
bConnExists As Long
If bConnExists Then
goto [start]
Else
notice "Player - Conecção de Internet "+chr$(13)+"Não existe conecção." +_
CHR$(13)+ "Tenta conectar primeiro."
End If
Close #wininet
End
[start]
lines=0
OPEN "config.txt" FOR INPUT AS #1
WHILE EOF(#1)=0
lines=lines+1
LINE INPUT #1, id0$
if lines = 4 then id1$ = id0$
if lines = 7 then id2$ = id0$
if lines = 8 then id3$ = id0$
if lines = 9 then id4$ = id0$
if lines = 12 then id5$ = id0$
if lines = 15 then id6$ = id0$
if lines = 18 then id7$ = id0$
WEND
CLOSE #1
open "Db\ip.htm" for output as #1
print #1, "<html>"
print #1, "<head>"
print #1, "<title>"+id1$+"</title>"
print #1, "</head>"
print #1, "<body bgcolor="; chr$(34);"#ffffff"; chr$(34);" topmargin="; chr$(34);"0"; chr$(34);" leftmargin="; chr$(34);"0"; chr$(34);">"
print #1, "<table height=190 border="; chr$(34);"0"; chr$(34);" cellspacing="; chr$(34);"0"; chr$(34);" cellpadding="; chr$(34);"0"; chr$(34);">"
print #1, "<tr><td width="; chr$(34);"280"; chr$(34);" align=center><IMG SRC="; chr$(34);"dsc.png"; chr$(34);"BORDER="; chr$(34);"0"; chr$(34);" ALT="; chr$(34);"Dark Shadows Club"; chr$(34);"></td></tr>"
print #1, "<tr><td width="; chr$(34);"280"; chr$(34);">"
print #1, "<object ID="; chr$(34);"NSPlay1"; chr$(34);" WIDTH="; chr$(34);"280"; chr$(34);" HEIGHT="; chr$(34);"50"; chr$(34);" CLASSID="; chr$(34);"CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"; chr$(34);" CODEBASE="; chr$(34);"http://www.microsoft.com/ntserver/netshow/download/en/nsmp2inf.cab#Version=5,1,51,415"; chr$(34);" standby="; chr$(34);"Loading Microsoft Windows Media Player components..."; chr$(34);" TYPE="; chr$(34);"application/x-oleobject"; chr$(34);" VIEWASTEXT>"
print #1, "<param NAME="; chr$(34);"FileName"; chr$(34);" VALUE="; chr$(34);"http://"+ id6$ ; chr$(34);">"
print #1, "<param NAME="; chr$(34);"AnimationAtStart"; chr$(34);" VALUE="; chr$(34);"FALSE"; chr$(34);">"
print #1, "<param NAME="; chr$(34);"AutoStart"; chr$(34);" VALUE="; chr$(34);"TRUE"; chr$(34);">"
print #1, "<param NAME="; chr$(34);"ShowStatusBar"; chr$(34);" VALUE="; chr$(34);"TRUE"; chr$(34);">"
print #1, "<param NAME="; chr$(34);"ShowControls"; chr$(34);" VALUE="; chr$(34);"1"; chr$(34);">"
print #1, "<param NAME="; chr$(34);"ShowDisplay"; chr$(34);" VALUE="; chr$(34);"0"; chr$(34);">"
print #1, "<embed TYPE="; chr$(34);"application/x-mplayer2"; chr$(34);" PLUGINSPAGE="; chr$(34);"http://www.microsoft.com/windows/mediaplayer/download/default.asp"; chr$(34);" SRC="; chr$(34);"http://"+ id6$ ; chr$(34);" NAME="; chr$(34);"NSPlay1"; chr$(34);" WIDTH="; chr$(34);"280"; chr$(34);" HEIGHT="; chr$(34);"65"; chr$(34);"></embed>"
print #1, "</object>"
print #1, "</td>"
print #1, "</tr>"
print #1, "</table>"
print #1, "</body>"
print #1, "</html>"
close #1
nomainwin
WindowWidth=286
WindowHeight=362
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
menu #1, "&Menu", "&Fechar ALT +F4", [quit]
menu #1, "&Info", "&Site oficial da Radio", [site],"&Ajuda", [help], "&Sobre", [about]
open "Player - " + id1$ for window_nf as #1
#1 "trapclose [quit]"
open "vtkbs.dll" for dll as #b
hMain = hwnd(#1)
url$=DefaultDir$+"\Db\ip.htm"
'url$="http:\\xx.xx.xx"
calldll #b, "CreateBrowser", hMain as ulong, 0 as long, _
0 as long, 300 as long,317 as long,_
url$ as ptr, 0 as long, result as ulong
if result<>0 then
notice "Player - erro"+chr$(13)+"Impossivel fazer o loading do dll."
end
end if
wait
[about]
ab$="Player - " + id1$
t$=CHR$(13)+ "Player - " + id1$+_
CHR$(13)+_
CHR$(13)+ id2$ +_
CHR$(13)+ id3$ +_
CHR$(13)+ id4$ +_
CHR$(13)+_
CHR$(13)+_
CHR$(13)+ "Powered " + id5$ + " "
calldll #user32, "MessageBeep", _MB_ICONINFORMATION as long, beepResult as boolean
mbflags = _MB_ICONINFORMATION OR _MB_OK
calldll #user32, "MessageBoxA", _
0 as long, _
t$ as ptr, _
ab$ as ptr, _
mbflags as long, _
mbResult as long
wait
[help]
run "notepad config.txt"
wait
[site]
url1$=chr$(34);id7$;chr$(34)
run "explorer " ; url1$
wait
[quit]
close #wininet
calldll #b, "DestroyBrowser", re as void
close #b
close #1
end
config.txt
Código:
# Start Config #
# Titulo da bar: uma linha.
Your Radio player
# Sobre: três linhas.
site oficial : lalala
lala la la
la la alllllllalala lalala.
# Feito por: uma linha.
by you - your@email.vv
# Endereço/ip:porta da radio: uma linha.
128relay1.gothmetal.net:6666
#Site oficial da radio: uma linha.
http://clientes.netvisao.pt/whitehat/prtsc/
#End Config
###########################################
Radios
http://128relay1.gothmetal.net:6666
http://87.106.67.16:10000
195.234.45.50:8000
http://radio.hazzardofdarkness.com:6666
http://radiosubway.de:9000
http://www.r1live.de:8000
http://85.214.98.3:8000
###########################################
Ajuda:
Quando alterar alguma configuração convem
reiniciar o Player.
Imagem de fundo Db\dsc.png podem alterar
mas convem ser no formato .png
e com as mesmas dimenssões.
Have fun.
Rui Branco - whitehatg@gmail.com
###########################################
Dentro do zip contem o config.txt para ler e configurar ao vosso gosto
Download:
http://clientes.netvisao.pt/whitehat/player/player.zip
Source
http://clientes.netvisao.pt/whitehat/pl ... source.zip
Compilas com
http://www.libertybasic.com/download.html

_________________
if $true = 1 then print "I´m the one"
