Thanks for the response Pierre-Olivier. Is there example code that
you know of that creates windows of QCRenderers that have input and
output ports feeding and receiving data?
Not that I'm aware of. There is however sample code in /Developer/
Examples/Quartz Composer that uses the QCRenderer and passes values
to the input ports
When doing:
[renderer addObserver:self forKeyPath:@"imageClickA" options:0
context:NULL];
... I never receive the imageClickA (my published port), when I
passed the click through to the composition.
- (void) renderWithEvent:(NSEvent*)event
... I have:
NSLog(@"Sending Event to renderer");
if(![renderer renderAtTime:time arguments:arguments])
NSLog(@"Rendering failed at time %.3fs", time);
//Parse any output events
NSNumber *num = [renderer valueForOutputKey:@"imageClickA"];
BOOL isClicked = [num boolValue];
NSLog(@"Value of ImageClick:%d",isClicked);
..isClicked is never anything other than 0, even though when I run
this through in Quartz Composer itself the value changes. Any ideas?
Either you're doing something wrong elsewhere in the code, or there's
a "bug" in the way you designed your composition: make sure
"imageClickA" is a valid published output that really represents the
state of the mouse button.
Also, why in PlayerApplication and QCRenderer do we need to call
renderAtTime:time :arguments: anyway?
To render a frame when you want one to be rendered
It seems that if we have a timer a certain interval, then why
tell the renderer when to render?
The timer does nothing except calling a callback at certain
intervals. From that callback, you need to render a frame, otherwise
nothing would be on screen.
and if we're rendering at 60 fps, why is the "time" argument in
units of seconds, instead of milliseconds?
The framerate has nothing to do with the chosen time units. In Cocoa
anyway, NSTimeIntervals are expressed in seconds
Also, this time value is relative to the start of the application
I presume, the way PlayerApplication is written?
It's actually relative to the time when the first frame was rendered
- see comments in source code
________________________________________________________
Pierre-Olivier Latour email@hidden
Quartz Composer Team Apple Computer, Inc.