Re: FCP X: perform selector after delay
Re: FCP X: perform selector after delay
- Subject: Re: FCP X: perform selector after delay
- From: Paul Schneider <email@hidden>
- Date: Fri, 14 Oct 2011 15:16:39 -0700
Hi Eberhard,
Delayed operations like this will typically only work on threads that have an associated run loop. Typically only the main thread has a run loop.
If you are being called from a non-main thread (like a render thread), and you want to schedule some work to be done later on the main thread, then -performSelectorOnMainThread is probably what you want.
If you are being called from a non-main thread (like a render thread), and you want to schedule some work to be done later on the non-main thread, that is more problematic. For one thing, the render thread is probably not expecting you to add additional work. For another, with GCD, the thread may be deleted or re-used after the current work unit is finished. I wouldn't recommend trying to do this.
Keep in mind that in a multithreaded application, it's important to synchronize access to shared data like parameter values, etc. The host app might not be prepared for your plugin to run at an arbitrary time. So scheduling work to be performed "later" on the main thread may lead to unpredictable problems.
What exactly are you trying to do?
- Paul
On Oct 14, 2011, at 6:10 AM, Eberhard Ammelt wrote:
> Hello,
>
> I want a selector of an FxPlug effect to be performed after a delay in FCP X and have tried
>
> - (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;
> and
> + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;
>
> but it seems both methods don't work on the same thread where the effect's methods are called.
>
> Is this only possible on a separate thread, or is there another solution?
>
> Thanks,
> Eberhard _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Pro-apps-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden