Remedy for slothful NSMovieViews?
Remedy for slothful NSMovieViews?
- Subject: Remedy for slothful NSMovieViews?
- From: Michael Rogers <email@hidden>
- Date: Sat, 2 Jun 2001 17:07:40 -0500
I'm trying to get an NSMovieView (represented in the code below by a
theatre object) to bounce around in an NSWindow (enclosingWindow).
I've actually subclassed NSMovieView and overridden -isOpaque to return
YES, but when I run this code...
while(inBounds && bailOutCount++ <= 25){
frame = [theatre frame]; // find out where the NSMovieView is)
frame.origin.x+=deltaX;
frame.origin.y+=deltaY;
[theatre setFrame:frame]; // move it
[enclosingWindow display]; // tell the enclosingWindow to
display itself
[theatre display]; // likewise for the NSMovieView
inBounds = NSContainsRect(enclosingWindowFrame,[theatre frame]);
if(!inBounds){
deltaX*=(-1);
deltaY*=(-1);
inBounds = YES; // not quite right, but
}
}
... on a G3/333, there is a lag before the enclosingWindow and theatre
gets redisplayed, during which time 2 NSMovieViews, slightly offset, are
visible. When the movie stops playing, it moves much faster, but the
lag is still there. Is there something, I can do to optimize this? I
thought that the isOpaque method would help, but it doesn't seem to -- I
suspect its already set to YES in NSMovieView.
Thanks for any advice,
Michael
------------------------------
Dr. Michael P. Rogers
Mathematics & Computer Science, Millikin University
email@hidden
http://math.millikin.edu/mprogers
217-424-6327(W) 309-828-8655 (H) 309-825-6454(C)