VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, vlc_bool_t ) );
VLC_EXPORT( int, playlist_NodeEmpty, ( playlist_t *, playlist_item_t *, vlc_bool_t ) );
-
/* Tree walking */
playlist_item_t *playlist_FindNextFromParent( playlist_t *p_playlist,
int i_view,
return( b_empty );
}
+
+
/**
* @}
*/
/* Change the item to a node */
if( p_parent->i_children == -1 )
{
- playlist_ItemToNode( p_playlist,p_parent );
+ playlist_LockItemToNode( p_playlist,p_parent );
}
/* get the first directory entry */
static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t oval, vlc_value_t nval, void *param );
-
/*****************************************************************************
* Event Table.
*****************************************************************************/
var_DelCallback( p_playlist, "item-change", ItemChanged, this );
var_DelCallback( p_playlist, "playlist-current", PlaylistNext, this );
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
+ var_DelCallback( p_playlist, "item-append", ItemAppended, this );
var_DelCallback( p_playlist, "item-deleted", ItemDeleted, this );
vlc_object_release( p_playlist );
}
{
return;
}
+ Preparse( p_playlist );
+ vlc_object_release( p_playlist );
+}
+
+void Playlist::Preparse( playlist_t *p_playlist )
+{
if( p_popup_item != NULL )
{
if( p_popup_item->i_children == -1 )
{
- wxMutexGuiLeave();
playlist_PreparseEnqueue( p_playlist, &p_popup_item->input );
- wxMutexGuiEnter();
}
else
{
i_popup_item = FindItem( treectrl->GetRootItem(),
p_parent->pp_children[i] );
p_popup_item = p_parent->pp_children[i];
- OnPopupPreparse( dummy );
+ Preparse( p_playlist );
}
}
}
- vlc_object_release( p_playlist );
}
void Playlist::OnPopupDel( wxMenuEvent& event )
void OnPopupInfo( wxMenuEvent& event );
void Rebuild();
+ void Preparse( playlist_t *p_playlist );
+
/* Update */
void UpdateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
void UpdateNodeChildren( playlist_t *, playlist_item_t*, wxTreeItemId );
/* Create Object Variables for private use only */
input_ConfigVarInit( p_input );
+ input_ControlVarInit( p_input );
p_input->input.i_cr_average = var_GetInteger( p_input, "cr-average" );
* \return returns VLC_SUCCESS or an error
*/
int playlist_Delete( playlist_t * p_playlist, int i_id )
+{
+ return playlist_DeleteInternal( p_playlist, i_id );
+}
+int playlist_DeleteInternal( playlist_t * p_playlist, int i_id,
+ vlc_bool_t b_force )
{
vlc_value_t val;
int i;
if( p_obj->i_waiting > 0 )
{
- input_Preparse( p_playlist, p_obj->pp_waiting[0] );
- var_SetInteger( p_playlist, "item-change",
- p_obj->pp_waiting[0]->i_id );
+ input_item_t *p_current = p_obj->pp_waiting[0];
REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
+ vlc_mutex_unlock( &p_obj->object_lock );
+ input_Preparse( p_playlist, p_current );
+ var_SetInteger( p_playlist, "item-change", p_current->i_id );
+ vlc_mutex_lock( &p_obj->object_lock );
+ fprintf(stderr, "END\n");
}
b_sleep = ( p_obj->i_waiting == 0 );
void playlist_NodeDump( playlist_t *p_playlist, playlist_item_t *p_item,
int i_level );
+int playlist_NodeDeleteInternal( playlist_t *p_playlist,
+ playlist_item_t *p_root,
+ vlc_bool_t b_delete_items, vlc_bool_t b_force );
+
+
/**********************************************************************
* Exported View management functions
**********************************************************************/
*/
int playlist_ViewDelete( playlist_t *p_playlist,playlist_view_t *p_view )
{
+ playlist_NodeDeleteInternal( p_playlist, p_view->p_root, VLC_TRUE,
+ VLC_TRUE );
REMOVE_ELEM( p_playlist->pp_views, p_playlist->i_views, 0 );
return VLC_SUCCESS;
}
/**
* Remove all the children of a node
*
+ * This function must be entered with the playlist lock
+ *
* \param p_playlist the playlist
* \param p_root the node
* \param b_delete_items do we have to delete the children items ?
*/
int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
vlc_bool_t b_delete_items )
+{
+ return playlist_NodeDeleteInternal( p_playlist, p_root,
+ b_delete_items, VLC_FALSE );
+}
+
+int playlist_NodeDeleteInternal( playlist_t *p_playlist,
+ playlist_item_t *p_root,
+ vlc_bool_t b_delete_items, vlc_bool_t b_force )
{
int i;
if( p_root->i_children == -1 )
}
}
/* Delete the node */
- if( p_root->i_flags & PLAYLIST_RO_FLAG )
+ if( p_root->i_flags & PLAYLIST_RO_FLAG && !b_force )
{
- msg_Dbg( p_playlist, "unable to remove node, write-protected" );
}
else
{