[vlc-devel] [PATCH 05/21] qt: add ms convenient properties for VLCTick based properties in PlayerController
Prince Gupta
guptaprince8832 at gmail.com
Fri Oct 23 15:20:59 CEST 2020
---
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 3f62071525..188a35abfc 100644
--- a/modules/gui/qt/player/player_controller.cpp
+++ b/modules/gui/qt/player/player_controller.cpp
@@ -1248,6 +1248,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 );
--
2.25.1
More information about the vlc-devel
mailing list