home *** CD-ROM | disk | FTP | other *** search
-
- /*
- SimpleInMovies
-
- Sample programs demonstrating how to open and display
- QuickTime™ Movies.
-
- SimpleInMovies.c file contains the code for the main loop and the
- routines that open and display movies in a window.
-
- Each window is associated with a movie and an instance of the movie
- controller. There are menu equivalents for movie controller commands
- to show how to interact with the controller.
-
- Guillermo A. Ortiz
- Macintosh Developer Technical Support
-
- 07/17/91 Editing code goes in for the first time
- 08/07/91 Added code to put cuts into the scrap when being switched in/out.
-
- */
-
- /* Interface changes:
- 08/06/91 -- OpenMovieFile lost the parameter.
- 12/03/91 -- Using MCGetControllerInfo to adjust menus.
- */
-
- /* More changes
- 10/08/92 -- Fixed bug in the way loop menu items are enabled/checked.
-
- */
-
- #include <SimpleInMovie.h>
-
- void myGetMoov(void);
- OSErr MakeNewMovie(void);
- void DoIdleStuff(void);
- OSErr CreateMinMovie(Movie *);
-
- extern void ChangeMooVState(void);
- extern void ChangeMooVSound(void);
- extern void NextMooVFrame(void);
- extern void PrevMooVFrame(void);
- extern void SetMovieLoop(short);
-
- extern void DoEnableEditing(void);
- extern void DoUndoMovie(void);
- extern void DoCutMovie(void);
- extern void DoCopyMovie(void);
- extern void DoPasteMovie(void);
- extern void DoClearMovie(void);
- extern void DoSelectAll(void);
- extern void DoScrapStuff(Boolean toScrap);
-
- extern Boolean CreateOneWindow(Movie, StandardFileReply, short, short);
- extern Boolean IsAppWindow(WindowPtr);
- extern Boolean DisposeAllWindows(void);
- extern Boolean DisposeOneWindow(WindowPtr, short);
- extern Boolean DoSave(short);
-
- extern Boolean IsPlayerEvent(WindowPtr, EventRecord *);
- extern Handle GetAppResource(ResType,short, OSErr *);
-
- void AdjustMenus(void);
-
- extern void DoGet1MoviePict(void);
- extern void DoGetTrackPicts(void); /* displays track picts */
- extern void DoGetMoviePicts(void); /* displays movie picts THIS ONE IS USED NOW -- see comment below */
-
- extern void PresentStyleDialog ( void );
- extern void PrintPoster( void);
- extern void PrintTerminate(void);
- extern void PrintInit(void);
-
- extern void pstrcat(char *, char *);
- extern void pstrcpy(char *, char *);
- /*
- * Global Data objects, used by routines external to main().
- */
- MenuHandle MyMenus[menuCount]; /* The menu handles */
- Boolean DoneFlag; /* Becomes TRUE when File/Quit chosen */
- short gUntitledCount=1;
-
- Boolean gMoviesInited, wasChanged;
- long timeOfMovie = 0;
-
- Component movieControllerComponent;
-
- extern void _DataInit();
- extern Movie cuts; /* local scrappy movie */
- /*******************************************************************************************
- *******************************************************************************************/
- /* Initialize the movie toolbox, call InitMovies to let the toolbox know
- of this app, get controller; if something fails set flag to get out of here */
-
- void InitMovieStuff()
- {
- ComponentDescription controllerDescriptor;
- extern Boolean DoneFlag;
- long version;
-
- /* We have to fill in the fields for the player descriptor in order to get the
- standard movie controller component */
- controllerDescriptor.componentType = 'play';
- controllerDescriptor.componentSubType = 0;
- controllerDescriptor.componentManufacturer = 0;
- controllerDescriptor.componentFlags = 0;
- controllerDescriptor.componentFlagsMask = 0;
-
- /* we'll use gMoviesInited as a flag for everything, a false value
- indicates that the movie toolbox or the standard player couldn't be initialized */
- gMoviesInited = false; /* so pessimistic */
-
- if (!(Gestalt(gestaltQuickTime, &version)))
- if ( ! (EnterMovies()) )
- if ( movieControllerComponent = FindNextComponent((Component) 0,
- &controllerDescriptor) ) /* no error means we are OK */
- gMoviesInited = true; /* good! */
-
- if (!gMoviesInited) {
- Alert(rBadMooviesALRT,nil); /* inform user */
- DoneFlag = true; /* we are bailing out */
- }
- }
- /*******************************************************************************************
- *******************************************************************************************/
-
- Boolean CheckSystem()
- {
- long systemVersion;
- Boolean notSeven = true;
-
- if (!Gestalt(gestaltSystemVersion, &systemVersion) ) {
- if (systemVersion >= 0x0700)
- notSeven = false;
- }
- if (notSeven) {
- Alert(rNotSeven,nil); /* inform user */
- DoneFlag = true; /* we are bailing out */
- }
- return (notSeven);
- }
- void DoInits()
- {
- UnloadSeg((Ptr) _DataInit); /* note that _DataInit must not be in Main! */
-
- /*
- * Initialization traps
- */
- InitGraf(&qd.thePort);
- InitFonts();
- FlushEvents(everyEvent, 0);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(nil);
- InitCursor();
-
- MaxApplZone();
- if (!CheckSystem() )
- InitMovieStuff();
- PrintInit();
- }
- /*******************************************************************************************
- *******************************************************************************************/
-
- /* Main contains the event loop, we dispatch here to serve the different
- events, movie fans should pay attention to the way controller events are
- handled when comming through the loop.
- */
- short main()
- {
- Rect screenRect;
- Rect dragRect;
- EventRecord myEvent;
- WindowPtr theActiveWindow;
- WindowPtr whichWindow;
- Boolean Result;
- extern void setupMenus();
- extern void doCommand();
- DocRecHandle wHndl;
- Boolean inBackground = false;
-
- DoInits();
-
- setupMenus();
-
- screenRect = qd.screenBits.bounds;
- SETRECT(&dragRect, 4, 20 + 4, screenRect.right-4, screenRect.bottom-4);
-
- DoneFlag = false;
-
- for ( ;; ) {
- if (DoneFlag) {
- /*
- * Quit has been requested, by the File/Quit menu, or perhaps
- * by a fatal error somewhere else (missing resource, etc).
- * Here we put up a Save Changes? DLOG, which also
- * allows the Cancel buttion to set DoneFlag to false.
- */
- if (!DisposeAllWindows()) /* this releases stdplayer instances */
- DoneFlag = false; /* user pressed cancel maybe? */
- else
- break; /* from main event loop */
- }
- /*
- * Main Event tasks:
- */
- SystemTask();
- theActiveWindow = FrontWindow(); /* Used often, avoid repeated calls */
-
- Result = GetNextEvent(everyEvent, &myEvent);
-
- /* When the movie controller is being used it is a good idea to let it handle the
- updates for movies; to accomplish this the controller has to be given time every
- pass through the event loop. If the controller handles the event then roll again
- if not then we let the normal loop code take care of it.
- */
- if (IsPlayerEvent(*(WindowPtr*) WindowList, &myEvent) )
- continue;
- if (Result ) {
-
- switch (myEvent.what) {
- case mouseDown:
- switch (FindWindow(myEvent.where, &whichWindow)) {
- case inSysWindow:
- SystemClick(&myEvent, whichWindow);
- break;
-
- case inMenuBar:
- {
- doCommand(MenuSelect(myEvent.where));
- }
- break;
-
- case inDrag:
- DragWindow(whichWindow, myEvent.where, &dragRect);
- break;
-
- case inGoAway:
- if (TrackGoAway(whichWindow, myEvent.where)) {
- DisposeOneWindow(whichWindow, closeMovie);
- }
- break;
-
- case inGrow:
- /* There is no grow box. (Fall through) */
-
- case inContent:
- if (whichWindow != theActiveWindow) {
- SelectWindow(whichWindow);
- }
- default:
- break;
- }/*endsw FindWindow*/
- break;
-
- case keyDown:
- case autoKey:
- if (myEvent.modifiers & cmdKey) {
- AdjustMenus();
- doCommand(MenuKey(myEvent.message & charCodeMask));
- }
- break;
-
- case activateEvt:
- break;
-
- case updateEvt:
- if ( IsAppWindow((WindowPtr) myEvent.message )) {
- BeginUpdate((WindowPtr) myEvent.message );
- SetPort((WindowPtr) myEvent.message);
- EraseRect(&(((GrafPtr) myEvent.message)->portRect));
- if (wHndl = (DocRecHandle)GetWRefCon((WindowPtr) myEvent.message) ) {
- UpdateMovie((*wHndl)->wMovie);
- }
- EndUpdate((WindowPtr) myEvent.message );
- }
- break;
- case osEvt:
- switch ((myEvent.message >> 24) & 0x0FF) {
- /* Must logical and with 0x0FF to get only low byte. */
-
- case mouseMovedMessage:
- break;
-
- case suspendResumeMessage:
- inBackground = !(myEvent.message & resumeFlag);
- DoScrapStuff(inBackground);
- break;
- }
- break;
-
- default:
- break;
-
- }/*endsw myEvent.what*/
- AdjustMenus();
- }
- else { /* this is the place where you normally would call your idle routine */
- /* DoIdleStuff(); */ /* to activate movies; in this case we let the standard controller */
- } /* do the idle stuff */
-
- }/*endfor Main Event loop*/
- PrintTerminate();
- ExitMovies(); /* make sure all references to this app are removed */
-
- return 0; /* Return from main() to allow C runtime cleanup */
- }
-
- /*******************************************************************************************
- *******************************************************************************************/
-
- /* standard Macintosh routines */
-
- void setupMenus()
- {
- extern MenuHandle MyMenus[];
- register MenuHandle *pMenu;
-
- /*
- * Set up the desk accessories menu.
- * The "About Sample..." item, followed by a grey line,
- * is presumed to be already in the resource. We then
- * append the desk accessory names from the 'DRVR' resources.
- */
- MyMenus[appleMenu] = GetMenu(appleID);
- AddResMenu(MyMenus[appleMenu], (ResType) 'DRVR');
- /*
- * Now the menus.
- */
-
- MyMenus[fileMenu] = GetMenu(fileID);
- MyMenus[editMenu] = GetMenu(editID);
- MyMenus[moovieMenu] = GetMenu(moovieID);
- MyMenus[pictsMenu] = GetMenu(pictsID);
-
- /*
- * Now insert all of the application menus in the menu bar.
- *
- */
- for (pMenu = &MyMenus[0]; pMenu < &MyMenus[menuCount]; ++pMenu) {
- InsertMenu(*pMenu, 0);
- }
-
- DrawMenuBar();
-
- return;
- }
-
- pascal Boolean AboutFilter(DialogPtr d, EventRecord *ev, short *item);
-
- /* we use this filter proc to give time to the movie controller */
- pascal Boolean AboutFilter(DialogPtr d, EventRecord *ev, short *item)
- {
- #pragma unused(item);
-
- MovieController mc;
- Boolean result;
-
- mc = (MovieController)GetWRefCon(d); /* get controller */
- result = MCIsPlayerEvent(mc, ev); /* and see if it wants to handle the event */
-
- return result;
- }
- /*
- * Display the Sample Application dialog.
- * If there is a window showing a movie we display it in the dialog.
- * Then wait until the OK button is clicked before returning.
- */
- void showAboutMeDialog()
- {
- GrafPtr savePort;
- DialogPtr theDialog;
- short itemType;
- Handle itemHdl;
- Rect itemRect;
- short itemHit;
- MovieController
- moovC;
- WindowPtr window;
- DocRecHandle
- wHndl;
- Boolean doMovieStuff = false;
- short resID = 0;
- Movie moov;
- OSErr err;
- ModalFilterProcPtr
- filter = nil;
-
- GetPort(&savePort);
-
- if (window = FrontWindow()) { /* don't bother if no movies */
- if (IsAppWindow(window) /* make sure it is our window */
- && (wHndl = (DocRecHandle)GetWRefCon(window)) /* and we have our data */
- && ((*wHndl)->wFileInfo.sfr.sfFile.vRefNum != kInvalVRefNum) ) /* and this is not a window created with 'New Movie' which does not have a movie yet */
- if ( err = NewMovieFromFile( &moov, (*wHndl)->wFileInfo.resFile, &resID, nil, newMovieActive, &wasChanged) ) {
- DebugStr("\pCould not get the moov for dialog ");
- }
- else
- doMovieStuff = true;
- }
-
- theDialog = GetNewDialog(aboutMeDLOG, nil, (WindowPtr) -1);
- SetPort(theDialog);
-
- GetDItem(theDialog, authorItem, &itemType, &itemHdl, &itemRect);
- SetIText(itemHdl, "\pGuillermo A. Ortiz, MacDTS");
- GetDItem(theDialog, languageItem, &itemType, &itemHdl, &itemRect);
- SetIText(itemHdl, "\pC");
-
- GetDItem(theDialog, moovItem, &itemType, &itemHdl, &itemRect); /* get rect for movie */
- if ( doMovieStuff ) {
- SetMovieGWorld(moov, (CGrafPtr) theDialog, nil); /* point to the window */
- SetMovieBox(moov,&itemRect); /* and the right place */
- if (moovC = NewMovieController(moov, &itemRect, mcScaleMovieToFit+mcWithFrame) ) {/* get controller */
- if ( MCDoAction(moovC, mcActionPlay, (Ptr)0x00010000) ) /* set the movie in motion */
- DebugStr("\pError at MCDoAction -> Play");
- filter = (ModalFilterProcPtr)AboutFilter; /* put our proc in the filter pointer */
- SetWRefCon(theDialog, (long)moovC); /* we need this guy when in the filter proc */
- }
- }
-
- do {
- ModalDialog(filter, &itemHit);
- } while (itemHit != okButton);
-
- CloseDialog(theDialog);
- if ( doMovieStuff ) {
- DisposeMovieController(moovC);
- DisposeMovie(moov);
- }
- SetPort(savePort);
- return;
- }
-
- /*
- * Process mouse clicks in menu bar
- */
-
- Boolean hilited = false;
- void doCommand(mResult)
- long mResult;
- {
- long theMenu, theItem;
- char daName[256];
- GrafPtr savePort;
- extern MenuHandle MyMenus[];
- extern Boolean DoneFlag;
- extern void showAboutMeDialog();
-
- theItem = LOWORD(mResult);
- theMenu = HIWORD(mResult); /* This is the resource ID */
-
- switch (theMenu) {
- case appleID:
- if (theItem == aboutMeCommand) {
- showAboutMeDialog();
- } else {
- GetItem(MyMenus[appleMenu], theItem, daName);
- GetPort(&savePort);
- (void) OpenDeskAcc(daName);
- SetPort(savePort);
- }
- break;
-
- case fileID:
- switch (theItem) {
- case newMovie:
- MakeNewMovie();
- break;
- case loadMovie:
- {
- myGetMoov(); /* selects MooVie */
- break;
- }
- case closeMovie:
- DisposeOneWindow(FrontWindow(), closeMovie);
- break;
- case saveMovie:
- DoSave(saveMovie);
- break;
- case saveMovieAs:
- DoSave(saveMovieAs);
- break;
- case printCommand:
- PrintPoster();
- break;
- case pageCommand:
- PresentStyleDialog();
- break;
- case quitCommand:
- DoneFlag = true; /* Request exit */
- break;
- default:
- break;
- }
- break;
-
- case editID:
- /*
- * If this is for a 'standard' edit item,
- * run it through SystemEdit first.
- * SystemEdit will return FALSE if it's not a system window.
- */
- if ((theItem <= selectAllCommand) && SystemEdit(theItem-1)) {
- break;
- }
- /* We will use the standard controller to do all the movie editing stuff */
- /* all this commands will affect the front most window only */
- switch (theItem) {
- case undoCommand:
- DoUndoMovie();
- break;
- case cutCommand:
- DoCutMovie();
- break;
- case copyCommand:
- DoCopyMovie();
- break;
- case pasteCommand:
- DoPasteMovie();
- break;
- case clearCommand:
- DoClearMovie();
- break;
- case selectAllCommand:
- DoSelectAll();
- break;
- default:
- break;
- } /*endsw theItem*/
- break;
-
- case moovieID:
- switch (theItem) {
- case stplayMovie:
- {
- ChangeMooVState(); /* stop-start movie */
- break;
- }
- case soundMovie:
- {
- ChangeMooVSound(); /* toggles sound */
- break;
- }
- case advFrMovie:
- {
- NextMooVFrame(); /* advances one frame */
- break;
- }
- case revFrMovie:
- {
- PrevMooVFrame(); /* moves one frame back */
- break;
- }
- case loopMovie:
- {
- SetMovieLoop(theItem); /* sets playback to loop */
- break;
- }
- case weirdLoopMovie:
- {
- SetMovieLoop(theItem); /* Loop back and forth */
- break;
- }
- case editMovie:
- {
- DoEnableEditing();
- break;
- }
- default:
- break;
-
- }
- break;
-
- case pictsID:
- switch (theItem) {
- case getTrackPicts:
- {
- // DoGetTrackPicts(); /* uncomment if you want track picts */
- DoGetMoviePicts(); /* meanwhile get movie picts instead */
- break;
- }
- case get1MoviePict:
- {
- DoGet1MoviePict();
- break;
- }
- default:
- break;
-
- }
- break;
-
- default:
- break;
-
- }/*endsw theMenu*/
-
- HiliteMenu(0);
-
- return;
- }
-
-
- /*******************************************************************************************
- *******************************************************************************************/
- /* the following code creates a new movie, it comes empty but you could use pastes to
- add stuff to it.
-
- */
- OSErr MakeNewMovie(void)
- {
- OSErr theErr;
- Movie newMoov;
- StandardFileReply fake;
- Str255 s1,s2="\pUntitled # ";
-
- if (theErr = CreateMinMovie(&newMoov)) {
- DebugStr("\pmovie creation failed");
- return (theErr);
- }
-
- NumToString(gUntitledCount,s1); /* get current untitled count */
- gUntitledCount++; /* then bump it */
-
- pstrcat (s2, s1);
- pstrcpy (fake.sfFile.name, s2);
-
- fake.sfFile.vRefNum = kInvalVRefNum;
-
- CreateOneWindow(newMoov, fake, kNoFileOpen, kNoResourceYet);
- ClearMovieChanged(newMoov);
- }
-
- /*******************************************************************************************
- *******************************************************************************************/
-
- void myGetMoov(void)
- {
- SFTypeList myFileTypes = {'MooV'};
- StandardFileReply reply;
- Point where = {20,20};
-
- short saveResFile, movieResFile;
- OSErr err;
-
- Rect moovBox;
- Movie moov;
- short resID = 0;
-
-
- saveResFile = CurResFile();
- StandardGetFilePreview(0L, 1, myFileTypes, &reply);
-
- if (reply.sfGood)
- {
-
-
- /* we will open the file with read permission and ask for no MoviesDataRef
- which is necessary when adding stuff to a movie */
- /****** OpenMovieFile lost the last parameter 08/06/91
- if ( OpenMovieFile(&(reply.sfFile), &movieResFile,fsRdPerm, nil) ) {
- */
- if ( OpenMovieFile(&(reply.sfFile), &movieResFile,fsRdWrPerm) ) {
- SysBeep(10); /* cheap way of saying 'I couldn't open the file */
- return; /* and go back */
- }
- else { /* the deal is that a file is selected but you do not know the moov id;
- so we pass 0 for id to get the first moov resource available
- (we do nothing with the returned ID, we could pass nil), nil for name pointer
- and 0 for flags since I want a complete movie and don't want it to be active */
-
- if ( err = NewMovieFromFile( &moov, movieResFile, &resID, nil, 0, &wasChanged) ) {
- DebugStr("\pCould not get the moov ");
- }
- /* We allow for editing files so we don't close the files after getting the movie.
- This change reflects in the permision for OpenMovieFile above.
- CloseMovieFile(movieResFile);
- */
- }
-
- if ( !err ) {
- GetMovieBox(moov,&moovBox); /* Use the movie box to resize window */
- OffsetRect(&moovBox, -moovBox.left, -moovBox.top); /* force topleft to zero */
- SetMovieBox(moov, &moovBox);
-
- CreateOneWindow(moov, reply, movieResFile, resID);
-
- SetMovieActive(moov,true); /* we got the movie inactive */
- if (err = GetMoviesError() )
- DebugStr("\perror after SetMovieActive");
-
- /* When using the controller you want to make all calls that affect the state of the
- movie through the controller action calls; if you don't the controller could go
- off sync. For example, instead of calling StartMovie, you call
- MCDoAction((*DocHandle)->wPlayer, mcActionPlay, (Ptr)0x00010000) in order to
- set the movie in motion. Check the routine CreateOneWindow in SimpleInWindows.c.
-
- if (! err) {
- StartMovie(moov); **** if we do this then the movie will be
- if (err = GetMoviesError() ) **** playing but the start button will show
- DebugStr("\perror after startmovie");
- }
- */
- }
- }
- UseResFile(saveResFile); /* Just in case */
-
- }
-
-
- /*******************************************************************************************
- *******************************************************************************************/
- /* If an app is not using the standard controller it has to call MoviesTask in order to */
- /* let the Movie Toolbox animate the movies. In this sample DoIdleStuff is not called */
- void DoIdleStuff(void)
- {
- OSErr err;
- WindowPtr window;
-
- if (window = FrontWindow()) { /* don't bother if no movies to play */
- MoviesTask((Movie) 0, 500); /* but since we have one service all */
- if (err = GetMoviesError() )
- DebugStr("\pafter MoviesTask");
- }
- }
-
-
- /*******************************************************************************************
- *******************************************************************************************/
-
- /* this enables/disables menu items as the state of the current front most
- movie requires.
- */
- void AdjustMenus()
- {
- WindowPtr window;
- DocRecHandle wHndl;
- long mcInfo;
-
- if (window = FrontWindow()) { /* don't bother if no movies to play */
- if (IsAppWindow(window) && (wHndl = (DocRecHandle)GetWRefCon(window)) ) {
- EnableItem(MyMenus[moovieMenu],nil);
- EnableItem(MyMenus[pictsMenu],nil);
- EnableItem(MyMenus[editMenu],nil);
- DrawMenuBar();
-
- if ( MCGetControllerInfo((*wHndl)->wPlayer, &mcInfo) )
- DebugStr("\pCould not get controller info");
-
- /* Check Edit menu items */
- if ( mcInfo & mcInfoEditingEnabled) { /* fix edit menu items */
- if ( mcInfo & mcInfoUndoAvailable)
- EnableItem(MyMenus[editMenu],undoCommand);
- else
- DisableItem(MyMenus[editMenu],undoCommand);
-
- if ( mcInfo & mcInfoCutAvailable)
- EnableItem(MyMenus[editMenu],cutCommand);
- else
- DisableItem(MyMenus[editMenu],cutCommand);
-
- if ( mcInfo & mcInfoCopyAvailable)
- EnableItem(MyMenus[editMenu],copyCommand);
- else
- DisableItem(MyMenus[editMenu],copyCommand);
-
- if ( mcInfo & mcInfoClearAvailable)
- EnableItem(MyMenus[editMenu],clearCommand);
- else
- DisableItem(MyMenus[editMenu],clearCommand);
-
- if ( cuts /* mcInfo & mcInfoPasteAvailable */)
- EnableItem(MyMenus[editMenu],pasteCommand);
- else
- DisableItem(MyMenus[editMenu],pasteCommand);
-
- EnableItem(MyMenus[editMenu],selectAllCommand); /* and last */
-
- }
- else
- DisableItem(MyMenus[editMenu],nil); /* no editing happening */
-
-
- /* Check Movie menu items */
- /* fix sound item according to front most window */
- if ( mcInfo & mcInfoHasSound ) {
- EnableItem(MyMenus[moovieMenu],soundMovie);
- if ( GetMovieVolume((*wHndl)->wMovie) > 0) { /* fix sound menu item*/
- SetItem(MyMenus[moovieMenu], soundMovie,"\pSound Off");
- }
- else {
- SetItem(MyMenus[moovieMenu], soundMovie,"\pSound On");
- }
- }
- else
- DisableItem(MyMenus[moovieMenu],soundMovie);
-
- if ( mcInfo & mcInfoEditingEnabled) { /* fix edit menu item*/
- SetItem(MyMenus[moovieMenu], editMovie,"\pDisable Edits");
- }
- else {
- SetItem(MyMenus[moovieMenu], editMovie,"\pEnable Edits");
- }
-
- if ( mcInfo & mcInfoIsPlaying ) {/* fix motion menu item */
- SetItem(MyMenus[moovieMenu], stplayMovie,"\pStop Movie");
- }
- else {
- SetItem(MyMenus[moovieMenu], stplayMovie,"\pStart Movie");
- }
-
- /* loop menu items */
-
- CheckItem(MyMenus[moovieMenu], loopMovie,( (mcInfo & mcInfoIsLooping) != 0));
-
- if ((mcInfo & mcInfoIsLooping))
- EnableItem(MyMenus[moovieMenu], weirdLoopMovie);
- else
- DisableItem(MyMenus[moovieMenu], weirdLoopMovie);
-
- CheckItem(MyMenus[moovieMenu], weirdLoopMovie,((mcInfo & mcInfoIsInPalindrome) != 0));
-
- EnableItem(MyMenus[fileMenu],closeMovie);
- EnableItem(MyMenus[fileMenu],saveMovie);
- EnableItem(MyMenus[fileMenu],saveMovieAs);
- }
- }
- else {
- DisableItem(MyMenus[fileMenu],closeMovie);
- DisableItem(MyMenus[fileMenu],saveMovie);
- DisableItem(MyMenus[fileMenu],saveMovieAs);
- DisableItem(MyMenus[editMenu],nil);
- DisableItem(MyMenus[moovieMenu],nil);
- DisableItem(MyMenus[pictsMenu],nil);
- }
- }
-
- /*******************************************************************************************
- *******************************************************************************************/
-
- OSErr CreateMinMovie(moovPtr)
- Movie *moovPtr;
- {
- Movie localMovie;
- OSErr theErr;
-
- localMovie = NewMovie(newMovieActive /* newMovieFlags */);
- if (theErr = GetMoviesError() ) {
- *moovPtr = nil;
- DebugStr("\pCould not create movie");
- }
- else
- *moovPtr = localMovie;
- return (theErr);
- }
-
- /*******************************************************************************************
- *******************************************************************************************/
-
-