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 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: http://developer.apple.com/technotes/tn2005/tn2146.html

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



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.