我正在努力将此代码移植到quil但没有成功:
使用 qtvideo
void movieEvent(Movie m) {
m.read();
}
或 gsvideo
void movieEvent(GSMovie movie) {
movie.read();
}
我已经做了很多与这个问题相关的搜索,但没有结果:(
我想问题是将(其他)小程序事件连接到 defsketch 定义但是......我可以实现那个简单的事情
谁能帮我?
提前谢谢!
胡安
已编辑:我的 clj 文件
(ns talendar.core
(:use quil.core)
(:import [javax.swing JFileChooser]
[codeanticode.gsvideo GSMovie]))
(declare example movie)
(defn setup []
(def movie (GSMovie. example "./data/station.mov"))
(.loop movie ))
(defn draw []
(comment "this way works but i'll prefer to work with event handler"
(when (.available movie)
(.read movie)))
(image movie 100 100))
(defn movieEvent [e]
(println "listen movie event!")
(.read movie))
(defsketch example
:title "j"
:setup setup
:draw draw
:size [300 300]
:movie-event movieEvent)