Commit 5d934dae authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt4: allow dial control for float variables

parent 3feac244
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
# include "config.h" # include "config.h"
#endif #endif
#include <math.h>
#include <QLabel> #include <QLabel>
#include <QVariant> #include <QVariant>
#include <QString> #include <QString>
...@@ -551,6 +553,7 @@ void ExtVideo::setWidgetValue( QObject *widget ) ...@@ -551,6 +553,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
{ {
if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */ if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
else if( doublespinbox ) doublespinbox->setValue( val.f_float ); 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 msg_Warn( p_intf, "Could not find the correct Float widget" );
} }
else if( i_type == VLC_VAR_STRING ) else if( i_type == VLC_VAR_STRING )
...@@ -631,6 +634,7 @@ void ExtVideo::updateFilterOptions() ...@@ -631,6 +634,7 @@ void ExtVideo::updateFilterOptions()
if( slider ) f_float = ( double )slider->value() if( slider ) f_float = ( double )slider->value()
/ ( double )slider->tickInterval(); /* hack alert! */ / ( double )slider->tickInterval(); /* hack alert! */
else if( doublespinbox ) f_float = doublespinbox->value(); 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 if( lineedit ) f_float = lineedit->text().toDouble();
else msg_Warn( p_intf, "Could not find the correct Float widget" ); else msg_Warn( p_intf, "Could not find the correct Float widget" );
config_PutFloat( p_intf, qtu( option ), f_float ); config_PutFloat( p_intf, qtu( option ), f_float );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment