Code: Select all
MostraWmp()
*-----------------------------------------------------------------------------
Function MostraWmp()
Local oDlg, oActiveX, cRadioTv:="http://www.tempofm.com.br/tempofm3.asx"
DEFINE DIALOG oDlg TITLE "Radio/Tv" FROM 1,1 TO 360,430 PIXEL
oDlg:lHelpIcon := .F.
oDlg:nStyle := nOr( WS_MINIMIZEBOX ,WS_VISIBLE, WS_CAPTION, WS_SYSMENU ) //, WS_THICKFRAME
ACTIVATE DIALOG oDlg CENTERED ; //NOMODAL;
ON INIT ( oActiveX := ActivaWMP( oDlg, oActiveX, cRadioTv ), ToolBar(oDlg, oActiveX), MenuRadioTv(oDlg, oActiveX) );
VALID ( oActiveX :DO( "Stop" ), oActiveX :End(), .T. )
Return nil
*-----------------------------------------------------------------------------
Function ActivaWMP( oDlg, oActiveX, cRadioTv )
oActiveX = TActiveX():New( oDlg, "MediaPlayer.MediaPlayer.1",;
oDlg:nTop+30, oDlg:nLeft, oDlg:nRight, oDlg:nBottom-50 )
oActiveX :SetProp( "FileName", cRadioTv )
Return( oActiveX )
*-----------------------------------------------------------------------------
Function ToolBar(oDlg, oActiveX)
Local oToolBar, cTitle:="Radio Tempo FM"
DEFINE ButtonBar oToolBar SIZE 50,28 OF oDlg TOP 2007
@ 002, 002 COMBOBOX cTitle ITEMS {"Radio Tempo FM",;
"Radio Jovempan (Campinas)",;
"-------------------------",;
"Tv Canção Nova",;
"Tv Rai News (Italia)",;
"-------------------------",;
"Escolher Arquivo"} PIXEL OF oToolBar SIZE 250,150 ON CHANGE MudaRadioTV(cTitle, oDlg, oActiveX)
Return nil
*-----------------------------------------------------------------------------
Function MudaRadioTV(cTitle, oDlg, oActiveX)
Local cFile, cString
oActiveX :DO( "Stop" )
If cTitle = "Radio Tempo FM"
oActiveX :SetProp( "FileName", "http://www.tempofm.com.br/tempofm3.asx", "Radio Tempo FM" )
ElseIf cTitle = "Radio Jovempan (Campinas)"
oActiveX :SetProp( "FileName", "http://www.dnip.com.br/link/jovempancampinas.wmx" )
ElseIf cTitle = "Radio Canção Nova"
oActiveX :SetProp( "FileName", "http://www.cancaonova.com/radiofm.asx" )
ElseIf cTitle = "Tv Canção Nova"
oActiveX :SetProp( "FileName", "http://www.cancaonova.com/tvcn.asx" )
ElseIf cTitle = "Tv Rai News (Italia)"
oActiveX :SetProp( "FileName", "http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=1" )
ElseIf cTitle = "Radio Verdes Mares"
oActiveX :SetProp( "FileName", "http://187.110.226.22:8122" )
ElseIf cTitle = "Tv CM (Musica Argentina)"
oActiveX :SetProp( "FileName", "mms://www.cmtv.com.ar:1234" )
ElseIf cTitle = "Radio FM93"
oActiveX :SetProp( "FileName", "http://187.110.226.22:8036")
ElseIf cTitle = "Escolher Arquivo"
cString := "wav|*.wav|mp4|*.mp4|*.*|*.*|"
cFile := cGetFile( cString, "Selecione um arquivo",, CurDrive()+":\"+GetCurDir() )
If "*"$cFile .or. !File(cFile)
cFile:=""
Else
oActiveX :SetProp( "FileName", cFile )
Endif
Endif
Return nil
*-----------------------------------------------------------------------------
Static Function MenuRadioTv(oDlg, oActiveX)
Local oMenu
MENU oMenu 2007
MENUITEM "&Rádios"
MENU
MENUITEM "&teste"
MENU
MENUITEM "Radio Verdes Mares" action MudaRadioTV("Radio Verdes Mares", oDlg, oActiveX)
MENUITEM "Radio FM93" action MudaRadioTV("Radio FM93", oDlg, oActiveX)
ENDMENU
MENUITEM "Radio Canção Nova" action MudaRadioTV("Radio Canção Nova", oDlg, oActiveX)
ENDMENU
MENUITEM "&Tvs"
MENU
MENUITEM "&Tv Brasil"
MENU
MENUITEM "Tv Canção Nova" action MudaRadioTV("Tv Canção Nova", oDlg, oActiveX)
ENDMENU
MENUITEM "&Tv Internacional"
MENU
MENUITEM "Tv Rai News (Italia)" action MudaRadioTV("Tv Rai News (Italia)", oDlg, oActiveX)
MENUITEM "Tv CM (Musica Argentina)" action MudaRadioTV("Tv CM (Musica Argentina)", oDlg, oActiveX)
ENDMENU
ENDMENU
ENDMENU
oDlg:setmenu(oMenu)
RETURN oMenu