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
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.
Copy link to clipboard
Copied
Here is some code that might help. It's written in Objective C. Enjoy!
+ (A_Time) timeFromSecondsš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_FpLong) framerateFromCompšAEGP_CompH)comp {
A_FpLong framerate = 0;
if (comp) {
AEGP_SuiteHandler suites([self basicSuite]);
suites.CompSuite10()->AEGP_GetCompFramerate(comp, &framerate);
}
return framerate;
}
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! š
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.
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.
Copy link to clipboard
Copied
Of course. Yes, that will do it. Thanks.
Copy link to clipboard
Copied
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