]> git.sesse.net Git - vlc/blob - modules/gui/skins2/commands/cmd_playtree.cpp
Merge back branch 0.8.6-playlist-vlm to trunk.
[vlc] / modules / gui / skins2 / commands / cmd_playtree.cpp
1 /*****************************************************************************
2  * cmd_playtree.cpp
3  *****************************************************************************
4  * Copyright (C) 2005 VideoLAN
5  * $Id$
6  *
7  * Authors: Antoine Cellerier <dionoea@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "cmd_playtree.hpp"
25 #include "../src/vlcproc.hpp"
26 #include "../utils/var_bool.hpp"
27
28 void CmdPlaytreeDel::execute()
29 {
30     m_rTree.delSelected();
31 }
32
33 void CmdPlaytreeSort::execute()
34 {
35     /// \todo Choose sort method/order - Need more commands
36     /// \todo Choose the correct view
37     playlist_t *p_playlist = getIntf()->p_sys->p_playlist;
38     vlc_mutex_lock( &p_playlist->object_lock );
39     playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root_onelevel,
40                                 SORT_TITLE, ORDER_NORMAL );
41     vlc_mutex_unlock( &p_playlist->object_lock );
42
43     // Ask for rebuild
44     Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
45     rVar.onChange();
46 }