Commit e0114a72 authored by Erwan Tulou's avatar Erwan Tulou

skins2: new fullscreen implementation (currently intended for Linux)

parent 2e49a0b3
...@@ -45,6 +45,9 @@ CtrlVideo::CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout, ...@@ -45,6 +45,9 @@ CtrlVideo::CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
VarBox &rVoutSize = VlcProc::instance( pIntf )->getVoutSizeVar(); VarBox &rVoutSize = VlcProc::instance( pIntf )->getVoutSizeVar();
rVoutSize.addObserver( this ); rVoutSize.addObserver( this );
} }
VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
rFullscreen.addObserver( this );
} }
...@@ -53,6 +56,9 @@ CtrlVideo::~CtrlVideo() ...@@ -53,6 +56,9 @@ CtrlVideo::~CtrlVideo()
VarBox &rVoutSize = VlcProc::instance( getIntf() )->getVoutSizeVar(); VarBox &rVoutSize = VlcProc::instance( getIntf() )->getVoutSizeVar();
rVoutSize.delObserver( this ); rVoutSize.delObserver( this );
VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
rFullscreen.delObserver( this );
//m_pLayout->getActiveVar().delObserver( this ); //m_pLayout->getActiveVar().delObserver( this );
} }
...@@ -167,7 +173,16 @@ void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg ) ...@@ -167,7 +173,16 @@ void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg )
m_pLayout->getActiveVar().get() ); m_pLayout->getActiveVar().get() );
} }
m_bIsUseable = isVisible() && m_pLayout->getActiveVar().get(); VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
if( &rVariable == &rFullscreen )
{
msg_Dbg( getIntf(), "VideoCtrl : fullscreen toggled (fullscreen = %d)",
rFullscreen.get() );
}
m_bIsUseable = isVisible() &&
m_pLayout->getActiveVar().get() &&
!rFullscreen.get();
if( m_bIsUseable && !isUsed() ) if( m_bIsUseable && !isUsed() )
{ {
......
...@@ -770,6 +770,11 @@ void VlcProc::update_equalizer() ...@@ -770,6 +770,11 @@ void VlcProc::update_equalizer()
SET_BOOL( m_cVarEqualizer, b_equalizer ); SET_BOOL( m_cVarEqualizer, b_equalizer );
} }
void VlcProc::setFullscreenVar( bool b_fullscreen )
{
SET_BOOL( m_cVarFullscreen, b_fullscreen );
}
#undef SET_BOOL #undef SET_BOOL
#undef SET_STREAMTIME #undef SET_STREAMTIME
#undef SET_TEXT #undef SET_TEXT
......
...@@ -84,6 +84,10 @@ public: ...@@ -84,6 +84,10 @@ public:
/// Getter for the vout size variable /// Getter for the vout size variable
VarBox &getVoutSizeVar() { return m_varVoutSize; } VarBox &getVoutSizeVar() { return m_varVoutSize; }
/// Getter/Setter for the fullscreen variable
VarBool &getFullscreenVar() { return *((VarBool*)(m_cVarFullscreen.get())); }
void setFullscreenVar( bool );
/// Indicate whether the embedded video output is currently used /// Indicate whether the embedded video output is currently used
bool isVoutUsed() const { return m_pVout != NULL; } bool isVoutUsed() const { return m_pVout != NULL; }
......
...@@ -60,6 +60,13 @@ VoutManager::VoutManager( intf_thread_t *pIntf ): SkinObject( pIntf ), ...@@ -60,6 +60,13 @@ VoutManager::VoutManager( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_pCtrlVideoVecBackup(), m_SavedWndVec() m_pCtrlVideoVecBackup(), m_SavedWndVec()
{ {
m_pVoutMainWindow = new VoutMainWindow( getIntf() ); m_pVoutMainWindow = new VoutMainWindow( getIntf() );
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
int width = pOsFactory->getScreenWidth();
int height = pOsFactory->getScreenHeight();
m_pVoutMainWindow->move( 0, 0 );
m_pVoutMainWindow->resize( width, height );
} }
...@@ -256,19 +263,18 @@ void VoutManager::setSizeWnd( vout_window_t *pWnd, int width, int height ) ...@@ -256,19 +263,18 @@ void VoutManager::setSizeWnd( vout_window_t *pWnd, int width, int height )
void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen ) void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen )
{ {
msg_Dbg( pWnd, "setFullscreen (%d) received from vout thread", msg_Dbg( pWnd, "setFullscreen (%d) received from vout thread",
b_fullscreen ? 1 : 0 ); b_fullscreen ? 1 : 0 );
vector<SavedWnd>::iterator it; VlcProc::instance( getIntf() )->setFullscreenVar( b_fullscreen );
for( it = m_SavedWndVec.begin(); it != m_SavedWndVec.end(); it++ )
{
if( (*it).pWnd == pWnd )
{
VoutWindow* pVoutWindow = (*it).pVoutWindow;
pVoutWindow->setFullscreen( b_fullscreen ); if( b_fullscreen )
break; {
} m_pVoutMainWindow->show();
}
else
{
m_pVoutMainWindow->hide();
} }
} }
......
...@@ -77,9 +77,11 @@ void VoutWindow::setCtrlVideo( CtrlVideo* pCtrlVideo ) ...@@ -77,9 +77,11 @@ void VoutWindow::setCtrlVideo( CtrlVideo* pCtrlVideo )
} }
else else
{ {
hide(); int w = VoutManager::instance( getIntf() )->getVoutMainWindow()->getWidth();
int h = VoutManager::instance( getIntf() )->getVoutMainWindow()->getHeight();
setParent( VoutManager::instance( getIntf() )->getVoutMainWindow(), setParent( VoutManager::instance( getIntf() )->getVoutMainWindow(),
0, 0, 0, 0 ); 0, 0, w, h );
m_pParentWindow = m_pParentWindow =
VoutManager::instance( getIntf() )->getVoutMainWindow(); VoutManager::instance( getIntf() )->getVoutMainWindow();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment