🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.mac.programmer.codewarrior
3 messages
3 total messages Started by wall Sat, 25 Oct 2003 09:56
about movie controller
#658
Author: wall
Date: Sat, 25 Oct 2003 09:56
56 lines
2773 bytes
I have four views in my window, and I want to every view can play
movie with controller.So I wrote a function in the view class,but it
not work well.

ShowMovie( FSSpec inFileSpec )
{
	FInfo		theFileInfo;
	OSErr 	theErr = ::FSpGetFInfo ( &inFileSpec, &theFileInfo ); 
	if ( FOUR_CHAR_CODE('MPG ') == theFileInfo.fdType )
	{
	 	OSErr	theErr;
	 	short		theFileRefNum;
		theErr = ::EnterMovies(); 
		if ( theErr )
			return;

	 	theErr = ::OpenMovieFile( &inFileSpec, &theFileRefNum, fsRdPerm );
		if ( theErr == noErr ) 
		{
			short           nResID = 0;         //We want the first movie.
			Str255          strName;
			Boolean         bWasChanged;

			theErr = ::NewMovieFromFile(&mMovie, theFileRefNum, &nResID,
strName,
			                     newMovieActive, &bWasChanged);
			::CloseMovieFile( theFileRefNum );			 

			if (mMovie == nil) return; 
			Rect	movieBox;
			// 0,0 Movie coordinates
 			GetMovieBox(mMovie, &movieBox);
 			MacOffsetRect(&movieBox, -movieBox.left, -movieBox.top); 
			SetMovieBox (mMovie, &bounds); 
	 		
	 		MCSetControllerAttached(aController, true); 
			 // set the movie's play hints to allow dynamic resizing
			SetMoviePlayHints(mMovie, hintsAllowDynamicResize,
hintsAllowDynamicResize);

			SetMovieGWorld (mMovie, (CGrafPtr)GetMacPort(), nil); 
			StartMovie (mMovie); 

			Boolean         done = false; 
			while ( !IsMovieDone(mMovie) && !done ) 
			{ 
			    MoviesTask (mMovie, DoTheRightThing); 
			}
		}
	}
}

someone give me some advice, why the movie controller not in movie
box?

Thanks a lot.(Sorry, my english is very poor)
Re: about movie controller
#650
Author: David Phillip Oster
Date: Sat, 25 Oct 2003 18:26
12 lines
2230 bytes
In article <7328a61a.0310250156.5573ceae@posting.google.com>,
 heroin_c@hotmail.com (wall) wrote:

> someone give me some advice, why the movie controller not in movie
> box?

Don't close the movie file until you are done playing the movie. (until 
the window that owns the movie is closd.)

Don't put all 4 of your movies at positon 0, 0 of your window.

Put the movie controller right below the movie box.
Re: about movie controller
#651
Author: Lawrence D�Oliveiro
Date: Sun, 26 Oct 2003 11:15
16 lines
2102 bytes
In article <oster-FB623C.11261925102003@news.sf.sbcglobal.net>,
 David Phillip Oster <oster@ieee.org> wrote:

>Don't close the movie file until you are done playing the movie. (until 
>the window that owns the movie is closd.)

This isn't necessary. Remember that OpenMovieFile only opens the movie 
resource file (where the movie atoms reside), not (necessarily) the 
movie data file. The movie sample data could in fact reside in a 
different file, or in multiple files. The media data handlers for the 
various tracks will automatically take care of opening and closing these 
files as necessary, independent of your calls to 
OpenMovieFile/CloseMovieFile.

In other words, if you're not going to load any more Movie objects from 
a movie file, feel free to close the movie file immediately.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads