On Nov 12, 2007, at 9:18 AM, Benjamin Kent wrote: My plug-in requires an animatable bool parameter (representing the validity of a frame at given time). So a user will set a single frame X as invalid, but all other frames should still be valid. This action really requires setting a value of false at frame X and a value of true at X-1 and X+1 all in one go (otherwise when setting a value of false at X, all other frame values would also be set to false).
On other hosts this is either done with a pushbutton which sets the three key frames on an animatable bool or an animatable integer parameter, but as it isn't possible for a plug-in to create keyframes on a parameter in FCP, this was a way around it (using an internal data structure to store the key frame information and a pushbutton check box to display the boolean value at a given frame to the user).
I'm sorry, I still don't understand the interaction you're describing. This all sounds very bizarre to me.
But to answer your original question, about redrawing your button, here's one method that I can think of. (I don't think this would be the ideal solution, though.)
You could set up an NSTimer to call back into your plugin periodically. In your timer callback, you could call -startAction:, followed by -currentTime: to check if the current time is the same time as the last time you redrew your UI. If it's not, then you could call -setNeedsDisplay: on your button, and the OS will tell it to redraw. Then, of course, call -endAction. In your -drawRect: method, get the current time and save it for the next time your callback gets called.
It sounds like what you really want, though, is a way to set keyframes on check boxes. You're not the only person who wants that, so it's possible we might add that functionality in the future. (That's not a guarantee, though! :) ) I'm still not getting why you need to set keyframes on the previous and next frame, though. It doesn't sound like something a typical user would understand, either.
Would it be better to have your own timeline in your custom control? (Again, not a perfect solution, but a workable one.) Then you could have it do anything you wanted with keyframes, and it would at least be familiar to users what was happening.
Darrin
|