Commit 0bbccbb1 authored by Cyril Deguet's avatar Cyril Deguet

* src/vlc_proc.*: quick fix to handle the new playlist object variables

  (At the moment the whole playlist is rebuilt each time; the link
  between the list control and the list variable should be enhanced
  to avoid that)
* src/window_manager.cpp: raise all the windows when one clicks on
  any window (the previous behaviour was too confiusing)
parent a826dc3e
......@@ -2,7 +2,7 @@
* theme_loader.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: theme_loader.cpp,v 1.2 2004/01/10 23:22:21 anil Exp $
* $Id: theme_loader.cpp,v 1.3 2004/01/11 00:21:22 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -475,7 +475,6 @@ int makedir( char *newdir )
free( buffer );
return 1;
}
#endif
#ifdef HAVE_ZLIB_H
......
......@@ -2,7 +2,7 @@
* vlcproc.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: vlcproc.cpp,v 1.2 2004/01/11 00:21:22 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -64,9 +64,15 @@ VlcProc::VlcProc( intf_thread_t *pIntf ):
m_pTimer = pOsFactory->createOSTimer( Callback( this, &doManage ) );
m_pTimer->start( 100, false );
// Callbacks for object variables
// Called when the playlist changes
var_AddCallback( pIntf->p_sys-> p_playlist, "intf-change",
onIntfChange, this );
// Called when the current played item changes
var_AddCallback( pIntf->p_sys-> p_playlist, "playlist-current",
onPlaylistChange, this );
// Called when a playlist items changed
var_AddCallback( pIntf->p_sys-> p_playlist, "item-change",
onItemChange, this );
getIntf()->p_sys->p_input = NULL;
}
......@@ -159,6 +165,44 @@ void VlcProc::doManage( SkinObject *pObj )
}
int VlcProc::onIntfChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam )
{
VlcProc *pThis = ( VlcProc* )pParam;
// Create a playlist notify command
CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pQueue->remove( "notify playlist" );
pQueue->push( CmdGenericPtr( pCmd ) );
return VLC_SUCCESS;
}
int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam )
{
VlcProc *pThis = ( VlcProc* )pParam;
// Create a playlist notify command
// TODO: selective update
CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pQueue->remove( "notify playlist" );
pQueue->push( CmdGenericPtr( pCmd ) );
/*
p_playlist_dialog->UpdateItem( new_val.i_int );*/
return VLC_SUCCESS;
}
int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam )
......@@ -166,13 +210,16 @@ int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
VlcProc *pThis = ( VlcProc* )pParam;
// Create a playlist notify command
// TODO: selective update
CmdNotifyPlaylist *pCmd = new CmdNotifyPlaylist( pThis->getIntf() );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pQueue->remove( "notify playlist" );
pQueue->push( CmdGenericPtr( pCmd ) );
/*
p_playlist_dialog->UpdateItem( old_val.i_int );
p_playlist_dialog->UpdateItem( new_val.i_int );*/
return VLC_SUCCESS;
}
......@@ -2,7 +2,7 @@
* vlcproc.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlcproc.hpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: vlcproc.hpp,v 1.2 2004/01/11 00:21:22 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -33,7 +33,7 @@
class OSTimer;
/// Singleton object handling VLC internal state
/// Singleton object handling VLC internal state and playlist
class VlcProc: public SkinObject
{
public:
......@@ -94,7 +94,17 @@ class VlcProc: public SkinObject
/// always write "pThis->"
static void doManage( SkinObject *pObj );
/// Callback for the playlist
/// Callback for intf-change variable
static int onIntfChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam );
/// Callback for item-change variable
static int onItemChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam );
/// Callback for playlist-current variable
static int onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam );
......
......@@ -2,7 +2,7 @@
* window_manager.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: window_manager.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: window_manager.cpp,v 1.2 2004/01/11 00:21:22 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -139,21 +139,18 @@ void WindowManager::move( GenericWindow *pWindow, int left, int top ) const
void WindowManager::raise( GenericWindow *pWindow )
{
// Build a set of windows anchored to pWindow
WinSet_t winSet;
buildDependSet( winSet, pWindow );
// Raise the windows in the set
WinSet_t::const_iterator iter;
for( iter = winSet.begin(); iter != winSet.end(); iter++ )
// Raise all the windows
WinSet_t::const_iterator it;
for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
{
(*iter)->raise();
(*it)->raise();
}
}
void WindowManager::showAll() const
{
// Show all the windows
WinSet_t::const_iterator it;
for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
{
......
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