Virtual input and output

Pyroh's picture

I'm trying to code custom patches for Quartz Composer. I think I may have understand how it works (I'm new to Obj-C but I know programmation basis and used several programming language such as C or C#).

It remains one problem : for the 1st patch I'm trying to code I need 2 inputs and 1 output, one of the input is a BOOL, the remaining input and the output must be virtual. The patch is intended to emit the input value to the output if the BOOL input is set to true. So I made this in the .h file:

@property BOOL inputEmit;
@property (assign) id inputValue;
@property (assign) id outputValue;

Of course I tried to put this in the .m file :

@dynamic inputValue, outputValue;
/* Or */
@synthesise inputValue, outputValue;

Compilation works with few warnings complaining about inputEmit. When I test the patch in QC there's only inputEmit which is available, inputValue and outputValue simply disappeared.

Obviously I'm doing it wrong. What did I miss ? I also tried NSObject instead of id for the datatype but it doesn't work...

Every help will be much appreciated :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

smokris's picture
Re: Virtual input and output

AFAIK it's not possible to define virtual ports with the official (QCPlugIn) API --- you must use the private (QCPatch) API to do that.

gtoledo3's picture
Re: Virtual input and output

Why does it need to be virtual? Anything will be able to attach to the node anyway... so if it's boolean, it would be constructive to just make it a boolean.

Pyroh's picture
Re: Virtual input and output

@smokris : Thanks for the advice. I took a look to what seams to be called "skanky SDK" but I can't find any documentation or misc. informations. I guess this is what you have to expect with private API but perhaps someone made a little guide or someone could tell me where to find information (header, mailing list, etc..). By the way, thanks for answering ;)

@gtoledo3 : One input is set to boolean type cause it needs to, the other one must accept any type of data. Why ? Cause the patch is intended to be some sort of trigger : one input for value (any type) which will be forwarded to output if BOOL input is set to TRUE or else output is set to NULL. I guess NULL will be trans-typed when attached to a node (if not that will mean more work for me, good thing considering the training goal of the project).

franz's picture
Re: Virtual input and output

You can use a structure input to encapsulate any kind of QCobject. That's the workaround I ended up using.

fsk's picture
Re: Virtual input and output

Quote:
one input for value (any type) which will be forwarded to output if BOOL input is set to TRUE or else output is set to NULL.

isnt this the same as using a virtual multiplexer with the first input unconnected and feeding the boolean to the index input?