repos
/
qt.examples
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
Phonon video example
Annotate for file src/video.lisp
2009-07-22 tobias
1
(in-package :qt.examples)
22:16:26 '
2
'
3
(defun play-video ()
'
4
"Play video"
'
5
(qt:with-app ()
'
6
(setf (cxx:application-name (qt:app)) "Lisp")
'
7
(let ((widget (make-instance 'qt:widget))
'
8
(video-player (make-instance 'qt:phonon.video-player
'
9
:arg0 qt:phonon.+video-category+)))
'
10
(let ((layout (make-instance 'qt:vbox-layout))
'
11
(open-button (make-instance 'qt:push-button :arg0 "Open")))
'
12
(cxx:add-widget layout video-player)
'
13
(cxx:add-widget layout open-button)
'
14
(qt:connect (qt:get-signal open-button "clicked()")
'
15
#'(lambda ()
'
16
(let ((file (qt:file-dialog.get-open-file-name
'
17
video-player
'
18
"Select the file to play")))
'
19
(when (> (length file) 0)
'
20
(cxx:play video-player file)))))
'
21
(cxx:set-layout widget layout))
'
22
(cxx:resize widget 300 300)
'
23
(cxx:show widget)
'
24
(qt:exec))))