summaryrefslogtreecommitdiffstats
path: root/Mac/Demo/quicktime
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-03-26 14:36:25 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-03-26 14:36:25 (GMT)
commita154262e444c42a31cf6b41350a1252963431619 (patch)
treeb5133bbfe97704ba2a8902c9e0657541bcde0772 /Mac/Demo/quicktime
parent97951de77c7a1f08207f9929f950da268c6bb9b3 (diff)
downloadcpython-a154262e444c42a31cf6b41350a1252963431619.zip
cpython-a154262e444c42a31cf6b41350a1252963431619.tar.gz
cpython-a154262e444c42a31cf6b41350a1252963431619.tar.bz2
Modified to accept a command line argument too.
Diffstat (limited to 'Mac/Demo/quicktime')
-rw-r--r--Mac/Demo/quicktime/MovieInWindow.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mac/Demo/quicktime/MovieInWindow.py b/Mac/Demo/quicktime/MovieInWindow.py
index 0df30a4..ec4beae 100644
--- a/Mac/Demo/quicktime/MovieInWindow.py
+++ b/Mac/Demo/quicktime/MovieInWindow.py
@@ -14,6 +14,7 @@ from Carbon import Windows
from Carbon import File
import EasyDialogs
import sys
+import os
def main():
@@ -22,17 +23,20 @@ def main():
Qt.EnterMovies()
# Get the movie file
- fss = EasyDialogs.AskFileForOpen(wanted=File.FSSpec) # Was: QuickTime.MovieFileType
- if not fss:
+ if len(sys.argv) > 1:
+ filename = sys.argv[1]
+ else:
+ filename = EasyDialogs.AskFileForOpen() # Was: QuickTime.MovieFileType
+ if not filename:
sys.exit(0)
# Open the window
bounds = (175, 75, 175+160, 75+120)
- theWindow = Win.NewCWindow(bounds, fss.as_tuple()[2], 1, 0, -1, 0, 0)
+ theWindow = Win.NewCWindow(bounds, os.path.split(filename)[1], 1, 0, -1, 0, 0)
Qd.SetPort(theWindow)
# XXXX Needed? SetGWorld((CGrafPtr)theWindow, nil)
- playMovieInWindow(theWindow, fss, theWindow.GetWindowPort().GetPortBounds())
+ playMovieInWindow(theWindow, filename, theWindow.GetWindowPort().GetPortBounds())
def playMovieInWindow(theWindow, theFile, movieBox):
"""Play a movie in a window"""