Skip to main content
Inspiring
December 28, 2021
Answered

How to read out time slider position from c++ plugin. Take 2

  • December 28, 2021
  • 1 reply
  • 1760 views

Dear AE fellows,

most of us know that method

in_data ->current_time

 nicely reads out the position of a time slider.

Now the issue. My plugin has  its own win32 window (on top of AE main window) as part of its UI.

A lot of  the functionality of the plugin takes place inside this win32 window.

This win32 window needs the position of the time slider at each moment of the plugin usage. The question is: how can I pass this value to it.

The point is, if I don't change the parameters of my plugin (and I don't), no messages in the EffectMain (like PF_Cmd_RENDER, PF_Cmd_USER_CHANGED_PARAM and so on) are triggered. 

So in_data->current_time never gets updated(!)

Is it at all possible?

 

 

 

 

 

This topic has been closed for replies.
Correct answer shachar carmi

Thanks, for an advice Sachar!

Actually, what I'm trying to implement is the synchronous play of animation in my win32 window and in AE (or Ppro) window. That is needed for the designer preview function.

I sometimes think of  creating a .txt file with the time and update it every 10th of a second and then my win32 window will read the data from the file every 10th of a second and that's it.

Do you think it could be a viable solution? (Here we need to keep in mind that such a synchonization will be switched on by the user just from time to time)


i'd probably go with some shared memory with a mutex instead of a file.

but anyways, idle hook on the plug-in side and a timer on the window side would be the way to go. (imho)

1 reply

Community Expert
December 29, 2021

AEGP_GetItemCurrentTime

Inspiring
December 29, 2021

Thank you, Shachar,

I wrote a simple function:

A_long time_ae(PF_InData * in_data)
{
	AEGP_SuiteHandler suites(in_data->pica_basicP);
	A_Time time;
	AEGP_ItemH myitem;
	suites.ItemSuite8()->AEGP_GetActiveItem(&myitem);
	suites.ItemSuite8()->AEGP_GetItemCurrentTime(myitem, &time);
	return time.value;
}

 However it produces access violation error when hitting  suites.ItemSuite8()->AEGP_GetActiveItem(&myitem); line. Do you know what could be the reason for that?

Community Expert
January 3, 2022

i checked on my end as well, and i see the same behavior. i also tried using javascript's "app.project.activeItem.time" but it also updates only on  mouse up.

i currently can't think of  way to get the comp's time that might update during a drag over a cached area.


hmmm...

i think a custom comp UI would receive idle and draw calls with the current time stamp even when scrubbing over cached frames. but that would only work if your plug-in is selected, and is the ONLY ONE selected.