Phonon video example
Thu Jul 23 00:16:26 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Phonon video example
hunk ./make-bundle.sh 17
+ \"/usr/local/lib/libsmokephonon.so.2\" \
hunk ./qt.examples.mbd 50
- (:needs :qt :qt.webkit :qt.uitools :sysdef.cmake)
+ (:needs :qt :qt.webkit :qt.uitools :qt.phonon :sysdef.cmake)
hunk ./qt.examples.mbd 57
+ ("video" (:needs "package"))
hunk ./src/package.lisp 15
+ [_$_]
+ #:play-video
addfile ./src/video.lisp
hunk ./src/video.lisp 1
+(in-package :qt.examples)
+
+(defun play-video ()
+ "Play video"
+ (qt:with-app ()
+ (setf (cxx:application-name (qt:app)) "Lisp")
+ (let ((widget (make-instance 'qt:widget))
+ (video-player (make-instance 'qt:phonon.video-player
+ :arg0 qt:phonon.+video-category+)))
+ (let ((layout (make-instance 'qt:vbox-layout))
+ (open-button (make-instance 'qt:push-button :arg0 "Open")))
+ (cxx:add-widget layout video-player)
+ (cxx:add-widget layout open-button)
+ (qt:connect (qt:get-signal open-button "clicked()")
+ #'(lambda ()
+ (let ((file (qt:file-dialog.get-open-file-name
+ video-player
+ "Select the file to play")))
+ (when (> (length file) 0)
+ (cxx:play video-player file)))))
+ (cxx:set-layout widget layout))
+ (cxx:resize widget 300 300)
+ (cxx:show widget)
+ (qt:exec))))