Would it be possible to normalize the input values to a floating point value and scale them on the plugin side? if device a is -10 to 100, and device b is 5 to 10,000, just map the floating point ranges to the device ranges? I know its not ideal..

Another option that I have done in the past with a web -> image plugin, is to alloc a brand new window manually at init, and then have a boolean input port that triggers the window to be made key and ordered front. This allowed me to get around my limitations of the setting info pane not being made available in a QC powered app, and was able to set it and fiddle with it outside of executeAtTime.

So I was able to use traditional cocoa bindings, change views, and all those things, and just used an input port to trigger the window to order in or out.

Perhaps thats an option for you?



On Oct 23, 2009, at 4:11 PM, Milton Aupperle wrote:

Guys;

The big issue that you are all missing is this.

Your all assuming that we know what the range of port values will will be ahead of time.

That is not the case!

A lot of hardware does not behave static. In fact the only way to know what an acceptable range for many inputs is after the device is open and configured.

For example, with IIDC FireWire cameras changing the Format or Mode or Video Type changes the video size, frame rates, the exposure times , what input controls (hues, saturation Red Balance, blue, Hue etc.) are supported, whether it delivers color or monochrome video etc. etc. etc. In fact changing the ROI for Format 7 cameras causes the exposure and frame rate to change for each 1 pixel decrease / increase.

To determine what the input ranges are means we have to open the device, start configuring it and then read the range values back out. The LOGICAL place to do this is in QCPlugin "-init" call, but we can't do that because QCPlugins don't receive a "-dealloc" or "- finalize" call so they can clean up after themselves.

So that leaves the only other place which this can be done is in the execution side of a QCPlugin, which everyone says is the way to go - and i completely disagree for many reasons previously.

But as Troy just pointed out below, we can not do this "addInputPortWithType" from with an execute method, which was the only other place you can do the "open" and "close" of the device. Thanks for pointing this out, because if I had checked this out, then I would have been even more annoyed with QC Plugin limitations.

So you can't even set up the input ports properly to handle a dynamic case because you can't open the device from the non execution side. So we have now a second Catch 22 situation.

The DFG is far simpler to work with than the tens of thousands of IIDC cameras out there that we handle in Astro IIDC and I used in my example , but the above makes setting up even "Static" ports where I know what the device can do simply not going to work.

So inputs are another dead end and I'm fast running out of options here.

Milton J. Aupperle
President
ASC - Aupperle Services and Contracting
Mac Software (Drivers, Components and Application) Specialist
#1106 - 428 Chaparral Ravine View SE.
Calgary Alberta T2X 0N2
1-(403)-453-1624
[email protected]
www.outcastsoft.com


On 23-Oct-09, at 12:29 PM, Troy Koelling wrote:

On Oct 23, 2009, at 11:15 AM, Milton Aupperle wrote:
Yes but -32767 to 32768 is not 0 to 23 or 0 to 4, is it?

Maybe this will help that particular situation?

extern NSString* const QCPortAttributeMinimumValueKey; //For Number ports only extern NSString* const QCPortAttributeMaximumValueKey; //For Index and Number ports only

Used in conjunction with:

/*
Adds an input port of a given type (QCPortType...) and key on the plug-in, and with optional attributes (QCPortAttribute...). This method will throw an exception if called from within an execution method, or if there's already an input or output port with that key.
*/
- (void) addInputPortWithType:(NSString*)type forKey:(NSString*)key withAttributes:(NSDictionary*)attributes;





_______________________________________________
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/doktorp%40mac.com

This email sent to [email protected]

 _______________________________________________
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]

Reply via email to