[Gambas-user] Re: Gambas and media files

Benoit Minisini gambas at ...2...
Tue Jul 15 00:18:29 CEST 2003


Le Lundi 14 Juillet 2003 19:39, Benoit Minisini a écrit :
> Le Dimanche 13 Juillet 2003 16:48, vous avez écrit :
> > Hi,
> >
> > I didn't see any references to playing a sound file, displaying graphics
> > or animation/video files. Can this be done within the Gambas environment?
> > How easy is it to distribute Gambas apps? I have been interested in Linux
> > but have been waiting for a VB like development environment before
> > jumping in.
> >
> > thanks.
> >
> > Jim Allison
>
> Hi Jim,
>
> There is nothing completely integrated in Gambas for that at the moment.
>
> But you can play videos in Gambas with mplayer this way:
>
> 1) Create a form with a void Label named lblMPlayer, for example.
> 2) Do: EXEC [ "mplayer", "-wid", lblMPlayer.Id, "myvideo.avi" ]
>
> If you want to control mplayer, it has a slave mode.
>
> EXEC [ "mplayer", "-wid", lblMPlayer.Id, "-slave", "myvideo.avi" ] FOR
> WRITE AS #hProcess
>
> hProcess.Send("pause\n") ' Pause the movie
>
> Type "man mplayer" to get all the commands.
>
> To run a gambas app on a computer, this computer need having gambas
> installed. If this is done, then you just have to copy your executable to
> distribute it. Everything is included inside.
>
> Regards,

I have just tested what I said, and it does not works exactly this way. I know 
I should do the contrary, testing, then talking... :-)

In fact, mplayer accepts being embedded into a window, but it hides the window 
it is embedded into without letting QT seeing that. So this window must be 
hidden and shown each time a movie starts, to force the window to be visible 
!

Moreover, the window passed to mplayer must no redraw itself.

So I have modified the DrawingArea widget so that when it is disabled, it 
draws nothing on the screen.

I have wrote a MoviePlayer example that will come with the next version of 
gambas.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list