Commit 48e78c14 authored by Cyril Deguet's avatar Cyril Deguet

* src/playlist/playlist.c: set "intf-change" in SkipItem

* modules/gui/skin/*: InterfaceRefresh is now triggered by a
  callback on intf-change
parent b00f1988
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp: Playlist control * playlist.cpp: Playlist control
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.14 2003/06/09 14:04:20 asmax Exp $ * $Id: playlist.cpp,v 1.15 2003/06/23 20:35:36 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -79,6 +79,7 @@ ControlPlayList::ControlPlayList( string id, bool visible, int width, ...@@ -79,6 +79,7 @@ ControlPlayList::ControlPlayList( string id, bool visible, int width,
// Scroll // Scroll
StartIndex = 0; StartIndex = 0;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
ControlPlayList::~ControlPlayList() ControlPlayList::~ControlPlayList()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC * skin-main.cpp: skins plugin for VLC
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.41 2003/06/22 17:52:12 gbazin Exp $ * $Id: skin_main.cpp,v 1.42 2003/06/23 20:35:36 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -333,7 +333,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -333,7 +333,6 @@ static void Run( intf_thread_t *p_intf )
msg_Dbg( p_intf, "Load theme time : %i ms", OSAPI_GetTime() - a ); msg_Dbg( p_intf, "Load theme time : %i ms", OSAPI_GetTime() - a );
// Refresh the whole interface
OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true ); OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
OSRun( p_intf ); OSRun( p_intf );
...@@ -390,8 +389,6 @@ int SkinManage( intf_thread_t *p_intf ) ...@@ -390,8 +389,6 @@ int SkinManage( intf_thread_t *p_intf )
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_input = NULL;
} }
OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (long)false );
#if !defined(MODULE_NAME_IS_basic_skins) //FIXME #if !defined(MODULE_NAME_IS_basic_skins) //FIXME
// Update the log window // Update the log window
p_intf->p_sys->p_dialogs->MessagesDlg->UpdateLog(); p_intf->p_sys->p_dialogs->MessagesDlg->UpdateLog();
...@@ -419,7 +416,6 @@ int SkinManage( intf_thread_t *p_intf ) ...@@ -419,7 +416,6 @@ int SkinManage( intf_thread_t *p_intf )
p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ), p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
(long)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) ); (long)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
// Refresh slider // Refresh slider
// if( p_input->stream.b_seekable && p_intf->p_sys->b_playing ) // if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
if( p_input->stream.b_seekable ) if( p_input->stream.b_seekable )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class * vlcproc.cpp: VlcProc class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.38 2003/06/22 12:46:49 asmax Exp $ * $Id: vlcproc.cpp,v 1.39 2003/06/23 20:35:36 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -47,10 +47,27 @@ ...@@ -47,10 +47,27 @@
VlcProc::VlcProc( intf_thread_t *_p_intf ) VlcProc::VlcProc( intf_thread_t *_p_intf )
{ {
p_intf = _p_intf; p_intf = _p_intf;
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist != NULL )
{
// We want to be noticed of playlit changes
var_AddCallback( p_playlist, "intf-change", RefreshCallback, this );
vlc_object_release( p_playlist );
}
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
VlcProc::~VlcProc() VlcProc::~VlcProc()
{ {
// Remove the refresh callback
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist != NULL )
{
var_DelCallback( p_playlist, "intf-change", RefreshCallback, this );
vlc_object_release( p_playlist );
}
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool VlcProc::EventProc( Event *evt ) bool VlcProc::EventProc( Event *evt )
...@@ -145,7 +162,7 @@ bool VlcProc::EventProc( Event *evt ) ...@@ -145,7 +162,7 @@ bool VlcProc::EventProc( Event *evt )
return true; return true;
case VLC_INTF_REFRESH: case VLC_INTF_REFRESH:
InterfaceRefresh( (bool)evt->GetParam2() ); InterfaceRefresh();
return true; return true;
case VLC_TEST_ALL_CLOSED: case VLC_TEST_ALL_CLOSED:
...@@ -225,7 +242,16 @@ bool VlcProc::IsClosing() ...@@ -225,7 +242,16 @@ bool VlcProc::IsClosing()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Private methods // Private methods
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void VlcProc::InterfaceRefresh( bool All )
// Refresh callback
int VlcProc::RefreshCallback( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
( (VlcProc*)param )->InterfaceRefresh();
return VLC_SUCCESS;
}
void VlcProc::InterfaceRefresh()
{ {
// Shortcut pointers // Shortcut pointers
intf_sys_t *Sys = p_intf->p_sys; intf_sys_t *Sys = p_intf->p_sys;
...@@ -308,7 +334,6 @@ void VlcProc::InterfaceRefresh( bool All ) ...@@ -308,7 +334,6 @@ void VlcProc::InterfaceRefresh( bool All )
Sys->i_size = 0; Sys->i_size = 0;
} }
} }
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void VlcProc::EnabledEvent( string type, bool state ) void VlcProc::EnabledEvent( string type, bool state )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcproc.h: VlcProc class * vlcproc.h: VlcProc class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlcproc.h,v 1.7 2003/06/09 12:33:16 asmax Exp $ * $Id: vlcproc.h,v 1.8 2003/06/23 20:35:36 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -52,7 +52,10 @@ class VlcProc ...@@ -52,7 +52,10 @@ class VlcProc
void ChangeVolume( unsigned int msg, long param ); void ChangeVolume( unsigned int msg, long param );
void AddNetworkUDP( int port ); void AddNetworkUDP( int port );
void InterfaceRefresh( bool All = false ); static int RefreshCallback( vlc_object_t *p_this,
const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val,
void *param );
void InterfaceRefresh();
void EnabledEvent( string type, bool state ); void EnabledEvent( string type, bool state );
public: public:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.36 2003/05/26 19:06:47 gbazin Exp $ * $Id: playlist.c,v 1.37 2003/06/23 20:35:36 asmax Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -557,6 +557,7 @@ static void SkipItem( playlist_t *p_playlist, int i_arg ) ...@@ -557,6 +557,7 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
{ {
int i_oldindex = p_playlist->i_index; int i_oldindex = p_playlist->i_index;
vlc_bool_t b_random; vlc_bool_t b_random;
vlc_value_t val;
/* If the playlist is empty, there is no current item */ /* If the playlist is empty, there is no current item */
if( p_playlist->i_size == 0 ) if( p_playlist->i_size == 0 )
...@@ -604,6 +605,9 @@ static void SkipItem( playlist_t *p_playlist, int i_arg ) ...@@ -604,6 +605,9 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
{ {
p_playlist->i_index = p_playlist->i_size - 1; p_playlist->i_index = p_playlist->i_size - 1;
} }
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-change", val );
} }
/***************************************************************************** /*****************************************************************************
......
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