On Feb 27, 2008, at Feb 27, 2008 | 4:12 PM, Julien Rigal wrote:
Thank you for your reply Marc.
Here is what worked in the end:
[self addInputPortWithType:QCPortTypeIndex forKey:@"inputBlend"
withAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:@"Blending", QCPortAttributeNameKey,
[NSNumber numberWithUnsignedInteger:2],
QCPortAttributeMaximumValueKey,
[NSArray arrayWithObjects:@"Replace", @"Over", @"Add", nil],
QCPortAttributeMenuItemsKey,
nil]];
The thing that was tripping me up was that
QCPortAttributeMaximumValueKey has to be defined. The order of
definition is also important. First QCPortAttributeMaximumValueKey,
then QCPortAttributeMenuItemsKey. Of course the port's type has to
be defined as QCPortTypeIndex, but the documentation is explicit
enough about that. The rest was a bit unclear to me I must say...
Anyway, I filed some feedback about that, so I hope the
documentation will be more explicit in the future.
Wow - good find.
The next problem though, is how do I do this for a predefined port?
The logic of this seems correct, yet it doesn't work for me:
What happens when you try this? Does it compile? Do you get error
messages at run time?
I tried to do this exact same thing and was told that it was not
possible, and that I should file an RFE for the feature (which I have
not yet done). I worked around it by wrapping my plug-in inside a
macro, which allows you to add this feature to the published input.
return [NSDictionary dictionaryWithObjectsAndKeys:QCPortTypeIndex,
QCPortAttributeTypeKey,
@"Blending", QCPortAttributeNameKey,
[NSNumber numberWithUnsignedInteger:2],
QCPortAttributeMaximumValueKey,
[NSArray arrayWithObjects:@"Replace", @"Over", @"Add", nil],
QCPortAttributeMenuItemsKey,
nil];
Can anyone out there clear this up?
Thanks
On 25 Feb 2008, at 12:23, Marc Epard wrote:
I've only used it in attributesForPropertyPortWithKey for
predefined ports, but it works. Try adding min and max and maybe
default keys:
[NSNumber numberWithUnsignedInteger:0],
QCPortAttributeDefaultValueKey,
[NSNumber numberWithUnsignedInteger:0],
QCPortAttributeMinimumValueKey,
[NSNumber numberWithUnsignedInteger:count-1],
QCPortAttributeMaximumValueKey,
-Marc
On Feb 25, 2008, at 3:25 AM, Julien Rigal wrote:
Hello once again,
Sorry to post such a newbie question, but how do I use
QCPortAttributeMenuItemsKey to add a list of menu items to a
port. I tried this, but it doesn't work, QC raises an exception.
[self addInputPortWithType:QCPortTypeIndex forKey:@"inputBlend"
withAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:@"Blending", QCPortAttributeNameKey,
[NSArray arrayWithObjects:@"Replace", @"Over", @"Add", nil],
QCPortAttributeMenuItemsKey,
nil]];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]