From 2055ee848086371d1ccc9e58548a740eb3ea1c2e Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 11 Jun 1993 14:13:13 +0000 Subject: [PATCH] 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. --- Demo/sgi/video/Vb.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Demo/sgi/video/Vb.py b/Demo/sgi/video/Vb.py index 160ef3d4330..df8505bf171 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: