PDA

View Full Version : One Quartz Composer composition, multiple views




Sijmen
Nov 8, 2007, 03:08 AM
Short version:

How to have 1 quartz composition output to multiple views?

Long version:

Has to be compatible with Tiger. I've tried several methods.

Simply multiple QCViews. I'm not sure how these would be kept in sync, as they really would be indipendent renderers.
One QCPatchController, multiple QCViews. Seems to be impossible as I can only create a 1-1 binding for 'patch'.
Multiple QCPatchControllers, multiple QCViews. Problem here is again keeping them in sync, and it seems QCPatchController isn't available programatically. (No public API, no header files.)
Multiple QCRenderers. Here I can have control over the sync, but I don't really know how to set inputs and read ouputs. Is that even possible at all?

It appears the last option is the best, only if I knew how to set inputs..

Any ideas?
Thanks :)



samsoffes
May 26, 2009, 08:17 PM
From what I have found, it is not possible to bind multiple QCViews to the same QCPatchController.

You can access the patch controller programatically though. I just create an outlet for it and then do something like

[self setValue:someObject forKeyPath:@"patchController.patch.myOutletName.value"];

patchController being what I named the property that has the IBOutlet to my QCPathController and myOutletName being the name of the outlet (the trailing .value is required).

Hope that helps.

Oh, by the way, you can output the same composition in multiple views using QCRenderers. There is no way to sync them or share data between them built in. You have to create all of that functionality. Not a good solution, but it does work. One of my older apps that does this.

I would recommend pursuing bindings and and object that manages a patch controller for each QCView you want to use or something like that.