diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-07-01 18:23:09 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-07-01 18:23:09 (GMT) |
commit | de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2 (patch) | |
tree | da0b9c0e9d56288354f936b59021d94018a172a8 /Mac/Demo/quicktime/MovieInWindow.py | |
parent | bbfd71d7ac02bc2053a0ba494a3f055fbec8deee (diff) | |
download | cpython-de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2.zip cpython-de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2.tar.gz cpython-de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2.tar.bz2 |
Hopefully fix make framework install on Mac (see 3174)
Removal of the Mac modules broke many of the Mac scripts (including
BuildApplet.py) so the building of the Python launcher and IDLE.app was
broken. I manually copied built versions of those apps into Mac. Everything else
which used Mac modules had to die.
Diffstat (limited to 'Mac/Demo/quicktime/MovieInWindow.py')
-rw-r--r-- | Mac/Demo/quicktime/MovieInWindow.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/Mac/Demo/quicktime/MovieInWindow.py b/Mac/Demo/quicktime/MovieInWindow.py deleted file mode 100644 index 00f596e..0000000 --- a/Mac/Demo/quicktime/MovieInWindow.py +++ /dev/null @@ -1,70 +0,0 @@ -"""MovieInWindow converted to python - -Jack Jansen, CWI, December 1995 -""" - -from Carbon import Qt -from Carbon import QuickTime -from Carbon import Qd -from Carbon import QuickDraw -from Carbon import Evt -from Carbon import Events -from Carbon import Win -from Carbon import Windows -from Carbon import File -import EasyDialogs -import sys -import os - - -def main(): - # skip the toolbox initializations, already done - # XXXX Should use gestalt here to check for quicktime version - Qt.EnterMovies() - - # 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): - """Play a movie in a window""" - # XXXX Needed? SetGWorld((CGrafPtr)theWindow, nil); - - # Get the movie - theMovie = loadMovie(theFile) - - # Set where we want it - theMovie.SetMovieBox(movieBox) - - # Start at the beginning - theMovie.GoToBeginningOfMovie() - - # Give a little time to preroll - theMovie.MoviesTask(0) - - # Start playing - theMovie.StartMovie() - - while not theMovie.IsMovieDone() and not Evt.Button(): - theMovie.MoviesTask(0) - -def loadMovie(theFile): - """Load a movie given an fsspec. Return the movie object""" - movieResRef = Qt.OpenMovieFile(theFile, 1) - movie, d1, d2 = Qt.NewMovieFromFile(movieResRef, 0, QuickTime.newMovieActive) - return movie - -if __name__ == '__main__': - main() |