QCrenderer : hybrid use

franz's picture

Hi, is it possible to link a QCpatchcontroller to a QCrenderer (instead of a QCview)?

.lov.'s picture
Re: QCrenderer : hybrid use

i don't think so. Why you want to do this? Attach the QCRenderer (by code) to an NSOpenGLView or a Custom(GL)view.

vade's picture
Re: QCrenderer : hybrid use

Honestly i've never had to use the QCPatchContoller to get bindings to work. QCPatchController is really opaque and not helpful in many ways.

I'd say use a QCCompositionParameterView and just bind to the renderer directly. Its not bad, and it works.

franz's picture
Re: QCrenderer : hybrid use

mmm , i just found the QCpatchcontroller to be pretty handy for binding through InterfaceBuilder> Maybe i just need to be more confident with code bindings >>>

1 point for QCPatchcontroller : the qc patch is "baked" inside, thus not apparent directly into the bundle.

How would you "hide" the QTZ when using a QCrenderer ?

vade's picture
Re: QCrenderer : hybrid use

i have no idea what you mean. Can you be specific in your setup and what you want to do?

franz's picture
Re: QCrenderer : hybrid use

when binding a QTZ to a QCrenderer, the QTZ has to be present in the bundle (or somewhere on the disk). Hence inspecting the final app's package content will lead you to the original QTZ - which, sometimes -and for obvious reasons - is not what you want. Using a QCPatchController with conjunction to a QCViews, allows to "hide" the original QTZ into the NIB file.

psonice's picture
Re: QCrenderer : hybrid use

You can get around that very easily, using [QCComposition compositionWithData:(the data from the .qtz file)]. The .qtz can be embedded in the code this way, or you can encrypt it or whatever.

franz's picture
Re: QCrenderer : hybrid use

i guess i'll have to encrypt then

cwright's picture
Re: QCrenderer : hybrid use

Not to mention that embedding a qtz in a plist (or nib, which is essentially the same) is trivial to extract. Encrypted compositions are more difficult to extract because it has to be done at runtime (still possible via a debugger, but much more difficult to do overall)

cwright's picture
Re: QCrenderer : hybrid use

Not sure if this'll actually work or not, but:

-(void)[QCPatchController setPatch:(QCPatch*)thePatch];

can be used to set the patch.

-(QCPatch*)[QCRenderer patch];

can be used to get a QCRenderer's patch (the root macro patch).

So, given a QCRenderer qcr and a QCPatchController qcp, you might be able to set the patch with the following:

[qcp setPatch:[qcr patch]];

franz's picture
Re: QCrenderer : hybrid use

thanks for the tip ;)