• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

SDK - A_time and other data types

Engaged ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

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

TOPICS
SDK

Views

600

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 23, 2023 Feb 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.

Votes

Translate

Translate
Participant ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

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;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines