} \
CONNECT( ui.widget##Enable, clicked(), this, updateFilters() );
#define SETUP_VFILTER_OPTION( widget, signal ) \
+ initComboBoxItems( ui.widget ); \
setWidgetValue( ui.widget ); \
CONNECT( ui.widget, signal, this, updateFilterOptions() );
SETUP_VFILTER_OPTION( gradientTypeCheck, stateChanged(int) )
SETUP_VFILTER_OPTION( gradientCartoonCheck, stateChanged(int) )
- SETUP_VFILTER( blur )
+ SETUP_VFILTER( motionblur )
SETUP_VFILTER_OPTION( blurFactorSlider, valueChanged(int) )
SETUP_VFILTER( motiondetect )
vlc_object_find_name( p_intf->p_libvlc_global, psz_name, FIND_CHILD );
if( !p_obj )
{
- msg_Err( p_intf, "Unable to find filter module." );
+ msg_Err( p_intf, "Unable to find filter module \"%s\n.", psz_name );
return;
}
: groupbox->isChecked() );
}
+void ExtVideo::initComboBoxItems( QObject *widget )
+{
+ QComboBox *combobox = qobject_cast<QComboBox*>(widget);
+ if( !combobox ) return;
+ QString option = OptionFromWidgetName( widget );
+ module_config_t *p_item = config_FindConfig( VLC_OBJECT(p_intf),
+ option.toStdString().c_str() );
+ if( p_item )
+ {
+ int i_type = p_item->i_type & CONFIG_ITEM;
+ for( int i_index = 0; i_index < p_item->i_list; i_index++ )
+ {
+ if( i_type == CONFIG_ITEM_INTEGER
+ || i_type == CONFIG_ITEM_BOOL )
+ combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ), p_item->pi_list[i_index] );
+ else if( i_type == CONFIG_ITEM_STRING )
+ combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ), p_item->ppsz_list[i_index] );
+ }
+ }
+ else
+ {
+ msg_Err( p_intf, "Couldn't find option \"%s\".",
+ option.toStdString().c_str() );
+ }
+}
+
void ExtVideo::setWidgetValue( QObject *widget )
{
QString module = ModuleFromWidgetName( widget->parent() );
sprintf( str, "%06X", val.i_int );
lineedit->setText( str );
}
+ else if( combobox ) combobox->setCurrentIndex(
+ combobox->findData( val.i_int ) );
else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
}
else if( i_type == VLC_VAR_FLOAT )
{
const char *psz_string = NULL;
if( lineedit ) lineedit->setText( qfu(val.psz_string) );
+ else if( combobox ) combobox->setCurrentIndex(
+ combobox->findData( qfu( val.psz_string ) ) );
else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
free( val.psz_string );
}
}
int i_type = var_Type( p_obj, option.toStdString().c_str() );
- if( !( i_type & VLC_VAR_ISCOMMAND ) )
+ bool b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
+ if( !b_is_command )
{
- vlc_object_release( p_obj );
- msg_Err( p_intf, "Module %s's %s variable isn't a command.",
+ msg_Warn( p_intf, "Module %s's %s variable isn't a command. You'll need to restart the filter to take change into account.",
module.toStdString().c_str(),
option.toStdString().c_str() );
- return;
+ /* FIXME: restart automatically somewhere near the end of this function */
}
/* Try to cast to all the widgets we're likely to encounter. Only
else if( spinbox ) i_int = spinbox->value();
else if( dial ) i_int = (540-dial->value())%360;
else if( lineedit ) i_int = lineedit->text().toInt(NULL,16);
+ else if( combobox ) i_int = combobox->itemData(combobox->currentIndex()).toInt();
else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
config_PutInt( p_intf, option.toStdString().c_str(), i_int );
- if( i_type == VLC_VAR_INTEGER )
- var_SetInteger( p_obj, option.toStdString().c_str(), i_int );
- else
- var_SetBool( p_obj, option.toStdString().c_str(), i_int );
+ if( b_is_command )
+ {
+ if( i_type == VLC_VAR_INTEGER )
+ var_SetInteger( p_obj, option.toStdString().c_str(), i_int );
+ else
+ var_SetBool( p_obj, option.toStdString().c_str(), i_int );
+ }
}
else if( i_type == VLC_VAR_FLOAT )
{
else if( lineedit ) f_float = lineedit->text().toDouble();
else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
config_PutFloat( p_intf, option.toStdString().c_str(), f_float );
- var_SetFloat( p_obj, option.toStdString().c_str(), f_float );
+ if( b_is_command )
+ var_SetFloat( p_obj, option.toStdString().c_str(), f_float );
}
else if( i_type == VLC_VAR_STRING )
{
char *psz_string = NULL;
if( lineedit ) psz_string = qtu(lineedit->text());
+ else if( combobox ) psz_string = qtu(combobox->itemData(
+ combobox->currentIndex()).toString());
else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
+ psz_string = strdup( psz_string );
config_PutPsz( p_intf, option.toStdString().c_str(), psz_string );
- var_SetString( p_obj, option.toStdString().c_str(), psz_string );
+ if( b_is_command )
+ var_SetString( p_obj, option.toStdString().c_str(), psz_string );
+ free( psz_string );
}
else
msg_Err( p_intf,
</item>
<item row="0" column="1" >
<widget class="QSlider" name="sharpenSigmaSlider" >
+ <property name="maximum" >
+ <number>200</number>
+ </property>
+ <property name="singleStep" >
+ <number>1</number>
+ </property>
+ <property name="pageStep" >
+ <number>10</number>
+ </property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
+ <property name="tickInterval" >
+ <number>100</number>
+ </property>
</widget>
</item>
</layout>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
+ <property name="tickInterval" >
+ <number>60</number>
+ </property>
</widget>
</item>
<item row="4" column="1" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
<property name="tickInterval" >
<number>50</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
<property name="tickInterval" >
<number>100</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
<property name="tickInterval" >
<number>100</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
<property name="tickInterval" >
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="1" >
- <widget class="QGroupBox" name="blurEnable" >
+ <widget class="QGroupBox" name="motionblurEnable" >
<property name="title" >
<string>_("Motion blur")</string>
</property>
</item>
<item row="0" column="1" >
<widget class="QSlider" name="blurFactorSlider" >
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="maximum" >
+ <number>127</number>
+ </property>
+ <property name="value" >
+ <number>80</number>
+ </property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
+ <property name="tickInterval" >
+ <number>16</number>
+ </property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1" colspan="2" >
<widget class="QSlider" name="logoTransparencySlider" >
+ <property name="maximum" >
+ <number>255</number>
+ </property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="tickPosition" >
+ <enum>QSlider::TicksBothSides</enum>
+ </property>
+ <property name="tickInterval" >
+ <number>32</number>
+ </property>
</widget>
</item>
<item row="2" column="2" >