[vlc-devel] [PATCH 1/6] qt: add scale method on VLCTick

Abel Tesfaye abeltesfaye45 at gmail.com
Fri May 31 13:00:52 CEST 2019


From: Abel Tesfaye <Abeltesfaye45 at gmail.com>

---
 modules/gui/qt/util/vlctick.cpp | 5 +++++
 modules/gui/qt/util/vlctick.hpp | 1 +
 2 files changed, 6 insertions(+)

diff --git a/modules/gui/qt/util/vlctick.cpp b/modules/gui/qt/util/vlctick.cpp
index bd0074da54..6cbf6f553a 100644
--- a/modules/gui/qt/util/vlctick.cpp
+++ b/modules/gui/qt/util/vlctick.cpp
@@ -49,3 +49,8 @@ QString VLCTick::toString() const
                 .arg(min, 2, 10, QChar('0'))
                 .arg(sec, 2, 10, QChar('0'));
 }
+
+VLCTick VLCTick::scale(float scalar) const
+{
+    return VLCTick(m_ticks*scalar);
+}
\ No newline at end of file
diff --git a/modules/gui/qt/util/vlctick.hpp b/modules/gui/qt/util/vlctick.hpp
index 19ea5d1db5..e6f8f2b2aa 100644
--- a/modules/gui/qt/util/vlctick.hpp
+++ b/modules/gui/qt/util/vlctick.hpp
@@ -39,6 +39,7 @@ public:
      * @return time as HH:MM:SS
      */
     Q_INVOKABLE QString toString() const;
+    Q_INVOKABLE VLCTick scale(float) const;
 
 private:
     vlc_tick_t m_ticks;
-- 
2.21.0



More information about the vlc-devel mailing list