Skip to main content
Inspiring
February 23, 2023
Answered

SDK - A_time and other data types

  • February 23, 2023
  • 4 replies
  • 1179 views

Hi

 

I'm having some problems understanding the data types in the SDK. Like A_time, A_FpLong etc. I can't see a description of them in the reference. Is there anywhere I can find a list and documentation on them?

 

In my specific case, which is simply some tests, I am trying to convert the result of  AEGP_GetItemCurrentTime to a A_FpLong value holding it's current time in seconds. I do this, but get an error: "no operator "[]" matches these operands".

 

ERR(suites.ItemSuite6()->AEGP_GetItemCurrentTime(itemH, &currT));
A_FpLong currentTime = &currT[0] / &currT[1];

 

 

Any help is much appreciated.

- Jakob

 

Update: So right after posting I found the answer for my second question. I can do this:

ERR(suites.ItemSuite6()->AEGP_GetItemCurrentTime(itemH, &currT));
A_FpLong currentTime = currT.value / currT.scale;

But I'm still not sure how i could have read that out of the reference. This one should be updated, right? https://ae-plugins.docsforadobe.dev/index.html

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

is see you resolved your specific issue but generally speaking most AE  SDK types are not documented in the pdf, so it's always a good idea to look at the headers. if you right click any AE type and select "go to definition" you'll jump to the header where the type is defined. for example, you'll see Pf_fp_long and defined a s a double.

4 replies

Community Manager
February 24, 2023

Hi @Jakob Wagner 2048,

 

Note that A_Time values are rationals and thus do not map exactly into floating point so you may end up with off-by-one frame issues depending on how the floating point time values are used. If you need precision then I suggest doing your time operations directly with rationals.

 

Cheers,

Jason

shachar carmiCommunity ExpertCorrect answer
Community Expert
February 23, 2023

is see you resolved your specific issue but generally speaking most AE  SDK types are not documented in the pdf, so it's always a good idea to look at the headers. if you right click any AE type and select "go to definition" you'll jump to the header where the type is defined. for example, you'll see Pf_fp_long and defined a s a double.

Inspiring
February 23, 2023

Of course. Yes, that will do it. Thanks.

Inspiring
February 23, 2023

Ha! Well it turned some of my parenthesis into sad faces in the previous post, but you get the idea!  🙂

Inspiring
February 23, 2023

Haha! Sometimes I want to put sad faces all over my code as well. LOL. Thanks.

Still interested in some documentation for the data types though.

Inspiring
February 23, 2023

Here is some code that might help. It's written in Objective C. Enjoy!

 

+ (A_TimetimeFromSeconds😞CFTimeInterval)seconds {

     AEGP_CompH comp = [self activeComposition];

     A_FpLong framerate = [self framerateFromComp:comp];

     A_FpLong timescale = framerate * 100;

     A_Time time = {seconds * timescale, timescale};

     return time;

}

 

+ (A_FpLongframerateFromComp😞AEGP_CompH)comp {

     A_FpLong framerate = 0;

 

     if (comp) {

          AEGP_SuiteHandler suites([self basicSuite]);

          suites.CompSuite10()->AEGP_GetCompFramerate(comp, &framerate);

     }

 

     return framerate;

}