}
-CmdResizeVout::CmdResizeVout( intf_thread_t *pIntf, void *pWindow, int width,
- int height ):
- CmdGeneric( pIntf ), m_pWindow( pWindow ), m_width( width ),
+CmdResizeVout::CmdResizeVout( intf_thread_t *pIntf, VoutWindow *pVoutWindow,
+ int width, int height ):
+ CmdGeneric( pIntf ), m_pVoutWindow( pVoutWindow ), m_width( width ),
m_height( height )
{
}
void CmdResizeVout::execute()
{
- VarBox &rVoutSize = VlcProc::instance( getIntf() )->getVoutSizeVar();
- rVoutSize.setSize( m_width, m_height );
+ if( m_pVoutWindow )
+ {
+ m_pVoutWindow->setOriginalWidth( m_width );
+ m_pVoutWindow->setOriginalHeight( m_height );
+
+ CtrlVideo* pCtrlVideo = m_pVoutWindow->getCtrlVideo();
+ if( pCtrlVideo )
+ {
+ pCtrlVideo->resizeControl( m_width, m_height );
+ }
+ }
}
{
public:
/// Resize the given layout
- CmdResizeVout( intf_thread_t *pIntf, void *pWindow, int width,
- int height );
+ CmdResizeVout( intf_thread_t *pIntf, VoutWindow *pVoutWindow,
+ int width, int height );
virtual ~CmdResizeVout() {}
/// This method does the real job of the command
virtual string getType() const { return "resize vout"; }
private:
- void *m_pWindow;
+ VoutWindow *m_pVoutWindow;
int m_width, m_height;
};
}
}
-void CtrlVideo::attachVoutWindow( VoutWindow* pVoutWindow )
+void CtrlVideo::attachVoutWindow( VoutWindow* pVoutWindow, int width, int height )
{
- int width = pVoutWindow->getOriginalWidth();
- int height = pVoutWindow->getOriginalHeight();
+ width = ( width < 0 ) ? pVoutWindow->getOriginalWidth() : width;
+ height = ( height < 0 ) ? pVoutWindow->getOriginalHeight() : height;
WindowManager &rWindowManager =
getIntf()->p_sys->p_theme->getWindowManager();
virtual void onUpdate( Subject<VarBool> &rVariable , void* );
// Attach a voutWindow to a Video Control
- void attachVoutWindow( VoutWindow* pVoutWindow );
+ void attachVoutWindow( VoutWindow* pVoutWindow,
+ int width = -1, int height = -1 );
// Detach a voutWindow from a Video Control
void detachVoutWindow( );
{
if( (*it).pCtrlVideo == NULL )
{
- pCtrlVideo->attachVoutWindow( (*it).pVoutWindow );
+ pCtrlVideo->attachVoutWindow( (*it).pVoutWindow,
+ (*it).width, (*it).height );
(*it).pCtrlVideo = pCtrlVideo;
break;
}
{
intf_thread_t *pIntf = (intf_thread_t *)pWnd->p_private;
VoutManager *pThis = pIntf->p_sys->p_voutManager;
+ vout_thread_t* pVout = pWnd->vout;
switch( query )
{
if( i_width && i_height )
{
- // Post a resize vout command
- CmdResizeVout *pCmd =
- new CmdResizeVout( pThis->getIntf(), pWnd->handle.hwnd,
- i_width, i_height );
- AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
- pQueue->push( CmdGenericPtr( pCmd ) );
+ pThis->lockVout();
+
+ vector<SavedVout>::iterator it;
+ for( it = pThis->m_SavedVoutVec.begin();
+ it != pThis->m_SavedVoutVec.end(); it++ )
+ {
+ if( (*it).pVout == pVout )
+ {
+ // Post a vout resize command
+ CmdResizeVout *pCmd =
+ new CmdResizeVout( pThis->getIntf(),
+ (*it).pVoutWindow,
+ (int)i_width, (int)i_height );
+ AsyncQueue *pQueue =
+ AsyncQueue::instance( pThis->getIntf() );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ break;
+ }
+ }
+
+ pThis->unlockVout();
}
}
/// Refresh an area of the window
virtual void refresh( int left, int top, int width, int height );
- /// set Video Control for VoutWindow
+ /// set and get Video Control for VoutWindow
virtual void setCtrlVideo( CtrlVideo* pCtrlVideo );
+ virtual CtrlVideo* getCtrlVideo( ) { return m_pCtrlVideo; }
/// get original size of vout
virtual int getOriginalWidth( ) { return original_width; }
virtual int getOriginalHeight( ) { return original_height; }
+ /// set original size of vout
+ virtual void setOriginalWidth( int width ) { original_width = width; }
+ virtual void setOriginalHeight( int height ) { original_height = height; }
+
virtual string getType() const { return "Vout"; }
private: