home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Movie Toolbox / Inside Mac Movie Toolbox Code / mtb2.c < prev    next >
Encoding:
Text File  |  1994-12-05  |  933 b   |  47 lines  |  [TEXT/MPS ]

  1. /*
  2.   File:            mtb2.c
  3.   Contains:        Movie Toolbox Functions
  4.   Written by:    DTS and QT Engineering
  5.   Copyright:    © 1992-1994 by Apple Computer, Inc., all rights reserved.
  6.   Change History (most recent first):
  7.   <1>         12/4/94    khs        changed the format of the file to the new look and feel
  8.   To Do:
  9. */
  10.  
  11.  
  12. // INCLUDES
  13. #include "mtb.h"
  14.  
  15.  
  16. // FUNCTIONS
  17. Movie GetMovie(void)
  18. {
  19.     OSErr err;
  20.     SFTypeList typeList =
  21.     {
  22.         MovieFileType,  0, 0, 0
  23.     };
  24.     StandardFileReply reply;
  25.     Movie aMovie = nil;
  26.     short movieResFile;
  27.  
  28.     StandardGetFilePreview(nil, 1, typeList, &reply);
  29.     if (reply.sfGood)
  30.     {
  31.         err = OpenMovieFile(&reply.sfFile, &movieResFile, fsRdPerm);
  32.         if (err == noErr)
  33.         {
  34.             short movieResID = 0;                // want first movie
  35.             Str255 movieName;
  36.             Boolean wasChanged;
  37.  
  38.             err = NewMovieFromFile(&aMovie, movieResFile, &movieResID, movieName, newMovieActive,// flags
  39.                                    &wasChanged);
  40.             CloseMovieFile(movieResFile);
  41.         }
  42.     }
  43.     return aMovie;
  44. }
  45.  
  46.  
  47.