Commit 8a163fd8 authored by Laurent Aimar's avatar Laurent Aimar

Renamed playlist "item-append/deleted" to "playlist-item-append/deleted".

I hope they will reduce the risk of error until the playlist API is rewritten.
parent bf099fea
...@@ -122,8 +122,8 @@ TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t); ...@@ -122,8 +122,8 @@ TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t);
* * - "item-current": It will contains a input_item_t->i_id of the current * * - "item-current": It will contains a input_item_t->i_id of the current
* item being played. * item being played.
* *
* - "item-append": It will contains a pointer to a playlist_add_t. * - "playlist-item-append": It will contains a pointer to a playlist_add_t.
* - "item-deleted": It will contains the playlist_item_t->i_id of a deleted * - "playlist-item-deleted": It will contains the playlist_item_t->i_id of a deleted
* playlist_item_t. * playlist_item_t.
* *
* XXX Be really carefull, playlist_item_t->i_id and input_item_t->i_id are not * XXX Be really carefull, playlist_item_t->i_id and input_item_t->i_id are not
......
...@@ -759,8 +759,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -759,8 +759,8 @@ static int Open( vlc_object_t *p_this )
PL_LOCK; PL_LOCK;
var_AddCallback( p_playlist, "item-current", TrackChange, p_intf ); var_AddCallback( p_playlist, "item-current", TrackChange, p_intf );
var_AddCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf ); var_AddCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf );
var_AddCallback( p_playlist, "item-append", TrackListChangeEmit, p_intf ); var_AddCallback( p_playlist, "playlist-item-append", TrackListChangeEmit, p_intf );
var_AddCallback( p_playlist, "item-deleted", TrackListChangeEmit, p_intf ); var_AddCallback( p_playlist, "playlist-item-deleted", TrackListChangeEmit, p_intf );
var_AddCallback( p_playlist, "random", StatusChangeEmit, p_intf ); var_AddCallback( p_playlist, "random", StatusChangeEmit, p_intf );
var_AddCallback( p_playlist, "repeat", StatusChangeEmit, p_intf ); var_AddCallback( p_playlist, "repeat", StatusChangeEmit, p_intf );
var_AddCallback( p_playlist, "loop", StatusChangeEmit, p_intf ); var_AddCallback( p_playlist, "loop", StatusChangeEmit, p_intf );
...@@ -788,8 +788,8 @@ static void Close ( vlc_object_t *p_this ) ...@@ -788,8 +788,8 @@ static void Close ( vlc_object_t *p_this )
var_DelCallback( p_playlist, "item-current", TrackChange, p_intf ); var_DelCallback( p_playlist, "item-current", TrackChange, p_intf );
var_DelCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf ); var_DelCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf );
var_DelCallback( p_playlist, "item-append", TrackListChangeEmit, p_intf ); var_DelCallback( p_playlist, "playlist-item-append", TrackListChangeEmit, p_intf );
var_DelCallback( p_playlist, "item-deleted", TrackListChangeEmit, p_intf ); var_DelCallback( p_playlist, "playlist-item-deleted", TrackListChangeEmit, p_intf );
var_DelCallback( p_playlist, "random", StatusChangeEmit, p_intf ); var_DelCallback( p_playlist, "random", StatusChangeEmit, p_intf );
var_DelCallback( p_playlist, "repeat", StatusChangeEmit, p_intf ); var_DelCallback( p_playlist, "repeat", StatusChangeEmit, p_intf );
var_DelCallback( p_playlist, "loop", StatusChangeEmit, p_intf ); var_DelCallback( p_playlist, "loop", StatusChangeEmit, p_intf );
...@@ -861,7 +861,7 @@ static int TrackListChangeEmit( vlc_object_t *p_this, const char *psz_var, ...@@ -861,7 +861,7 @@ static int TrackListChangeEmit( vlc_object_t *p_this, const char *psz_var,
VLC_UNUSED(oldval); VLC_UNUSED(oldval);
intf_thread_t *p_intf = p_data; intf_thread_t *p_intf = p_data;
if( !strcmp( psz_var, "item-append" ) ) if( !strcmp( psz_var, "playlist-item-append" ) )
{ {
/* don't signal when items are added/removed in p_category */ /* don't signal when items are added/removed in p_category */
playlist_t *p_playlist = (playlist_t*)p_this; playlist_t *p_playlist = (playlist_t*)p_this;
......
...@@ -207,8 +207,8 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame, ...@@ -207,8 +207,8 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, this ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, this );
var_AddCallback( p_playlist, "item-append", PlaylistChanged, this ); var_AddCallback( p_playlist, "playlist-item-append", PlaylistChanged, this );
var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, this ); var_AddCallback( p_playlist, "playlist-item-deleted", PlaylistChanged, this );
var_AddCallback( p_playlist, "item-current", PlaylistChanged, this ); var_AddCallback( p_playlist, "item-current", PlaylistChanged, this );
char psz_tmp[1024]; char psz_tmp[1024];
......
...@@ -1413,8 +1413,8 @@ static void * manage_cleanup( void * args ) ...@@ -1413,8 +1413,8 @@ static void * manage_cleanup( void * args )
var_AddCallback( p_playlist, "item-current", PlaylistChanged, self ); var_AddCallback( p_playlist, "item-current", PlaylistChanged, self );
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-append", PlaylistChanged, self ); var_AddCallback( p_playlist, "playlist-item-append", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, self ); var_AddCallback( p_playlist, "playlist-item-deleted", PlaylistChanged, self );
pl_Release( p_intf ); pl_Release( p_intf );
...@@ -1436,8 +1436,8 @@ static void * manage_cleanup( void * args ) ...@@ -1436,8 +1436,8 @@ static void * manage_cleanup( void * args )
var_AddCallback( p_playlist, "item-current", PlaylistChanged, self ); var_AddCallback( p_playlist, "item-current", PlaylistChanged, self );
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-append", PlaylistChanged, self ); var_AddCallback( p_playlist, "playlist-item-append", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, self ); var_AddCallback( p_playlist, "playlist-item-deleted", PlaylistChanged, self );
struct manage_cleanup_stack stack = { p_intf, &p_input, p_playlist, self }; struct manage_cleanup_stack stack = { p_intf, &p_input, p_playlist, self };
pthread_cleanup_push(manage_cleanup, &stack); pthread_cleanup_push(manage_cleanup, &stack);
......
...@@ -385,7 +385,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -385,7 +385,7 @@ static void Run( intf_thread_t *p_intf )
*/ */
PlaylistRebuild( p_intf ); PlaylistRebuild( p_intf );
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, p_intf ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, p_intf );
var_AddCallback( p_playlist, "item-append", PlaylistChanged, p_intf ); var_AddCallback( p_playlist, "playlist-item-append", PlaylistChanged, p_intf );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, p_intf ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, p_intf );
while( vlc_object_alive( p_intf ) ) while( vlc_object_alive( p_intf ) )
...@@ -438,7 +438,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -438,7 +438,7 @@ static void Run( intf_thread_t *p_intf )
} }
} }
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, p_intf ); var_DelCallback( p_playlist, "intf-change", PlaylistChanged, p_intf );
var_DelCallback( p_playlist, "item-append", PlaylistChanged, p_intf ); var_DelCallback( p_playlist, "playlist-item-append", PlaylistChanged, p_intf );
var_DelCallback( p_playlist, "item-change", PlaylistChanged, p_intf ); var_DelCallback( p_playlist, "item-change", PlaylistChanged, p_intf );
vlc_restorecancel( canc ); vlc_restorecancel( canc );
} }
......
...@@ -224,8 +224,8 @@ void PLModel::addCallbacks() ...@@ -224,8 +224,8 @@ void PLModel::addCallbacks()
var_AddCallback( p_playlist, "item-current", PlaylistNext, this ); var_AddCallback( p_playlist, "item-current", PlaylistNext, this );
/* One item has been updated */ /* One item has been updated */
var_AddCallback( p_playlist, "item-change", ItemChanged, this ); var_AddCallback( p_playlist, "item-change", ItemChanged, this );
var_AddCallback( p_playlist, "item-append", ItemAppended, this ); var_AddCallback( p_playlist, "playlist-item-append", ItemAppended, this );
var_AddCallback( p_playlist, "item-deleted", ItemDeleted, this ); var_AddCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
} }
void PLModel::delCallbacks() void PLModel::delCallbacks()
...@@ -233,8 +233,8 @@ void PLModel::delCallbacks() ...@@ -233,8 +233,8 @@ void PLModel::delCallbacks()
var_DelCallback( p_playlist, "item-change", ItemChanged, this ); var_DelCallback( p_playlist, "item-change", ItemChanged, this );
var_DelCallback( p_playlist, "item-current", PlaylistNext, this ); var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this ); var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_DelCallback( p_playlist, "item-append", ItemAppended, this ); var_DelCallback( p_playlist, "playlist-item-append", ItemAppended, this );
var_DelCallback( p_playlist, "item-deleted", ItemDeleted, this ); var_DelCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
} }
void PLModel::activateItem( const QModelIndex &index ) void PLModel::activateItem( const QModelIndex &index )
......
...@@ -143,11 +143,11 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ), ...@@ -143,11 +143,11 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
var_AddCallback( pIntf->p_sys->p_playlist, "intf-change", var_AddCallback( pIntf->p_sys->p_playlist, "intf-change",
onIntfChange, this ); onIntfChange, this );
// Called when a playlist item is added // 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 ); onItemAppend, this );
// Called when a playlist item is deleted // Called when a playlist item is deleted
// TODO: properly handle item-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 ); onItemDelete, this );
// Called when the "interface shower" wants us to show the skin // Called when the "interface shower" wants us to show the skin
var_AddCallback( pIntf->p_libvlc, "intf-show", var_AddCallback( pIntf->p_libvlc, "intf-show",
...@@ -183,9 +183,9 @@ VlcProc::~VlcProc() ...@@ -183,9 +183,9 @@ VlcProc::~VlcProc()
var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change", var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
onIntfChange, this ); onIntfChange, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-append", var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-item-append",
onItemAppend, this ); onItemAppend, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted", var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-item-deleted",
onItemDelete, this ); onItemDelete, this );
var_DelCallback( getIntf()->p_libvlc, "intf-show", var_DelCallback( getIntf()->p_libvlc, "intf-show",
onIntfShow, this ); onIntfShow, this );
......
...@@ -273,10 +273,10 @@ static void VariablesInit( playlist_t *p_playlist ) ...@@ -273,10 +273,10 @@ static void VariablesInit( playlist_t *p_playlist )
var_Create( p_playlist, "item-change", VLC_VAR_INTEGER ); var_Create( p_playlist, "item-change", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "item-change", -1 ); var_SetInteger( p_playlist, "item-change", -1 );
var_Create( p_playlist, "item-deleted", VLC_VAR_INTEGER ); var_Create( p_playlist, "playlist-item-deleted", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "item-deleted", -1 ); var_SetInteger( p_playlist, "playlist-item-deleted", -1 );
var_Create( p_playlist, "item-append", VLC_VAR_ADDRESS ); var_Create( p_playlist, "playlist-item-append", VLC_VAR_ADDRESS );
var_Create( p_playlist, "item-current", VLC_VAR_INTEGER ); var_Create( p_playlist, "item-current", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "item-current", -1 ); var_SetInteger( p_playlist, "item-current", -1 );
......
...@@ -789,7 +789,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id, ...@@ -789,7 +789,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
if( b_signal ) if( b_signal )
vlc_cond_signal( &pl_priv(p_playlist)->signal ); vlc_cond_signal( &pl_priv(p_playlist)->signal );
var_Set( p_playlist, "item-append", val ); var_Set( p_playlist, "playlist-item-append", val );
free( p_add ); free( p_add );
} }
...@@ -888,7 +888,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item, ...@@ -888,7 +888,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
return playlist_NodeDelete( p_playlist, p_item, true, false ); return playlist_NodeDelete( p_playlist, p_item, true, false );
} }
pl_priv(p_playlist)->b_reset_currently_playing = true; pl_priv(p_playlist)->b_reset_currently_playing = true;
var_SetInteger( p_playlist, "item-deleted", i_id ); var_SetInteger( p_playlist, "playlist-item-deleted", i_id );
/* Remove the item from the bank */ /* Remove the item from the bank */
ARRAY_BSEARCH( p_playlist->all_items,->i_id, int, i_id, i ); ARRAY_BSEARCH( p_playlist->all_items,->i_id, int, i_id, i );
......
...@@ -164,7 +164,7 @@ int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root, ...@@ -164,7 +164,7 @@ int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
else else
{ {
int i; int i;
var_SetInteger( p_playlist, "item-deleted", p_root->i_id ); var_SetInteger( p_playlist, "playlist-item-deleted", p_root->i_id );
ARRAY_BSEARCH( p_playlist->all_items, ->i_id, int, ARRAY_BSEARCH( p_playlist->all_items, ->i_id, int,
p_root->i_id, i ); p_root->i_id, i );
if( i != -1 ) if( i != -1 )
......
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