I've have a composition with published input and output ports
defined, that worked when I used a QCView to render it, and had the
addObserver: forKeyPath: working, so that whenever an outputPort
changed I would get my callback.
My problem is that my application needs to have many windows of
renderers that come and go, but the docs say the QCView can only be
instantiated through the IB.
You can definitely create a QCView programmatically. Just make sure
you have it render only when its owner window is on screen,
otherwise, things might not work correctly.
I even tried having my own windows with the QCViews and could
never get it to work. I then migrated to using the QCRenderer
class and the PlayerApplication as a base. I've got my
compositions rendering, but I can't see how to get the output
values to my app. (I have subclasses the NSApplication and am
forwarding events)
From what I understand I don't need to do the addObserver:
forKeyPath:. There's a point in the QC Programming manual that
says in the renderWithEvent (from PlayerApplication) that I should
just call the valueForOutputKey for my key. I've done this and it
does not work. In the QCView I use "patch.foo.Value" whereas here
I just use "foo". Any ideas?
The QCRenderer does not render the composition automatically, you
have to explicitly call -renderAtTime:arguments: to render a frame,
then you can call valueForOutputKey: to retrieve output values of the
compositions.
Also, I'm going to have many, many outputs, so I don't want to go
through them all and see if they are different than the previous
values. What is the best way to do this? can I still add the
"addObserver: forKeyPath:" ??
Yes, that works as well for the QCRenderer
________________________________________________________
Pierre-Olivier Latour email@hidden
Quartz Composer Team Apple Computer, Inc.