Widgets with this attribute set do not participate in composition
management */
setAttribute( Qt::WA_PaintOnScreen, true );
-
- /* The core can ask through a callback to show the video. */
- connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
- this, SLOT(SetSizing(unsigned int, unsigned int )),
- Qt::BlockingQueuedConnection );
}
void VideoWidget::paintEvent(QPaintEvent *ev)
/**
* Request the video to avoid the conflicts
**/
-void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
- unsigned int *pi_width, unsigned int *pi_height )
+WId VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
+ unsigned int *pi_width, unsigned int *pi_height,
+ bool b_keep_size )
{
msg_Dbg( p_intf, "Video was requested %i, %i", *pi_x, *pi_y );
- emit askVideoWidgetToShow( *pi_width, *pi_height );
+
+ if( b_keep_size )
+ {
+ *pi_width = size().width();
+ *pi_height = size().height();
+ }
+
if( p_vout )
{
msg_Dbg( p_intf, "embedded video already in use" );
#ifndef NDEBUG
msg_Dbg( p_intf, "embedded video ready (handle %p)", (void *)winId() );
#endif
- return ( void* )winId();
+ return winId();
}
/* Set the Widget to the correct Size */
/* Function has to be called by the parent
- Parent has to care about resizing himself*/
+ Parent has to care about resizing itself */
void VideoWidget::SetSizing( unsigned int w, unsigned int h )
{
msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h );
videoSize.rwidth() = w;
videoSize.rheight() = h;
- if( isHidden() ) show();
+ if( !isVisible() ) show();
updateGeometry(); // Needed for deinterlace
}
backgroundLayout->setColumnStretch( 2, 1 );
CONNECT( THEMIM->getIM(), artChanged( QString ),
- this, updateArt( QString ) );
+ this, updateArt( const QString& ) );
}
BackgroundWidget::~BackgroundWidget()
label->show();
}
-void BackgroundWidget::updateArt( QString url )
+void BackgroundWidget::updateArt( const QString& url )
{
if( url.isEmpty() )
{
}
#endif
-SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString text )
- : QLabel( text ), p_intf( _p_intf )
+SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString& text,
+ QWidget *parent )
+ : QLabel( text, parent ), p_intf( _p_intf )
{
- setToolTip( qtr( "Current playback speed.\nRight click to adjust" ) );
- setContextMenuPolicy ( Qt::CustomContextMenu );
+ setToolTip( qtr( "Current playback speed.\nClick to adjust" ) );
/* Create the Speed Control Widget */
speedControl = new SpeedControlWidget( p_intf, this );
widgetAction->setDefaultWidget( speedControl );
speedControlMenu->addAction( widgetAction );
- /* Speed Label behaviour:
- - right click gives the vertical speed slider */
- CONNECT( this, customContextMenuRequested( QPoint ),
- this, showSpeedMenu( QPoint ) );
-
/* Change the SpeedRate in the Status Bar */
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
CONNECT( THEMIM, inputChanged( input_thread_t * ),
speedControl, activateOnState() );
-}
+}
+SpeedLabel::~SpeedLabel()
+{
+ delete speedControl;
+ delete speedControlMenu;
+}
/****************************************************************************
* Small right-click menu for rate control
****************************************************************************/
sizePolicy.setHorizontalStretch( 0 );
sizePolicy.setVerticalStretch( 0 );
- speedSlider = new QSlider;
+ speedSlider = new QSlider( this );
speedSlider->setSizePolicy( sizePolicy );
speedSlider->setMaximumSize( QSize( 80, 200 ) );
speedSlider->setOrientation( Qt::Vertical );
setContextMenuPolicy( Qt::ActionsContextMenu );
CONNECT( this, updateRequested(), this, doUpdate() );
CONNECT( THEMIM->getIM(), artChanged( QString ),
- this, doUpdate( QString ) );
+ this, doUpdate( const QString& ) );
setMinimumHeight( 128 );
setMinimumWidth( 128 );
removeAction( act );
}
-void CoverArtLabel::doUpdate( QString url )
+void CoverArtLabel::doUpdate( const QString& url )
{
QPixmap pix;
if( !url.isEmpty() && pix.load( url ) )
QString amount;
amount.setNum( (int)(100 * f_cache) );
msg_Dbg( p_intf, "New caching: %d", (int)(100*f_cache));
- setText( "Buffering " + amount + "%" );
+ setText( "Buff: " + amount + "%" );
}