From 72fdb18beab6d029a4ff3aa25d27f2a3dafad5a5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Mon, 31 Mar 2008 00:13:26 -0700 Subject: [PATCH] Actions on cropping UI. This doesn't work yet, because I am unsure of the good way to do it. Ref #1400. --- .../gui/qt4/components/extended_panels.cpp | 34 +++++++++++++++++-- .../gui/qt4/components/extended_panels.hpp | 2 ++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp index 9638e6bd4e..25583c00d4 100755 --- a/modules/gui/qt4/components/extended_panels.cpp +++ b/modules/gui/qt4/components/extended_panels.cpp @@ -45,8 +45,6 @@ #include #include -#include -#include #if 0 class ConfClickHandler : public QObject @@ -207,15 +205,45 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) : #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::cropChange() +{ + char *psz_crop; + unsigned int height, width; //TODO set the variables if vout exists... + + p_vout = ( vout_thread_t * )vlc_object_find( p_intf, + VLC_OBJECT_VOUT, FIND_CHILD ); + if( p_vout ) + { + height = p_vout->i_window_height; + width = p_vout->i_window_width; + sprintf( psz_crop,"%ix%i+%i+%i", + width - ui.cropLeftPx->value() - ui.cropRightPx->value(), + height - ui.cropBotPx->value() - ui.cropTopPx->value(), + ui.cropLeftPx->value(), + ui.cropTopPx->value() ); + + // var_Set( p_vout, "crop-geometry", qtu( qs_crop ) ); + } + +} + void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add ) { - vout_thread_t *p_vout; char *psz_parser, *psz_string; const char *psz_filter_type; diff --git a/modules/gui/qt4/components/extended_panels.hpp b/modules/gui/qt4/components/extended_panels.hpp index 60a2fd4250..b632488cca 100644 --- a/modules/gui/qt4/components/extended_panels.hpp +++ b/modules/gui/qt4/components/extended_panels.hpp @@ -53,12 +53,14 @@ private: Ui::ExtVideoWidget ui; QSignalMapper* filterMapper; intf_thread_t *p_intf; + vout_thread_t *p_vout; void initComboBoxItems( QObject* ); void setWidgetValue( QObject* ); void ChangeVFiltersString( char *psz_name, vlc_bool_t b_add ); private slots: void updateFilters(); void updateFilterOptions(); + void cropChange(); }; class ExtV4l2 : public QWidget -- 2.39.2