[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: use correct type for position in PlayerController

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri May 17 08:58:07 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
022afa25 by Fatih Uzunoglu at 2024-05-17T08:38:36+00:00
qt: use correct type for position in PlayerController

- - - - -
240cfdbd by Fatih Uzunoglu at 2024-05-17T08:38:36+00:00
qt: do not update position if it is the same

- - - - -


2 changed files:

- modules/gui/qt/player/player_controller.cpp
- modules/gui/qt/player/player_controller.hpp


Changes:

=====================================
modules/gui/qt/player/player_controller.cpp
=====================================
@@ -1248,9 +1248,12 @@ void PlayerController::setTime(VLCTick new_time)
     vlc_player_SetTime( d->m_player, new_time );
 }
 
-void PlayerController::setPosition(float position)
+void PlayerController::setPosition(double position)
 {
     Q_D(PlayerController);
+    if (qFuzzyCompare(d->m_position, position))
+        return;
+
     vlc_player_locker lock{ d->m_player };
     if( !isCurrentItemSynced() )
         return;
@@ -1289,7 +1292,7 @@ void PlayerController::jumpToTime(VLCTick i_time)
     vlc_player_JumpTime( d->m_player, i_time );
 }
 
-void PlayerController::jumpToPos( float new_pos )
+void PlayerController::jumpToPos( double new_pos )
 {
     Q_D(PlayerController);
     {
@@ -2061,7 +2064,7 @@ PRIMITIVETYPE_GETTER(PlayerController::PlayingState, getPlayingState, m_playing_
 PRIMITIVETYPE_GETTER(QString, getName, m_name)
 PRIMITIVETYPE_GETTER(VLCTick, getTime, m_time)
 PRIMITIVETYPE_GETTER(VLCTick, getRemainingTime, m_remainingTime)
-PRIMITIVETYPE_GETTER(float, getPosition, m_position)
+PRIMITIVETYPE_GETTER(double, getPosition, m_position)
 PRIMITIVETYPE_GETTER(VLCTick, getLength, m_length)
 PRIMITIVETYPE_GETTER(VLCTick, getAudioDelay, m_audioDelay)
 PRIMITIVETYPE_GETTER(VLCTick, getSubtitleDelay, m_subtitleDelay)


=====================================
modules/gui/qt/player/player_controller.hpp
=====================================
@@ -113,7 +113,7 @@ public:
 
     Q_PROPERTY(VLCTick time READ getTime WRITE setTime NOTIFY timeChanged FINAL)
     Q_PROPERTY(VLCTick remainingTime READ getRemainingTime NOTIFY remainingTimeChanged FINAL)
-    Q_PROPERTY(float position READ getPosition WRITE setPosition NOTIFY positionChanged FINAL)
+    Q_PROPERTY(double position READ getPosition WRITE setPosition NOTIFY positionChanged FINAL)
     Q_PROPERTY(VLCTick length READ getLength NOTIFY lengthChanged FINAL)
 
     Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged FINAL)
@@ -205,7 +205,7 @@ public slots:
     void jumpFwd();
     void jumpBwd();
     void jumpToTime( VLCTick i_time );
-    void jumpToPos( float );
+    void jumpToPos( double );
     void frameNext();
 
     //title/chapters/menu
@@ -282,8 +282,8 @@ public slots:
     VLCTick getTime() const;
     void setTime(VLCTick);
     VLCTick getRemainingTime() const;
-    float getPosition() const;
-    void setPosition(float);
+    double getPosition() const;
+    void setPosition(double);
     VLCTick getLength() const;
     bool isSeekable() const;
     bool isRewindable() const;
@@ -399,10 +399,10 @@ signals:
 
     void timeChanged( VLCTick );
     void remainingTimeChanged( VLCTick );
-    void positionChanged( float );
+    void positionChanged( double );
     void lengthChanged( VLCTick );
-    void positionUpdated( float , VLCTick, int );
-    void seekRequested( float pos ); //not exposed through Q_PROPERTY
+    void positionUpdated( double , VLCTick, int );
+    void seekRequested( double pos ); //not exposed through Q_PROPERTY
 
     void seekableChanged( bool );
     void rewindableChanged( bool );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/361f419997a2f325c3534d34fdc4b0d24cc4a85a...240cfdbd2e41e73024101b3a6839658174ffabd1

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/361f419997a2f325c3534d34fdc4b0d24cc4a85a...240cfdbd2e41e73024101b3a6839658174ffabd1
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list