En este caso uso el control activex
el caso es que tengo problemas para reproducir archivo cuyo nombre tenga letras acentuadas o la letra eñe por ejemplo.
me parece que es un problema del control activex, yq ue tengo lo mismo hecho con vfp y va de lujo.
en el metodo SetFile tengo esto
que es donde me parece se da el problema.::oControl:playlist:add( "File:///" + cFileName )
alguna ayuda.
la verdad me gustaria usar el modo api en c, pero no tengo idea de como iniciar, ya tengo las lib para bcc73 extraida del vlclib.dll
pero nada mas.
Mi idea es hacer un programa para rokonolas digitales, que use vlc como reproductor interno...
aca con fwh
aca con vfp
- Code: Select all Expand view RUN
#include "fivewin.ch"
/*---------------------------------------------------------------------------------------------*/
#define TRUE .t.
#define FALSE .f.
/*---------------------------------------------------------------------------------------------*/
PROCEDURE Main()
LOCAL oIcon, oVLCX
PRIVATE oWndMP
PRIVATE oVlc
PRIVATE cInfoFN, oInfoFN
cInfoFN := "INFO"
DEFINE ICON oIcon FILE "d:\vlc_foxpro\images\myplayer.ico"
DEFINE WINDOW oWndMP FROM 0, 0 TO 600, 800 TITLE "MyPlayer" ICON oIcon PIXEL //NOMAXIMIZE
@ 010, 010 ACTIVEX oVLCX OF oWndMP PROGID "VideoLAN.VLCPlugin.2" SIZE 600, 460
@ 010, 620 BUTTON "Abrir archivo" OF oWndMP SIZE 80, 24 PIXEL ACTION MP_LoadFile()
@ 040, 620 BUTTON "Play" OF oWndMP SIZE 80, 24 PIXEL ACTION oVlc:Play()
@ 070, 620 BUTTON "Pause" OF oWndMP SIZE 80, 24 PIXEL ACTION oVlc:Pause()
@ 100, 620 BUTTON "Stop" OF oWndMP SIZE 80, 24 PIXEL ACTION oVlc:Stop()
@ 150, 620 BUTTON "Vol +" OF oWndMP SIZE 80, 24 PIXEL ACTION oVlc:VolumenPlus()
@ 180, 620 BUTTON "Vol -" OF oWndMP SIZE 80, 24 PIXEL ACTION oVlc:VolumenMinus()
@ 480, 010 GET oInfoFN VAR cInfoFN OF oWndMP SIZE 600, 40 PIXEL WHEN FALSE MEMO
//oInfoFN:lDisColors := FALSE
//oInfoFN:nClrTextDis := CLR_YELLOW
//oInfoFN:nClrPaneDis := CLR_HRED
ACTIVATE WINDOW oWndMP ON INIT MP_OnInit( oVLCX ) CENTER
//oVLC_Control:End()
oWndMP:End()
RETURN
/*---------------------------------------------------------------------------------------------*/
PROCEDURE MP_OnInit( oVLCX )
oVlc := TVlc():new( oVLCX )
RETURN
/*---------------------------------------------------------------------------------------------*/
PROCEDURE MP_LoadFile()
LOCAL cFileName := cGetFile( "Video |*.mp4|Musica |*.mp3", "Selecione medio", nil, "", .f., .t. )
oVlc:SetFile( cFileName )
oInfoFN:SetText( cFileName )
RETURN
/*---------------------------------------------------------------------------------------------*/
CLASS TVlc
DATA oControl
DATA nStepVolume, nVolumen
METHOD New( oControl ) CONSTRUCTOR
METHOD GetVersion()
METHOD SetFile()
METHOD IsPlaying()
METHOD Play()
METHOD Pause()
METHOD Stop()
METHOD GetLength()
METHOD GetPosition()
METHOD GetTimePos()
METHOD FullScreen()
METHOD VolumenPlus()
METHOD VolumenMinus()
ENDCLASS
/*---------------------------------------------------------------------------------------------*/
METHOD New( oControl ) CLASS TVlc
IF hb_isObject( oControl )
::nVolumen := 50
::nStepVolume := 2
::oControl := oControl
::oControl:Toolbar := .f.
::oControl:volume := 50
ENDIF
RETURN Self
/*---------------------------------------------------------------------------------------------*/
METHOD GetVersion() CLASS TVlc
RETURN ::oControl:GetVersionInfo()
/*---------------------------------------------------------------------------------------------*/
METHOD SetFile( cFileName ) CLASS TVlc
LOCAL lRet := .f.
IF !empty( cFileName )
::oControl:playlist:items:clear()
::oControl:playlist:add( "File:///" + cFileName )
lRet := .t.
ENDIF
RETURN lRet
/*---------------------------------------------------------------------------------------------*/
METHOD IsPlaying() CLASS TVlc
RETURN ::oControl:playlist:IsPlaying()
/*---------------------------------------------------------------------------------------------*/
METHOD Play() CLASS TVlc
IF !::IsPlaying()
::oControl:playlist:play()
ENDIF
RETURN NIL
/*---------------------------------------------------------------------------------------------*/
METHOD Pause() CLASS TVlc
IF ::IsPlaying()
::oControl:playlist:pause()
ENDIF
RETURN NIL
/*---------------------------------------------------------------------------------------------*/
METHOD Stop() CLASS TVlc
IF ::IsPlaying()
::oControl:playlist:stop()
ENDIF
RETURN NIL
/*---------------------------------------------------------------------------------------------*/
METHOD GetLength() CLASS TVlc
RETURN ::oControl:input:length()
/*---------------------------------------------------------------------------------------------*/
METHOD GetPosition() CLASS TVlc
RETURN ::oControl:input:position()
/*---------------------------------------------------------------------------------------------*/
METHOD GetTimePos() CLASS TVlc
RETURN ::oControl:input:time()
/*---------------------------------------------------------------------------------------------*/
METHOD FullScreen() CLASS TVlc
::oControl:video:toggleFullscreen()
RETURN NIL
/*---------------------------------------------------------------------------------------------*/
METHOD VolumenPlus() CLASS TVlc
IF ::nVolumen < 100
::nVolumen := ::nVolumen + ::nStepVolume
IF ::nVolumen>100
::nVolumen := 100
ENDIF
::oControl:volume := ::nVolumen
ENDIF
RETURN NIL
/*---------------------------------------------------------------------------------------------*/
METHOD VolumenMinus() CLASS TVlc
IF ::nVolumen > 0
::nVolumen := ::nVolumen - ::nStepVolume
IF ::nVolumen < 0
::nVolumen := 0
ENDIF
::oControl:volume := ::nVolumen
ENDIF
RETURN NIL
/*---------------------------------------------------------------------------------------------*/