p_intf( _p_intf )
{
ui.setupUi( _parent );
+ p_vout = NULL;
#define SETUP_VFILTER( widget ) \
{ \
void ExtVideo::cropChange()
{
- p_vout = ( vout_thread_t * )vlc_object_find( p_intf,
- VLC_OBJECT_VOUT, FIND_CHILD );
- if( p_vout )
+ if( THEMIM->getInput() )
{
- var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
- var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
- var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
- var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
+ p_vout = ( vout_thread_t * )vlc_object_find( THEMIM->getInput(),
+ VLC_OBJECT_VOUT, FIND_CHILD );
+ if( p_vout )
+ {
+ var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
+ var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
+ var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
+ var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
+ }
+ vlc_object_release( p_vout );
}
}
+void ExtVideo::clean()
+{
+ ui.cropTopPx->setValue( 0 );
+ ui.cropBotPx->setValue( 0 );
+ ui.cropLeftPx->setValue( 0 );
+ ui.cropRightPx->setValue( 0 );
+}
+
void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
{
char *psz_parser, *psz_string;
ui.subpictureFilterText->setText( psz_string );
/* Try to set on the fly */
- p_vout = ( vout_thread_t * )vlc_object_find( p_intf, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ if( THEMIM->getInput() )
+ p_vout = ( vout_thread_t * )vlc_object_find( THEMIM->getInput(),
+ VLC_OBJECT_VOUT, FIND_CHILD );
+ /* If you have stopped the video, p_vout is still at its old value */
+ else
+ p_vout = NULL;
+
if( p_vout )
{
if( !strcmp( psz_filter_type, "sub-filter" ) )
void ExtVideo::updateFilters()
{
QString module = ModuleFromWidgetName( sender() );
- //std::cout << "Module name: " << module.toStdString() << std::endl;
QCheckBox *checkbox = qobject_cast<QCheckBox*>( sender() );
QGroupBox *groupbox = qobject_cast<QGroupBox*>( sender() );
{
}
+void Equalizer::clean()
+{
+ ui.enableCheck->setChecked( false );
+ enable();
+}
/* Write down initial values */
void Equalizer::updateUIFromCore()
{
- char *psz_af;//, *psz_bands; Don't use it ?
+ char *psz_af;
float f_preamp;
int i_preset;
psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
if( var_GetBool( p_aout, "equalizer-2pass" ) )
ui.eq2PassCheck->setChecked( true );
-// psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
i_preset = presetsComboBox->findData( QVariant(
var_GetString( p_aout, "equalizer-preset" ) ) );
psz_af = config_GetPsz( p_intf, "audio-filter" );
if( config_GetInt( p_intf, "equalizer-2pass" ) )
ui.eq2PassCheck->setChecked( true );
-// psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
f_preamp = config_GetFloat( p_intf, "equalizer-preamp" );
i_preset = presetsComboBox->findData( QVariant(
config_GetPsz( p_intf, "equalizer-preset" ) ) );
bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
- band_texts[i]->setText( band_frequencies[i] + "\n"
+ band_texts[i]->setText( band_frequencies[i] + "\n"
+ QString("%1").arg( f, 5, 'f', 1 ) + "dB" );
if( p == NULL || *p == '\0' )
break;
AVSpin = new QDoubleSpinBox;
AVSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
AVSpin->setDecimals( 3 );
- AVSpin->setMinimum( -100 );
- AVSpin->setMaximum( 100 );
+ AVSpin->setMinimum( -100.0 );
+ AVSpin->setMaximum( 100.0 );
AVSpin->setSingleStep( 0.1 );
AVSpin->setToolTip( qtr( "A positive value means that\n"
"the audio is ahead of the video" ) );
subsSpin = new QDoubleSpinBox;
subsSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
subsSpin->setDecimals( 3 );
- subsSpin->setMinimum( -100 );
- subsSpin->setMaximum( 100 );
+ subsSpin->setMinimum( -100.0 );
+ subsSpin->setMaximum( 100.0 );
subsSpin->setSingleStep( 0.1 );
subsSpin->setToolTip( qtr( "A positive value means that\n"
"the subtitles are ahead of the video" ) );
update();
}
+void SyncControls::clean()
+{
+ AVSpin->setValue( 0.0 );
+ subsSpin->setValue( 0.0 );
+ subSpeedSpin->setValue( 1.0 );
+}
+
void SyncControls::update()
{
int64_t i_delay;
if( THEMIM->getInput() )
{
int64_t i_delay = var_GetTime( THEMIM->getInput(), "audio-delay" );
- i_delay += f_advance * 1000000;
+ i_delay = f_advance * 1000000;
var_SetTime( THEMIM->getInput(), "audio-delay", i_delay );
- msg_Dbg( p_intf, "I am advancing Audio %d", f_advance );
}
}
if( THEMIM->getInput() )
{
int64_t i_delay = var_GetTime( THEMIM->getInput(), "spu-delay" );
- i_delay += f_advance * 1000000;
+ i_delay = f_advance * 1000000;
var_SetTime( THEMIM->getInput(), "spu-delay", i_delay );
msg_Dbg( p_intf, "I am advancing subtitles %d", f_advance );
}