[vlc-devel] [PATCH 01/21] qt: provide validity attribute on VLCTicks for QML
Pierre Lamot
pierre at videolabs.io
Wed Aug 7 15:52:07 CEST 2019
---
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
--
2.17.1
More information about the vlc-devel
mailing list