Hi All,
I'm new to quartz, but not cocoa programming.
I'm trying to make a simple test to input and receive values from a quartz
composition.
I'm not interested in rendering, at least at the moment.
I built a composition with a single Random patch.
I published the input variables as:
Min
Max
I published the output variables as:
Result
I saved the patch, and included it in a Cocoa project.
(... after trying QCRenderer, QCView, and QCCompositionLayer to no avail...)
The example I am posting is for a QCCompositionLayer...
NSString *compositionPath = [[NSBundle mainBundle] pathForResource:@"random"
ofType:@"qtz"];
NSNumber *n = [[[NSNumber alloc] init] retain];
layer = [[QCCompositionLayer alloc] initWithFile:compositionPath];
[layer setValue:[NSNumber numberWithInt:[CFAMath randomInt:30]]
forInputKey:@"Min"];
[layer setValue:[NSNumber numberWithInt:[CFAMath randomInt:30]+30]
forInputKey:@"Max"];
CFALog(@"min:%@",[[layer valueForInputKey:@"Min"] description]);
CFALog(@"max:%@",[[layer valueForInputKey:@"Max"] description]);
CFALog(@"val1:%@",[[layer valueForOutputKey:@"Value"] description]);
CFALog(@"val2:%4.2f",[layer valueForOutputKey:@"Value" ofType:@"floatValue"]);
n = [layer valueForOutputKey:@"Value"];
CFALog(@"val3: %4.2f",[n floatValue]);
In the console I always get:
min: --- some random value ---
max: --- some random value ---
val1:0
val2:0.00
val3:0.00
Min and max are always updating nicely, but the composition doesn't produced an
appropriate value for Result...
But, in quartz composer, the value of Result always changes appropriately...
Cheers,
T _______________________________________________
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]