Re: Retrieving plug-in parameters in custom view in FxPlug 4
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com
On May 18, 2020, at 6:17 PM, Sergey via Pro-apps-dev <pro-apps-dev@lists.apple.com> wrote:
Thank you for the reply, Darrin. Please find my comments inline.
On 19/05/2020 2:32 am, Darrin Cardani wrote:
Sergey,
Answers inline below:
On May 17, 2020, at 7:09 PM, Sergey via Pro-apps-dev <pro-apps-dev@lists.apple.com> wrote:
Good day pro-apps-dev,
We are in the process of porting our plug-in onto FxPlug 4 (right now we are still on v2.x) and we struggle with making the basic things work via XPC.
Our plug-in has its own custom UI based on Qt which is triggered by a Push Button. I am following the FxSimpleColorCorrector example and have been able to create a custom view (just a regular rectangular NSView with a child NSButton; should you ask, I cannot use addPushButtonWithName for the purpose as its selector is handled in the background thread which is not suitable for UI tasks, its visual representation is not perfect either) You can always use -performSelectorOnMainThread: or dispatch_async(dispatch_get_main_queue(), …) to do things on the main UI thread. I've considered this option and it seems to work. Except that FxParameterRetrievalAPI_v6 is not available in the context of the main thread either. (I've checked and it is actually accessible from the button selector in the BG thread, so can be used from there). Is there an API to change/remove the duplicated text though?
Where are you seeing the duplicated text? Do you mean the button name being the same as the parameter name? If so, there’s no way to change that. Darrin
Now obviously, our custom dialog must be pre-filled with current values of the custom parameters. However the FxParameterRetrievalAPI_v6 seems to be inaccessible in the handler selector of the push button. The _apiManager apiForProtocol returns nil no matter what.
Funny enough, in the FxSimpleColorCorrector example the FxParameterRetrievalAPI_v6 is accessible inside drawRect selector, but not accessible inside mouseDown (which is similar to my situation).
Is there a reason why the interface is inaccessible in some selectors, but accessible in others? Can you suggest any solution/workaround? In general we have to be careful to keep data exchange between the host and the plug-in to a minimum to keep performance tolerable for users. So rather than allowing all selectors to be used during every plug-in call, we now have to be very selective and find creative ways to cache data on the plug-in, while still being careful to keep it up-to-date. It’s can be difficult to get right sometimes. One option right now would be to cache the data yourself for use later on. Since you get called to generate the custom data, you know every time it gets changed.
Understood. I'll try to proceed with the caching option for now. May I ask you to have a look at another thread that I've started ("Accessing and displaying frames in custom view in FxPlug 4") - that seem to be a major blocker for us.
That said, please file a feedback issue and we’ll look into it.
Darrin
Best regards,
Sergey
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com
This email sent to dcardani@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com <mailto:Pro-apps-dev@lists.apple.com>) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com <https://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com>
This email sent to dcardani@apple.com <mailto:dcardani@apple.com>
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Darrin Cardani via Pro-apps-dev