Works like a charm. Thanks. This will allow me to have my animation not consume 20% of the CPU on my laptop. My (hopefully) future customers will appreciate that.

BTW, if anyone here would like to beta test my iPhone ringtone creation app within which is my mostly gratuitous QC animation please feel free to send me an email and I will send you a license and DL URL.

On May 17, 2009, at 5:54 PM, Christopher Wright wrote:

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!

_______________________________________________
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