(VectorAnimationRenderer) Add GetFrameRate method 25/200525/4
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 26 Feb 2019 07:31:30 +0000 (16:31 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 8 Mar 2019 02:14:32 +0000 (02:14 +0000)
Change-Id: I48e45c17dc98c8f5e6e69e9b9a2a65be36b2b589

dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
dali/devel-api/adaptor-framework/vector-animation-renderer.cpp
dali/devel-api/adaptor-framework/vector-animation-renderer.h
dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp
dali/internal/vector-animation/common/vector-animation-renderer-impl.h
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h

index 61544ca..b371733 100644 (file)
@@ -86,11 +86,18 @@ public:
   virtual void Render( uint32_t frameNumber ) = 0;
 
   /**
-   * @brief Gets the total number of frames of the file
+   * @brief Gets the total number of frames of the file.
    *
    * @return The total number of frames
    */
-  virtual uint32_t GetTotalFrameNumber() = 0;
+  virtual uint32_t GetTotalFrameNumber() const = 0;
+
+  /**
+   * @brief Gets the frame rate of the file.
+   *
+   * @return The frame rate of the file
+   */
+  virtual float GetFrameRate() const = 0;
 
   /**
    * @brief Function pointer called in adaptor to create a plugin instance.
index b1b9e74..c02bc16 100755 (executable)
@@ -84,9 +84,14 @@ void VectorAnimationRenderer::Render( uint32_t frameNumber )
   GetImplementation( *this ).Render( frameNumber );
 }
 
-uint32_t VectorAnimationRenderer::GetTotalFrameNumber()
+uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
 {
   return GetImplementation( *this ).GetTotalFrameNumber();
 }
 
+float VectorAnimationRenderer::GetFrameRate() const
+{
+  return GetImplementation( *this ).GetFrameRate();
+}
+
 } // namespace Dali
index 64603a5..f7faf21 100755 (executable)
@@ -120,7 +120,14 @@ public:
    *
    * @return The total number of frames
    */
-  uint32_t GetTotalFrameNumber();
+  uint32_t GetTotalFrameNumber() const;
+
+  /**
+   * @brief Gets the frame rate of the file.
+   *
+   * @return The frame rate of the file
+   */
+  float GetFrameRate() const;
 
 public: // Signals
 
index de8140d..0ff6586 100644 (file)
@@ -90,11 +90,16 @@ void VectorAnimationRenderer::Render( uint32_t frameNumber )
   mPlugin.Render( frameNumber );
 }
 
-uint32_t VectorAnimationRenderer::GetTotalFrameNumber()
+uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
 {
   return mPlugin.GetTotalFrameNumber();
 }
 
+float VectorAnimationRenderer::GetFrameRate() const
+{
+  return mPlugin.GetFrameRate();
+}
+
 } // namespace Adaptor
 
 } // namespace internal
index a21cf7f..d3e53b4 100755 (executable)
@@ -84,7 +84,12 @@ public:
   /**
    * @copydoc Dali::VectorAnimationRenderer::GetTotalFrameNumber()
    */
-  uint32_t GetTotalFrameNumber();
+  uint32_t GetTotalFrameNumber() const;
+
+  /**
+   * @copydoc Dali::VectorAnimationRenderer::GetFrameRate()
+   */
+  float GetFrameRate() const;
 
 private:
 
index 2860f42..6217e1d 100644 (file)
@@ -149,7 +149,7 @@ void VectorAnimationRendererPluginProxy::Render( uint32_t frameNumber )
   }
 }
 
-uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber()
+uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber() const
 {
   if( mPlugin )
   {
@@ -158,6 +158,15 @@ uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber()
   return 0;
 }
 
+float VectorAnimationRendererPluginProxy::GetFrameRate() const
+{
+  if( mPlugin )
+  {
+    return mPlugin->GetFrameRate();
+  }
+  return 0.0f;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index fe2f636..30e0da3 100644 (file)
@@ -80,7 +80,12 @@ public:
   /**
    * @copydoc Dali::VectorAnimationRendererPlugin::GetTotalFrameNumber()
    */
-  uint32_t GetTotalFrameNumber();
+  uint32_t GetTotalFrameNumber() const;
+
+  /**
+   * @copydoc Dali::VectorAnimationRendererPlugin::GetFrameRate()
+   */
+  float GetFrameRate() const;
 
   // Not copyable or movable
   VectorAnimationRendererPluginProxy( const VectorAnimationRendererPluginProxy& ) = delete; ///< Deleted copy constructor