Commit af10ead7 authored by Clément Stenac's avatar Clément Stenac

Implement playtree.sort() (basic implementation)

Fix a bug in delete
parent 6728be82
...@@ -32,5 +32,14 @@ void CmdPlaytreeDel::execute() ...@@ -32,5 +32,14 @@ void CmdPlaytreeDel::execute()
void CmdPlaytreeSort::execute() void CmdPlaytreeSort::execute()
{ {
// TODO // TODO: Choose sort method
playlist_t *p_playlist = getIntf()->p_sys->p_playlist;
vlc_mutex_lock( &p_playlist->object_lock );
playlist_view_t* p_view = playlist_ViewFind( p_playlist, p_playlist->status.i_view );
playlist_RecursiveNodeSort( p_playlist, p_view->p_root , SORT_TITLE, ORDER_NORMAL );
vlc_mutex_unlock( &p_playlist->object_lock );
// Ask for rebuild
Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
rVar.onChange();
} }
...@@ -140,6 +140,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update*> &rTree, ...@@ -140,6 +140,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update*> &rTree,
} }
else if ( arg->i_type == 1 ) // Global change or deletion else if ( arg->i_type == 1 ) // Global change or deletion
{ {
m_firstPos = m_rTree.begin();
makeImage(); makeImage();
} }
else if ( arg->i_type == 2 ) // Item-append else if ( arg->i_type == 2 ) // Item-append
......
...@@ -245,8 +245,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -245,8 +245,7 @@ static void Run( intf_thread_t *p_intf )
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
p_playlist->status.i_view = -1; playlist_LockControl( p_playlist, PLAYLIST_AUTOPLAY );
playlist_Control( p_playlist, PLAYLIST_AUTOPLAY );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }
......
...@@ -200,6 +200,7 @@ void Playtree::buildTree() ...@@ -200,6 +200,7 @@ void Playtree::buildTree()
buildNode( p_view->p_root, *this ); buildNode( p_view->p_root, *this );
vlc_mutex_unlock( &m_pPlaylist->object_lock ); vlc_mutex_unlock( &m_pPlaylist->object_lock );
checkParents( NULL ); // What is it ?
// checkParents( NULL );
} }
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