lottie/example: add APIs in lottieview to get frame rate and total frame number

Change-Id: I25d14d37776cd6bf07bcba1f0fc6a1c88e66dd71
This commit is contained in:
Jaeun Choi
2018-08-22 16:24:26 +09:00
committed by Subhransu Mohanty
parent 318151a35d
commit 02e660cff7
2 changed files with 6 additions and 0 deletions

View File

@@ -194,6 +194,8 @@ void LottieView::render()
void LottieView::setFilePath(const char *filePath)
{
mPlayer->setFilePath(filePath);
mFrameRate = mPlayer->getFrameRate();
mTotalFrame = mPlayer->getTotalFrame();
}
void LottieView::setSize(int w, int h)

View File

@@ -35,6 +35,8 @@ public:
void setSpeed(float speed) { mSpeed = speed;}
void setRepeatCount(int count);
void setRepeatMode(LottieView::RepeatMode mode);
float getFrameRate() const { return mFrameRate; }
long getTotalFrame() const { return mTotalFrame; }
public:
void seek(float pos);
void finished();
@@ -66,6 +68,8 @@ public:
bool mAsyncRender;
bool mDirty;
float mPendingPos;
float mFrameRate;
long mTotalFrame;
std::future<bool> mRenderTask;
LOTBuffer mBuffer;
};