]> git.sesse.net Git - vlc/blob - modules/gui/skins2/vars/playtree.hpp
Qt: use QString iso std::string
[vlc] / modules / gui / skins2 / vars / playtree.hpp
1 /*****************************************************************************
2  * playtree.hpp
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Antoine Cellerier <dionoea@videolan.org>
8  *          ClĂ©ment Stenac <zorglub@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef PLAYTREE_HPP
26 #define PLAYTREE_HPP
27
28 #include <vlc_playlist.h>
29 #include "../utils/var_tree.hpp"
30
31 #include <map>
32
33 /// Variable for VLC playlist (new tree format)
34 class Playtree: public VarTree
35 {
36 public:
37     Playtree( intf_thread_t *pIntf );
38     virtual ~Playtree();
39
40     /// Remove the selected elements from the list
41     virtual void delSelected();
42
43     /// Execute the action associated to this item
44     virtual void action( VarTree *pItem );
45
46     /// Function called to notify playlist changes
47     void onChange();
48
49     /// Function called to notify playlist item update
50     void onUpdateItem( int id );
51
52     /// Function called to notify about current playing item
53     void onUpdateCurrent( bool b_active );
54
55     /// Function called to notify playlist item append
56     void onAppend( playlist_add_t * );
57
58     /// Function called to notify playlist item delete
59     void onDelete( int );
60
61     ///
62     void onUpdateSlider();
63
64     ///
65     void insertItems( VarTree& item, const list<string>& files, bool start );
66
67 private:
68     /// VLC playlist object
69     playlist_t *m_pPlaylist;
70
71     ///
72     map< int, VarTree* > m_allItems;
73
74     /// Build the list from the VLC playlist
75     void buildTree();
76
77     /// Retrieve an iterator from playlist_item_t->id
78     Iterator findById( int id );
79
80     /// Update Node's children
81     void buildNode( playlist_item_t *p_node, VarTree &m_pNode );
82 };
83
84 #endif