var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
onIntfChange, this );
// Called when a playlist item is added
- var_AddCallback( pIntf->p_sys->p_playlist, "item-append",
+ var_AddCallback( pIntf->p_sys->p_playlist, "playlist-item-append",
onItemAppend, this );
// Called when a playlist item is deleted
// TODO: properly handle item-deleted
- var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
+ var_AddCallback( pIntf->p_sys->p_playlist, "playlist-item-deleted",
onItemDelete, this );
// Called when the "interface shower" wants us to show the skin
var_AddCallback( pIntf->p_libvlc, "intf-show",
if( getIntf()->p_sys->p_input )
{
vlc_object_release( getIntf()->p_sys->p_input );
+ getIntf()->p_sys->p_input = NULL;
}
interaction_Unregister( getIntf() );
var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
onIntfChange, this );
- var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
+ var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-item-append",
onItemAppend, this );
- var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
+ var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-item-deleted",
onItemDelete, this );
var_DelCallback( getIntf()->p_libvlc, "intf-show",
onIntfShow, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
onItemChange, this );
var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
+ var_DelCallback( getIntf(), "interaction", onInteraction, this );
}
-
-void VlcProc::registerVoutWindow( void *pVoutWindow )
-{
- m_handleSet.insert( pVoutWindow );
- // Reparent the vout window
- if( m_pVout )
- {
- vout_Control( m_pVout, VOUT_REPARENT, 0 );
- }
-}
-
-
-void VlcProc::unregisterVoutWindow( void *pVoutWindow )
-{
- m_handleSet.erase( pVoutWindow );
-}
-
-
-void VlcProc::dropVout()
-{
- if( m_pVout )
- {
- vout_Control( m_pVout, VOUT_REPARENT, 0 );
- m_pVout = NULL;
- }
-}
-
-
void VlcProc::manage()
{
// Did the user request to quit vlc ?
pVarHasVout->set( pVout != NULL );
if( pVout )
{
- pVarFullscreen->set( pVout->b_fullscreen );
+ pVarFullscreen->set( var_GetBool( pVout, "fullscreen" ) );
vlc_object_release( pVout );
}
int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
+ vlc_value_t oldval, vlc_value_t newval,
void *pParam )
{
VlcProc *pThis = (VlcProc*)pParam;
+ input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
// Update the stream variable
pThis->updateStreamName();
// Create a playtree notify command
CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
- newVal.i_int );
+ p_item->i_id );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
+ vlc_value_t oldval, vlc_value_t newval,
void *pParam )
{
VlcProc *pThis = (VlcProc*)pParam;
+ input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pThis->updateStreamName();
// Create two playtree notify commands: one for old item, one for new
+#if 0 /* FIXME: Heck, no! You cannot do that.
+ There is no warranty that the old item is still valid. */
CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
oldVal.i_int );
pQueue->push( CmdGenericPtr( pCmdTree ) , true );
- pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), newVal.i_int );
+#endif
+ CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), p_item->i_id );
pQueue->push( CmdGenericPtr( pCmdTree ) , true );
return VLC_SUCCESS;
pQueue->push( CmdGenericPtr( pCmdItem ) );
}
-void *VlcProc::getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
- int *pXHint, int *pYHint,
- unsigned int *pWidthHint,
- unsigned int *pHeightHint )
-{
- VlcProc *pThis = pIntf->p_sys->p_vlcProc;
- if( pThis->m_handleSet.empty() )
- {
- return NULL;
- }
- else
- {
- pThis->m_pVout = pVout;
- // Get the window handle
- void *pWindow = *pThis->m_handleSet.begin();
- // Post a resize vout command
- CmdResizeVout *pCmd = new CmdResizeVout( pThis->getIntf(), pWindow,
- *pWidthHint, *pHeightHint );
- AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
- pQueue->push( CmdGenericPtr( pCmd ) );
- return pWindow;
- }
-}
-
-
-void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
-{
- VlcProc *pThis = pIntf->p_sys->p_vlcProc;
- pThis->m_pVout = NULL;
-}
-
-
-int VlcProc::controlWindow( struct vout_window_t *pWnd,
- int query, va_list args )
-{
- intf_thread_t *pIntf = (intf_thread_t *)pWnd->p_private;
- VlcProc *pThis = pIntf->p_sys->p_vlcProc;
-
- switch( query )
- {
- case VOUT_SET_SIZE:
- {
- if( pThis->m_pVout )
- {
- unsigned int i_width = va_arg( args, unsigned int );
- unsigned int i_height = va_arg( args, unsigned int );
- if( !i_width ) i_width = pThis->m_pVout->i_window_width;
- if( !i_height ) i_height = pThis->m_pVout->i_window_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 ) );
- }
- }
-
- default:
- msg_Dbg( pWnd, "control query not supported" );
- break;
- }
-
- return VLC_SUCCESS;
-}
-
-
int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam )