[vlc-commits] qt: provide validity attribute on VLCTicks for QML
Pierre Lamot
git at videolan.org
Thu Aug 29 10:44:38 CEST 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Aug 5 11:04:12 2019 +0200| [f56250703a0fecc2d6d54d77fc331d4889178549] | committer: Jean-Baptiste Kempf
qt: provide validity attribute on VLCTicks for QML
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f56250703a0fecc2d6d54d77fc331d4889178549
---
modules/gui/qt/util/vlctick.cpp | 7 ++++++-
modules/gui/qt/util/vlctick.hpp | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/util/vlctick.cpp b/modules/gui/qt/util/vlctick.cpp
index 6cbf6f553a..68f650d012 100644
--- a/modules/gui/qt/util/vlctick.cpp
+++ b/modules/gui/qt/util/vlctick.cpp
@@ -33,6 +33,11 @@ VLCTick::operator vlc_tick_t() const
return m_ticks;
}
+bool VLCTick::valid() const
+{
+ return m_ticks != VLC_TICK_INVALID;
+}
+
QString VLCTick::toString() const
{
int64_t t_sec = SEC_FROM_VLC_TICK(m_ticks);
@@ -53,4 +58,4 @@ QString VLCTick::toString() const
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 e6f8f2b2aa..bcaa899945 100644
--- a/modules/gui/qt/util/vlctick.hpp
+++ b/modules/gui/qt/util/vlctick.hpp
@@ -34,6 +34,9 @@ public:
VLCTick(vlc_tick_t ticks);
operator vlc_tick_t() const;
+
+ Q_INVOKABLE bool valid() const;
+
/**
* @brief toString
* @return time as HH:MM:SS
More information about the vlc-commits
mailing list