NSMovieView (subclassing and movieController)
NSMovieView (subclassing and movieController)
- Subject: NSMovieView (subclassing and movieController)
- From: Christian Schneider <email@hidden>
- Date: Wed, 12 Nov 2003 16:50:25 +0100
Hi all,
I've got two questions about NSMovieView.
First, I wrote a subclass of it and every time I called setMovie on my
custom subclass the movie would load and immediately start playing; the
movie itself was not set to autoplay and indeed would not play
automatically when loaded in Apple's QuickTime-Player. The subclass
evolved out of a controller class I had written and in which everything
worked fine; in the meantime - I figured out that subclassing wasn't
such a good idea and rather implemented another controller that uses an
NSMovieView, and setting a movie works fine again.
This leads me to think that I must have made a mistake in subclassing
NSMovieView; unfortunately I can't think of what I could have done
wrong. So, any idea what could have caused such a behaviour?
Second, I want the NSMovieView to show it's controller but only with the
play button. I can do this with the following code:
[movieView showController:YES adjustingSize:NO];
[movieView setMovie:[[[NSMovie alloc] initWithURL:url byReference:0]
autorelease]];
mc = [movieView movieController];
myControllerFlags = 0;
MCDoAction(mc, mcActionGetFlags, &myControllerFlags);
MCDoAction(mc, mcActionSetFlags,
(void *)(
myControllerFlags |
mcFlagSuppressStepButtons |
mcFlagSuppressSpeakerButton ));
My application uses many short movies so I often reset the movie view's
movie; and each time I want to set a new movie, I have to call the
above code as [movieView setMovie] resets the controller to show all
controls. The problem here is not so much the wasted effort as the
visual ugliness that results from the controller's switching between the
states. I'm not sure why the movieController is reset but I suppose that
it belongs to the NSMovie rather than the NSMovieView but in any case,
how can I suppress the controls more efficiently? I absolutely need the
controls for now because I use its timeline for visual feedback by
setting an selection on it.
Best regards,
chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.