[vlc-commits] qt: add ms convenient properties for VLCTick based properties in PlayerController

Prince Gupta git at videolan.org
Fri Nov 6 16:00:37 CET 2020


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Wed Sep 30 22:05:27 2020 +0530| [149ac9f661f09eca0a7da5d48bda48069702c6ce] | committer: Pierre Lamot

qt: add ms convenient properties for VLCTick based properties in PlayerController

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=149ac9f661f09eca0a7da5d48bda48069702c6ce
---

 modules/gui/qt/player/player_controller.cpp | 30 +++++++++++++++++++++++++++++
 modules/gui/qt/player/player_controller.hpp |  9 +++++++++
 2 files changed, 39 insertions(+)

diff --git a/modules/gui/qt/player/player_controller.cpp b/modules/gui/qt/player/player_controller.cpp
index 597ff1cdf3..fabb32bb0d 100644
--- a/modules/gui/qt/player/player_controller.cpp
+++ b/modules/gui/qt/player/player_controller.cpp
@@ -1245,6 +1245,36 @@ void PlayerController::setSecondarySubtitleDelay(VLCTick delay)
                                 delay, VLC_PLAYER_WHENCE_ABSOLUTE);
 }
 
+int PlayerController::getAudioDelayMS() const
+{
+    return MS_FROM_VLC_TICK( getAudioDelay() );
+}
+
+void PlayerController::setAudioDelayMS(int ms)
+{
+    setAudioDelay( VLC_TICK_FROM_MS(ms) );
+}
+
+int PlayerController::getSubtitleDelayMS() const
+{
+    return MS_FROM_VLC_TICK( getSubtitleDelay() );
+}
+
+void PlayerController::setSubtitleDelayMS(int ms)
+{
+    setSubtitleDelay( VLC_TICK_FROM_MS(ms) );
+}
+
+int PlayerController::getSecondarySubtitleDelayMS() const
+{
+    return MS_FROM_VLC_TICK( getSecondarySubtitleDelay() );
+}
+
+void PlayerController::setSecondarySubtitleDelayMS(int ms)
+{
+    setSecondarySubtitleDelay( VLC_TICK_FROM_MS(ms) );
+}
+
 void PlayerController::setSubtitleFPS(float fps)
 {
     Q_D(PlayerController);
diff --git a/modules/gui/qt/player/player_controller.hpp b/modules/gui/qt/player/player_controller.hpp
index 99c0f0f296..cfdc9e8a1f 100644
--- a/modules/gui/qt/player/player_controller.hpp
+++ b/modules/gui/qt/player/player_controller.hpp
@@ -135,6 +135,9 @@ public:
     Q_PROPERTY(VLCTick audioDelay READ getAudioDelay WRITE setAudioDelay NOTIFY audioDelayChanged)
     Q_PROPERTY(VLCTick subtitleDelay READ getSubtitleDelay WRITE setSubtitleDelay NOTIFY subtitleDelayChanged)
     Q_PROPERTY(VLCTick secondarySubtitleDelay READ getSecondarySubtitleDelay WRITE setSecondarySubtitleDelay NOTIFY secondarySubtitleDelayChanged)
+    Q_PROPERTY(int audioDelayMS READ getAudioDelayMS WRITE setAudioDelayMS NOTIFY audioDelayChanged)
+    Q_PROPERTY(int subtitleDelayMS READ getSubtitleDelayMS WRITE setSubtitleDelayMS NOTIFY subtitleDelayChanged)
+    Q_PROPERTY(int secondarySubtitleDelayMS READ getSecondarySubtitleDelayMS WRITE setSecondarySubtitleDelayMS NOTIFY secondarySubtitleDelayChanged)
     Q_PROPERTY(float subtitleFPS READ getSubtitleFPS WRITE setSubtitleFPS NOTIFY subtitleFPSChanged)
 
     //title/chapters/menu
@@ -289,6 +292,12 @@ public slots:
     VLCTick getSecondarySubtitleDelay() const;
     void setSubtitleDelay( VLCTick );
     void setSecondarySubtitleDelay( VLCTick );
+    int getAudioDelayMS() const;
+    void setAudioDelayMS( int );
+    int getSubtitleDelayMS() const;
+    void setSubtitleDelayMS( int );
+    int getSecondarySubtitleDelayMS() const;
+    void setSecondarySubtitleDelayMS( int );
     float getSubtitleFPS( ) const;
     void setSubtitleFPS( float );
 



More information about the vlc-commits mailing list