vout_thread_t* pVout = input_GetVout( pInput );
SET_BOOL( m_cVarHasVout, pVout != NULL );
if( pVout )
- {
- SET_BOOL( m_cVarFullscreen,
- var_GetBool( pVout, "fullscreen" ) );
vlc_object_release( pVout );
- }
break;
}
SET_BOOL( m_cVarRecordable, false );
SET_BOOL( m_cVarRecording, false );
SET_BOOL( m_cVarDvdActive, false );
- SET_BOOL( m_cVarFullscreen, false );
SET_BOOL( m_cVarHasAudio, false );
SET_BOOL( m_cVarHasVout, false );
SET_BOOL( m_cVarStopped, true );
m_pVoutMainWindow->move( 0, 0 );
m_pVoutMainWindow->resize( width, height );
+
+ VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
+ rFullscreen.addObserver( this );
}
VoutManager::~VoutManager( )
{
+ VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
+ rFullscreen.delObserver( this );
+
delete m_pVoutMainWindow;
}
break;
}
}
+
+ // force fullscreen to false so that user regains control
+ VlcProc::instance( getIntf() )->setFullscreenVar( false );
}
}
}
+
void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen )
{
- msg_Dbg( pWnd, "setFullscreen (%d) received from vout thread",
- b_fullscreen ? 1 : 0 );
+ msg_Dbg( pWnd, "setFullscreen (%i) received from vout thread",
+ b_fullscreen );
VlcProc::instance( getIntf() )->setFullscreenVar( b_fullscreen );
+}
- if( b_fullscreen )
- {
- m_pVoutMainWindow->show();
- }
- else
+
+void VoutManager::onUpdate( Subject<VarBool> &rVariable, void *arg )
+{
+ VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
+ if( &rVariable == &rFullscreen )
{
- m_pVoutMainWindow->hide();
+ if( rFullscreen.get() )
+ m_pVoutMainWindow->show();
+ else
+ m_pVoutMainWindow->hide();
}
}
+
// Functions called by window provider
// ///////////////////////////////////
/// Singleton object handling VLC internal state and playlist
-class VoutManager: public SkinObject
+class VoutManager: public SkinObject, public Observer<VarBool>
{
public:
/// Get the instance of VoutManager
// test if vout are running
bool hasVout() { return ( m_SavedWndVec.size() != 0 ) ; }
+ /// called when fullscreen variable changed
+ virtual void onUpdate( Subject<VarBool> &rVariable , void* );
+
protected:
// Protected because it is a singleton
VoutManager( intf_thread_t *pIntf );