Phonon video example
src/video.lisp
Thu Jul 23 00:16:26 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Phonon video example
--- old-qt.examples/src/video.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.examples/src/video.lisp 2014-10-30 07:37:11.000000000 +0100
@@ -0,0 +1,24 @@
+(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))))