bool autoResize, const UString &rHelp,
VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_rLayout( rLayout ),
- m_xShift( 0 ), m_yShift( 0 ), m_bAutoResize( autoResize ),
- m_pVoutWindow( NULL ), m_bIsUseable( false )
+ m_bAutoResize( autoResize), m_xShift( 0 ), m_yShift( 0 ),
+ m_bIsUseable( false), m_pVoutWindow( NULL )
{
VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
rFullscreen.addObserver( this );
void CtrlVideo::handleEvent( EvtGeneric &rEvent )
{
+ (void)rEvent;
}
bool CtrlVideo::mouseOver( int x, int y ) const
{
+ (void)x; (void)y;
return false;
}
}
-void CtrlVideo::draw( OSGraphics &rImage, int xDest, int yDest )
+void CtrlVideo::draw( OSGraphics &rImage, int xDest, int yDest, int w, int h)
{
const Position *pPos = getPosition();
- if( pPos )
+ rect region( pPos->getLeft(), pPos->getTop(),
+ pPos->getWidth(), pPos->getHeight() );
+ rect clip( xDest, yDest, w, h );
+ rect inter;
+
+ if( rect::intersect( region, clip, &inter ) )
{
// Draw a black rectangle under the video to avoid transparency
- rImage.fillRect( pPos->getLeft(), pPos->getTop(), pPos->getWidth(),
- pPos->getHeight(), 0 );
+ rImage.fillRect( inter.x, inter.y, inter.width, inter.height, 0 );
+ }
+
+ if( m_pVoutWindow )
+ {
+ m_pVoutWindow->show();
}
}
void CtrlVideo::resizeControl( int width, int height )
{
+ if( !m_bAutoResize )
+ return;
+
WindowManager &rWindowManager =
getIntf()->p_sys->p_theme->getWindowManager();
void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
+ (void)arg;
+
// Visibility changed
if( &rVariable == m_pVisible )
{
msg_Dbg( getIntf(), "VideoCtrl : Visibility changed (visible=%d)",
isVisible() );
+ notifyLayout();
}
// Active Layout changed