diff options
author | Guido van Rossum <guido@python.org> | 1993-06-11 14:13:13 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-06-11 14:13:13 (GMT) |
commit | 2055ee848086371d1ccc9e58548a740eb3ea1c2e (patch) | |
tree | c8a23685605c77fe84847e16e2ed9a37e70724fb | |
parent | aa895c752b17e5c6b57f9061c9a4ed04cf01bf7b (diff) | |
download | cpython-2055ee848086371d1ccc9e58548a740eb3ea1c2e.zip cpython-2055ee848086371d1ccc9e58548a740eb3ea1c2e.tar.gz cpython-2055ee848086371d1ccc9e58548a740eb3ea1c2e.tar.bz2 |
Keep top left corner of window where it was when resizing.
Keep aspect and max size of window at all times.
Remove (now unnecessary) sleep(0.1) in vcr capture code.
Add messages when initializing VCR.
Remove old comments.
-rwxr-xr-x | Demo/sgi/video/Vb.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Demo/sgi/video/Vb.py b/Demo/sgi/video/Vb.py index 160ef3d..df8505b 100755 --- a/Demo/sgi/video/Vb.py +++ b/Demo/sgi/video/Vb.py @@ -194,10 +194,17 @@ class VideoBagOfTricks: if not self.window: return gl.winset(self.window) + x, y = self.maxx, self.maxy + gl.keepaspect(x, y) + gl.stepunit(8, 6) if not self.use_24: + gl.maxsize(x, y) gl.winconstraints() return - gl.prefsize(self.maxx, self.maxy) + left, bottom = gl.getorigin() + width, height = gl.getsize() + bottom = bottom+height-y + gl.prefposition(left, left+x-1, bottom, bottom+y-1) gl.winconstraints() self.bindvideo() @@ -502,12 +509,16 @@ class VideoBagOfTricks: def vcr_capture(self): if not self.vcr: try: + print 'Connecting to VCR ...' self.vcr = VCR.VCR().init() + print 'Waiting for VCR to come online ...' self.vcr.wait() + print 'Preparing VCR ...' if not (self.vcr.fmmode('dnr') and \ self.vcr.dmcontrol('digital slow')): self.vcr_error('digital slow failed') return + print 'VCR OK.' except VCR.error, msg: self.vcr = None self.vcr_error(msg) @@ -515,8 +526,6 @@ class VideoBagOfTricks: if not self.vcr.still(): self.vcr_error('still failed') return - # XXX for some reason calling where() too often hangs the VCR, - # XXX so we insert sleep(0.1) before every sense() call. self.open_if_closed() rate = self.getint(self.in_rate_vcr, 1) rate = max(rate, 1) @@ -541,12 +550,11 @@ class VideoBagOfTricks: rate = rate - (here - addr) addr = here return - if not self.vcr.fwdshuttle(vcrspeed): # one tenth speed + if not self.vcr.fwdshuttle(vcrspeed): self.vcr_error('fwd shuttle failed') return cycle = 0 while count > 0: - time.sleep(0.1) try: here = self.vcr.sense() except VCR.error, msg: |