#include "qt4.hpp"
#include "input_manager.hpp"
-#include "../../audio_filter/equalizer_presets.h"
#include <vlc_aout.h>
#include <vlc_intf_strings.h>
#include <vlc_vout.h>
#include <vlc_osd.h>
-#include <iostream>
-#include <string.h>
#if 0
class ConfClickHandler : public QObject
#undef SETUP_VFILTER
#undef SETUP_VFILTER_OPTION
+
+ CONNECT( ui.cropTopPx, valueChanged( int ), this, cropChange() );
+ CONNECT( ui.cropBotPx, valueChanged( int ), this, cropChange() );
+ CONNECT( ui.cropLeftPx, valueChanged( int ), this, cropChange() );
+ CONNECT( ui.cropRightPx, valueChanged( int ), this, cropChange() );
+ CONNECT( ui.topBotCropSync, toggled( bool ),
+ ui.cropBotPx, setDisabled( bool ) );
+ CONNECT( ui.leftRightCropSync, toggled( bool ),
+ ui.cropRightPx, setDisabled( bool ) );
}
ExtVideo::~ExtVideo()
{
}
-void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add )
+void ExtVideo::cropChange()
+{
+ p_vout = ( vout_thread_t * )vlc_object_find( p_intf,
+ 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() );
+ }
+}
+
+void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
{
- vout_thread_t *p_vout;
char *psz_parser, *psz_string;
const char *psz_filter_type;
}
if( p_obj )
{
- msg_Dbg( p_intf, "Found v4l2 instance" );
vlc_value_t val, text, name;
int i_ret = var_Change( p_obj, "controls", VLC_VAR_GETCHOICES,
&val, &text );
msg_Dbg( p_intf, "Couldn't find v4l2 instance" );
ui.help->show();
}
-
}
void ExtV4l2::ValueChange( bool value )
{
bool en = ui.enableCheck->isChecked();
aout_EnableFilter( VLC_OBJECT( p_intf ), "equalizer",
- en ? VLC_TRUE : VLC_FALSE );
+ en ? true : false );
// aout_EnableFilter( VLC_OBJECT( p_intf ), "upmixer",
-// en ? VLC_TRUE : VLC_FALSE );
+// en ? true : false );
// aout_EnableFilter( VLC_OBJECT( p_intf ), "vsurround",
-// en ? VLC_TRUE : VLC_FALSE );
+// en ? true : false );
enable( en );
}
{
aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
- vlc_bool_t b_2p = ui.eq2PassCheck->isChecked();
+ bool b_2p = ui.eq2PassCheck->isChecked();
if( p_aout == NULL )
config_PutInt( p_intf, "equalizer-2pass", b_2p );
config_PutInt( p_intf, "equalizer-2pass", b_2p );
for( int i = 0; i < p_aout->i_nb_inputs; i++ )
{
- p_aout->pp_inputs[i]->b_restart = VLC_TRUE;
+ p_aout->pp_inputs[i]->b_restart = true;
}
vlc_object_release( p_aout );
}
for( int i = 0 ; i< BANDS ; i++ )
{
- char psz_val[5];
+ char psz_val[8];
float f_val = ( float )( bands[i]->value() ) / 10 - 20 ;
sprintf( psz_values, "%s %f", psz_values, f_val );
sprintf( psz_val, "% 5.1f", f_val );
char *p = psz_bands;
if ( p )
{
- for( int i = 0; i < 10; i++ )
+ for( int i = 0; i < BANDS; i++ )
{
- char psz_val[5];
+ char psz_val[8];
float f = strtof( p, &p );
int i_val= ( int )( ( f + 20 ) * 10 );
bands[i]->setValue( i_val );
VLC_OBJECT_AOUT, FIND_ANYWHERE );
char psz_values[102]; memset( psz_values, 0, 102 );
- for( int i = 0 ; i< 10 ;i++ )
- sprintf( psz_values, "%s %.1f", psz_values,
- eqz_preset_10b[preset]->f_amp[i] );
+ char psz_values2[102];memset( psz_values2, 0, 102 );
+ for( int i = 0 ; i< BANDS ;i++ )
+ {
+ strcpy( psz_values2, psz_values );
+
+ sprintf( psz_values, "%s %5.1f",
+ psz_values2, eqz_preset_10b[preset]->f_amp[i] );
+ }
if( p_aout )
{
{
bool en = enableCheck->isChecked();
aout_EnableFilter( VLC_OBJECT( p_intf ), "spatializer",
- en ? VLC_TRUE : VLC_FALSE );
+ en ? true : false );
enable( en );
}
updateButton = new QToolButton;
updateButton->setAutoRaise( true );
updateButton->setText( "u" );
- updateButton->setToolTip( qtr( "Force update of the values in this dialog" ) );
+ updateButton->setToolTip( qtr( "Force update of this dialog's values" ) );
mainLayout->addWidget( updateButton, 0, 4, 1, 1 );