From: Duncan C. <dun...@wo...> - 2007-10-30 00:35:48
|
Sun Oct 21 13:58:43 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: improve vorbis-play demo hunk ./demo/gstreamer/VorbisPlay.hs 8 +import Text.Printf hunk ./demo/gstreamer/VorbisPlay.hs 68 + flip G.timeoutAdd 100 $ do + position <- Gst.elementQueryPosition pipeline Gst.FormatTime + duration <- Gst.elementQueryDuration pipeline Gst.FormatTime + case position of + Just (_, position') -> + case duration of + Just (_, duration') -> do + printf "%10d / %10d\r" (position' `div` Gst.second) (duration' `div` Gst.second) + Nothing -> do + putStr "no information\r" + Nothing -> do + putStr "no information\r" + hFlush stdout + return True + [_$_] |