CONNECT_MAP_SET( play, PLAY_ACTION );
}
break;
+ case ASPECT_RATIO_COMBOBOX:
+ widget = new AspectRatioComboBox( p_intf );
+ break;
default:
msg_Warn( p_intf, "This should not happen %i", button );
break;
TELETEXT_BUTTONS,
ADVANCED_CONTROLLER,
PLAYBACK_BUTTONS,
+ ASPECT_RATIO_COMBOBOX,
SPECIAL_MAX,
WIDGET_SPACER = 0x40,
setIcon( ( value == REPEAT_ONE ) ? QIcon( ":/buttons/playlist/repeat_one" )
: QIcon( ":/buttons/playlist/repeat_all" ) );
}
+
+void AspectRatioComboBox::updateRatios() {
+ /* Clear the list before updating */
+ this->clear();
+ vlc_value_t val_list, text_list;
+ vout_thread_t* p_vout = THEMIM->getVout();
+ /* Disable if there is no vout */
+ if( p_vout == NULL ) {
+ addItem("Aspect Ratio");
+ setDisabled( true );
+ return;
+ }
+ var_Change( p_vout, "aspect-ratio", VLC_VAR_GETLIST, &val_list, &text_list );
+ for( int i = 0; i < val_list.p_list->i_count; i++ )
+ addItem( QString( text_list.p_list->p_values[i].psz_string ), QString( val_list.p_list->p_values[i].psz_string ) );
+ setEnabled( true );
+ var_FreeList( &val_list, &text_list );
+}
+
+void AspectRatioComboBox::updateAspectRatio( int x ) {
+ vout_thread_t* p_vout = THEMIM->getVout();
+ if( p_vout && x >= 0 ) var_SetString( p_vout, "aspect-ratio", qtu( itemData(x).toString() ) );
+}
#endif
#include "qt4.hpp"
+#include "input_manager.hpp"
+#include <vlc_vout.h> /* vout_thread_t for aspect ratio combobox */
#include <QWidget>
#include <QToolButton>
+#include <QComboBox>
class QLabel;
class QFrame;
void updateButtonIcons( bool, bool );
};
+class AspectRatioComboBox : public QComboBox
+{
+ Q_OBJECT
+ public:
+ AspectRatioComboBox( intf_thread_t* _p_intf ) {
+ p_intf = _p_intf;
+ CONNECT( THEMIM->getIM(), voutChanged( bool ),
+ this, updateRatios() );
+ CONNECT( this, currentIndexChanged( int ),
+ this, updateAspectRatio( int ) );
+ this->updateRatios();
+ }
+
+ public slots:
+ void updateRatios();
+ void updateAspectRatio( int );
+
+ private:
+ intf_thread_t* p_intf;
+};
+
#define VOLUME_MAX 200
class SoundWidget : public QWidget
{
#include "util/buttons/BrowseButton.hpp"
#include "util/buttons/RoundButton.hpp"
+#include "qt4.hpp"
+#include "input_manager.hpp"
+#include <vlc_vout.h> /* vout_thread_t for aspect ratio combobox */
+
#include <QScrollArea>
#include <QGroupBox>
#include <QLabel>
}
widgetItem->setText( qtr("Playback Buttons") );
break;
+ case ASPECT_RATIO_COMBOBOX:
+ widget = new AspectRatioComboBox( p_intf );
+ widgetItem->setText( qtr("Aspect ratio selector") );
+ break;
default:
msg_Warn( p_intf, "This should not happen %i", i );
break;