lottie/example: add APIs in lottieview to get frame rate and total frame number 55/187355/2
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 22 Aug 2018 07:24:26 +0000 (16:24 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Thu, 23 Aug 2018 00:34:57 +0000 (00:34 +0000)
Change-Id: I25d14d37776cd6bf07bcba1f0fc6a1c88e66dd71

example/lottieview.cpp
example/lottieview.h

index f52b7f8..79ce8fb 100644 (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)
index 032cbd0..e3e02d5 100644 (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;
 };