[vlc-commits] Qt4: allow dial control for float variables

Rémi Denis-Courmont git at videolan.org
Sat Nov 10 19:21:17 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 10 20:20:25 2012 +0200| [5d934daea61c570cece69172dd72d93df57cc44c] | committer: Rémi Denis-Courmont

Qt4: allow dial control for float variables

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

 modules/gui/qt4/components/extended_panels.cpp |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index bbf4445..6407f76 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -29,6 +29,8 @@
 # include "config.h"
 #endif
 
+#include <math.h>
+
 #include <QLabel>
 #include <QVariant>
 #include <QString>
@@ -551,6 +553,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
     {
         if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
         else if( doublespinbox ) doublespinbox->setValue( val.f_float );
+        else if( dial ) dial->setValue( (540 - lroundf(val.f_float)) % 360 );
         else msg_Warn( p_intf, "Could not find the correct Float widget" );
     }
     else if( i_type == VLC_VAR_STRING )
@@ -631,6 +634,7 @@ void ExtVideo::updateFilterOptions()
         if( slider )             f_float = ( double )slider->value()
                                          / ( double )slider->tickInterval(); /* hack alert! */
         else if( doublespinbox ) f_float = doublespinbox->value();
+        else if( dial ) f_float = (540 - dial->value()) % 360;
         else if( lineedit ) f_float = lineedit->text().toDouble();
         else msg_Warn( p_intf, "Could not find the correct Float widget" );
         config_PutFloat( p_intf, qtu( option ), f_float );



More information about the vlc-commits mailing list