Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
772eca63
Commit
772eca63
authored
Jan 27, 1993
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added options to make window bigger than video (for recording to tape)
parent
41292a81
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
Demo/sgi/video/Vplay.py
Demo/sgi/video/Vplay.py
+38
-3
No files found.
Demo/sgi/video/Vplay.py
View file @
772eca63
...
@@ -20,6 +20,9 @@ def help():
...
@@ -20,6 +20,9 @@ def help():
print
'-t : use a 2nd thread for read-ahead'
print
'-t : use a 2nd thread for read-ahead'
print
'-x left : window offset from left of screen'
print
'-x left : window offset from left of screen'
print
'-y top : window offset from top of screen'
print
'-y top : window offset from top of screen'
print
'-w width : window width'
print
'-h height : window height'
print
'-b color : background color (white,black or (r,g,b))'
print
'file ... : file(s) to play; default film.video'
print
'file ... : file(s) to play; default film.video'
print
print
print
'User interface:'
print
'User interface:'
...
@@ -52,17 +55,20 @@ regen = None
...
@@ -52,17 +55,20 @@ regen = None
speed
=
1.0
speed
=
1.0
threading
=
0
threading
=
0
xoff
=
yoff
=
None
xoff
=
yoff
=
None
xwsiz
=
ywsiz
=
None
bgcolor
=
None
# Main program -- mostly command line parsing
# Main program -- mostly command line parsing
def
main
():
def
main
():
global
debug
,
looping
,
magnify
,
mindelta
,
nowait
,
quiet
,
regen
,
speed
global
debug
,
looping
,
magnify
,
mindelta
,
nowait
,
quiet
,
regen
,
speed
global
threading
,
xoff
,
yoff
global
threading
,
xoff
,
yoff
,
xwsiz
,
ywsiz
,
bgcolor
# Parse command line
# Parse command line
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'M:dlm:nqr:s:tx:y:'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
\
'M:dlm:nqr:s:tx:y:w:h:b:'
)
except
getopt
.
error
,
msg
:
except
getopt
.
error
,
msg
:
sys
.
stdout
=
sys
.
stderr
sys
.
stdout
=
sys
.
stderr
print
'Error:'
,
msg
,
'
\
n
'
print
'Error:'
,
msg
,
'
\
n
'
...
@@ -96,6 +102,20 @@ def main():
...
@@ -96,6 +102,20 @@ def main():
print
'-t ignored'
print
'-t ignored'
if
opt
==
'-x'
:
xoff
=
string
.
atoi
(
arg
)
if
opt
==
'-x'
:
xoff
=
string
.
atoi
(
arg
)
if
opt
==
'-y'
:
yoff
=
string
.
atoi
(
arg
)
if
opt
==
'-y'
:
yoff
=
string
.
atoi
(
arg
)
if
opt
==
'-w'
:
xwsiz
=
string
.
atoi
(
arg
)
if
opt
==
'-h'
:
ywsiz
=
string
.
atoi
(
arg
)
if
opt
==
'-b'
:
if
arg
==
'black'
:
bgcolor
=
(
0
,
0
,
0
)
elif
arg
==
'white'
:
bgcolor
=
(
255
,
255
,
255
)
else
:
try
:
bgcolor
=
eval
(
arg
)
xxr
,
xxg
,
xxb
=
bgcolor
except
:
print
'-b needs (r,g,b) tuple'
sys
.
exit
(
2
)
except
string
.
atoi_error
:
except
string
.
atoi_error
:
sys
.
stdout
=
sys
.
stderr
sys
.
stdout
=
sys
.
stderr
print
'Option'
,
opt
,
'requires integer argument'
print
'Option'
,
opt
,
'requires integer argument'
...
@@ -141,6 +161,13 @@ def process(filename):
...
@@ -141,6 +161,13 @@ def process(filename):
gl
.
foreground
()
gl
.
foreground
()
width
,
height
=
int
(
vin
.
width
*
magnify
),
int
(
vin
.
height
*
magnify
)
width
,
height
=
int
(
vin
.
width
*
magnify
),
int
(
vin
.
height
*
magnify
)
xborder
=
yborder
=
0
if
xwsiz
:
vin
.
xorigin
=
(
xwsiz
-
width
)
/
2
width
=
xwsiz
if
ywsiz
:
vin
.
yorigin
=
(
ywsiz
-
height
)
/
2
height
=
ywsiz
if
xoff
<>
None
and
yoff
<>
None
:
if
xoff
<>
None
and
yoff
<>
None
:
scrheight
=
gl
.
getgdesc
(
GL
.
GD_YPMAX
)
scrheight
=
gl
.
getgdesc
(
GL
.
GD_YPMAX
)
gl
.
prefposition
(
xoff
,
xoff
+
width
-
1
,
\
gl
.
prefposition
(
xoff
,
xoff
+
width
-
1
,
\
...
@@ -154,6 +181,10 @@ def process(filename):
...
@@ -154,6 +181,10 @@ def process(filename):
if
quiet
:
vin
.
quiet
=
1
if
quiet
:
vin
.
quiet
=
1
vin
.
initcolormap
()
vin
.
initcolormap
()
if
bgcolor
:
r
,
g
,
b
=
bgcolor
vin
.
clearto
(
r
,
g
,
b
)
gl
.
qdevice
(
ESCKEY
)
gl
.
qdevice
(
ESCKEY
)
gl
.
qdevice
(
WINSHUT
)
gl
.
qdevice
(
WINSHUT
)
gl
.
qdevice
(
WINQUIT
)
gl
.
qdevice
(
WINQUIT
)
...
@@ -169,6 +200,10 @@ def process(filename):
...
@@ -169,6 +200,10 @@ def process(filename):
while
not
stop
:
while
not
stop
:
dev
,
val
=
gl
.
qread
()
dev
,
val
=
gl
.
qread
()
if
dev
==
REDRAW
:
if
dev
==
REDRAW
:
if
bgcolor
:
r
,
g
,
b
=
bgcolor
vin
.
clearto
(
r
,
g
,
b
)
else
:
vin
.
clear
()
vin
.
clear
()
if
dev
==
LEFTMOUSE
and
val
==
1
:
if
dev
==
LEFTMOUSE
and
val
==
1
:
break
# Continue outer loop
break
# Continue outer loop
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment