QCView has setMaxRenderingFrameRate: but QCCompositionLayer has no such equivalent call that I can find. I am guessing there might be an attribute to be set with setValue:forKey: but I can find no reference to this.
If there were such a property, it would be on QCCompositionLayer's super class, CAOpenGLLayer or CALayer. I'm not aware of a way to modify the framerate of a layer backed view, much less a single layer. CoreAnimation runs at the best frame rate it can, asking its layers to draw if they need to and in Leopard, QC will accept every request to draw.

This is black magic, but it might help you out.

First, define our top-secret undocumented-api method:

        @interface NSObject (WarningSuppression)
        -(void)setMaximumFrameRate:(float)maxRate;
        @end

(you can make the class QCCompositionLayer if you feel so inclined, so minimize class-method-space pollution)

Next up, work your magic:

QCCompositionLayer *compLayer = [QCCompositionLayer compositionLayerWithFile:@"/Users/cwright/Desktop/qtz/lame.qtz"];
        [compLayer setMaximumFrameRate: 1.0];           < -- magic!
        compLayer.frame = CGRectMake(0, 0, 128, 128);
        [rootLayer addSublayer: compLayer];

This appears to make the composition layer render at 1 frame per second for the 1 composition I tested it with.

This method is also available on the QCCompositionCellLayer class (which makes use of the stuff above, as it's a subclass of QCCompositionLayer), but it's also undocumented.

Standard Disclaimer: you typically don't want to muck about using private APIs unless you want to babysit your code base every time a software update happens.

Otherwise, have a lot of fun!

--
[ christopher wright ]
[email protected]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to