* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.h,v 1.38 2003/05/11 19:09:51 hartman Exp $
+ * $Id: intf.h,v 1.39 2003/05/15 01:23:05 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
#define _ANS(s) [[NSApp localizedString: _(s)] substringFromIndex:2]
int ExecuteOnMainThread( id target, SEL sel, void * p_arg );
+int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
+ vlc_value_t old_val, vlc_value_t new_val, void *param );
/*****************************************************************************
* intf_sys_t: description and status of the interface
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.82 2003/05/12 01:17:10 hartman Exp $
+ * $Id: intf.m,v 1.83 2003/05/15 01:23:05 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
return( i_ret );
}
+/*****************************************************************************
+ * playlistChanged: Callback triggered by the intf-change playlist
+ * variable, to let the intf update the playlist.
+ *****************************************************************************/
+int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
+ vlc_value_t old_val, vlc_value_t new_val, void *param )
+{
+ intf_thread_t * p_intf = [NSApp getIntf];
+ p_intf->p_sys->b_playlist_update = VLC_TRUE;
+ p_intf->p_sys->b_intf_update = VLC_TRUE;
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* VLCMain implementation
*****************************************************************************/
if( p_playlist != NULL )
{
+ var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
vlc_mutex_lock( &p_playlist->object_lock );
[self manage: p_playlist];
intf_thread_t * p_intf = [NSApp getIntf];
- if( var_Get( (vlc_object_t *)p_playlist, "intf-change", &val ) >= 0 &&
- val.b_bool )
- {
- p_intf->p_sys->b_playlist_update = VLC_TRUE;
- p_intf->p_sys->b_intf_update = VLC_TRUE;
- }
-
#define p_input p_playlist->p_input
if( p_input )
if ( p_intf->p_sys->b_playlist_update )
{
- vlc_value_t val;
-
- val.b_bool = FALSE;
- var_Set( (vlc_object_t *)p_playlist, "intf-change", val );
-
[o_playlist playlistUpdated];
-
p_intf->p_sys->b_playlist_update = VLC_FALSE;
}