[Python-checkins] python/dist/src/Mac/Demo/quicktime MovieInWindow.py,1.7,1.8
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Wed, 26 Mar 2003 06:36:28 -0800
Update of /cvsroot/python/python/dist/src/Mac/Demo/quicktime
In directory sc8-pr-cvs1:/tmp/cvs-serv16454
Modified Files:
MovieInWindow.py
Log Message:
Modified to accept a command line argument too.
Index: MovieInWindow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Demo/quicktime/MovieInWindow.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** MovieInWindow.py 26 Jan 2003 21:36:06 -0000 1.7
--- MovieInWindow.py 26 Mar 2003 14:36:25 -0000 1.8
***************
*** 15,18 ****
--- 15,19 ----
import EasyDialogs
import sys
+ import os
***************
*** 23,37 ****
# Get the movie file
! fss = EasyDialogs.AskFileForOpen(wanted=File.FSSpec) # Was: QuickTime.MovieFileType
! if not fss:
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)
Qd.SetPort(theWindow)
# XXXX Needed? SetGWorld((CGrafPtr)theWindow, nil)
! playMovieInWindow(theWindow, fss, theWindow.GetWindowPort().GetPortBounds())
def playMovieInWindow(theWindow, theFile, movieBox):
--- 24,41 ----
# Get the movie file
! 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, os.path.split(filename)[1], 1, 0, -1, 0, 0)
Qd.SetPort(theWindow)
# XXXX Needed? SetGWorld((CGrafPtr)theWindow, nil)
! playMovieInWindow(theWindow, filename, theWindow.GetWindowPort().GetPortBounds())
def playMovieInWindow(theWindow, theFile, movieBox):