Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QCRenderer and getting the OutputPort values



Thanks, I actually got my QCView code working with the input & output ports working (the problem was I didn't have the patch and value prefix and postfix).  However, for my QCRenderer implementation it doesn't work.  I do know that my composition works, but this is what I get.

2006-01-23 13:13:24.562 uic[1582] Exception raised during posting of notification.  Ignored.  exception: [<QCRenderer 0x33d1f0> addObserver:<Screen 0x32d2d0> forKeyPath:@"patch.imageClickA.value" options:0x0 context:0x0] was sent to an object that is not KVC-compliant for the "imageClickA" property.

The only "addObserver" that doesn't give the exception is when I pass the "imageClickA" as the path in the "forKeyPath" argument. (do I need a QCPatchController somewhere?)  Still the value never changes though.
NSLog(@"Value of ImageClick:%@",[renderer valueForOutputKey:@"imageClickA"]);
Any ideas?

Also, another dumb question: the return of valueForOutputKey is "id", can I just cast that to a BOOL? or do I have to use NSNumber or NSValue ?

Thanks for your help,
Kevin.



On Jan 23, 2006, at 12:29 PM, Pierre-Olivier Latour wrote:

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.

The key path is not correct, see end of:

- (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.





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden

References: 
 >QCRenderer and getting the OutputPort values (From: Kevin Kicklighter <email@hidden>)
 >Re: QCRenderer and getting the OutputPort values (From: Pierre-Olivier Latour <email@hidden>)
 >Re: QCRenderer and getting the OutputPort values (From: Kevin Kicklighter <email@hidden>)
 >Re: QCRenderer and getting the OutputPort values (From: Pierre-Olivier Latour <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.