Mercurial > mplayer.hg
annotate playtree.h @ 33180:422e5d306d44
Group and sort configuration variable definitions.
author | ib |
---|---|
date | Fri, 15 Apr 2011 14:34:17 +0000 |
parents | c55e842e9ef2 |
children | 2df1a5fee8a7 |
rev | line source |
---|---|
30429
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
1 /* |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
2 * This file is part of MPlayer. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
3 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
7 * (at your option) any later version. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
8 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
12 * GNU General Public License for more details. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
13 * |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
17 */ |
c1a3f1bbba26
Add license header to all top-level files missing them.
diego
parents:
29263
diff
changeset
|
18 |
26029 | 19 #ifndef MPLAYER_PLAYTREE_H |
20 #define MPLAYER_PLAYTREE_H | |
18265 | 21 |
22 /// \file | |
23 /// \ingroup Playtree | |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
24 |
31179 | 25 struct stream; |
8164
487cfc28525d
New config system + cleanup of header inter dependency
albeu
parents:
5217
diff
changeset
|
26 struct m_config; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
27 |
18265 | 28 /// \defgroup PlaytreeIterReturn Playtree iterator return code |
29 /// \ingroup PlaytreeIter | |
30 ///@{ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
31 #define PLAY_TREE_ITER_ERROR 0 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
32 #define PLAY_TREE_ITER_ENTRY 1 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
33 #define PLAY_TREE_ITER_NODE 2 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
34 #define PLAY_TREE_ITER_END 3 |
18265 | 35 ///@} |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
36 |
18265 | 37 /// \defgroup PlaytreeEntryTypes Playtree entry types |
38 /// \ingroup Playtree | |
39 ///@{ | |
4220
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
40 #define PLAY_TREE_ENTRY_NODE -1 |
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
41 #define PLAY_TREE_ENTRY_DVD 0 |
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
42 #define PLAY_TREE_ENTRY_VCD 1 |
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
43 #define PLAY_TREE_ENTRY_TV 2 |
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
44 #define PLAY_TREE_ENTRY_FILE 3 |
18265 | 45 ///@} |
4220
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
46 |
18265 | 47 |
48 /// \defgroup PlaytreeEntryFlags Playtree flags | |
49 /// \ingroup Playtree | |
50 ///@{ | |
23872 | 51 /// Play the item children in random order. |
8174 | 52 #define PLAY_TREE_RND (1<<0) |
18265 | 53 /// Playtree flags used by the iterator to mark items already "randomly" played. |
8174 | 54 #define PLAY_TREE_RND_PLAYED (1<<8) |
18265 | 55 ///@} |
8174 | 56 |
18265 | 57 /// \defgroup PlaytreeIterMode Playtree iterator mode |
58 /// \ingroup PlaytreeIter | |
59 ///@{ | |
8174 | 60 #define PLAY_TREE_ITER_NORMAL 0 |
61 #define PLAY_TREE_ITER_RND 1 | |
18265 | 62 ///@} |
63 | |
64 /// \defgroup Playtree | |
65 ///@{ | |
8174 | 66 |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
67 typedef struct play_tree play_tree_t; |
18265 | 68 /// \ingroup PlaytreeIter |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
69 typedef struct play_tree_iter play_tree_iter_t; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
70 typedef struct play_tree_param play_tree_param_t; |
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
71 |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
72 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
73 #if 0 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
74 typedef struct play_tree_info play_tree_info_t; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
75 // TODO : a attrib,val pair system and not something hardcoded |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
76 struct play_tree_info { |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
77 char* title; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
78 char* author; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
79 char* copyright; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
80 char* abstract; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
81 // Some more ?? |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
82 } |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
83 #endif |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
84 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
85 struct play_tree_param { |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
86 char* name; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
87 char* value; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
88 }; |
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
89 |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
90 |
18265 | 91 /// Playtree item |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
92 struct play_tree { |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
93 play_tree_t* parent; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
94 play_tree_t* child; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
95 play_tree_t* next; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
96 play_tree_t* prev; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
97 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
98 //play_tree_info_t info; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
99 play_tree_param_t* params; |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
100 int loop; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
101 char** files; |
4220
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
102 int entry_type; |
8174 | 103 int flags; |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
104 }; |
18265 | 105 |
106 | |
107 /// \defgroup PlaytreeIter Playtree iterator | |
108 /// \ingroup Playtree | |
109 ///@{ | |
110 | |
111 /// Playtree iterator | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
112 struct play_tree_iter { |
18265 | 113 /// Root of the iterated tree. |
114 play_tree_t* root; | |
115 /// Current position in the tree. | |
116 play_tree_t* tree; | |
117 /// \ref Config used. | |
118 struct m_config* config; | |
119 /// Looping status | |
120 int loop; | |
121 /// Selected file in the current item. | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
122 int file; |
18265 | 123 /// Number of files in the current item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
124 int num_files; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
125 int entry_pushed; |
8174 | 126 int mode; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26029
diff
changeset
|
127 |
18265 | 128 /// loop/valid stack to save/revert status when we go up/down. |
129 int* status_stack; | |
130 /// status stack size | |
131 int stack_size; | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
132 }; |
18265 | 133 ///@} |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
134 |
18265 | 135 /// Create a new empty playtree item. |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26029
diff
changeset
|
136 play_tree_t* |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
137 play_tree_new(void); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
138 |
18265 | 139 /// Free a playtree item. |
140 /** \param pt Item to free. | |
23872 | 141 * \param children If non-zero the item's children are recursively freed. |
18265 | 142 */ |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
143 void |
23872 | 144 play_tree_free(play_tree_t* pt, int children); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
145 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
146 |
18265 | 147 /// Free an item and its siblings. |
148 /** \param pt Item to free. | |
23872 | 149 * \param children If non-zero the items' children are recursively freed. |
18265 | 150 */ |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
151 void |
23872 | 152 play_tree_free_list(play_tree_t* pt, int children); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
153 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
154 |
23872 | 155 /// Set the children of a playtree item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
156 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
157 play_tree_set_child(play_tree_t* pt, play_tree_t* child); |
18265 | 158 |
159 /// Set the parent of a playtree item. | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
160 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
161 play_tree_set_parent(play_tree_t* pt, play_tree_t* parent); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
162 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
163 |
18265 | 164 /// Append an item after its siblings. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
165 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
166 play_tree_append_entry(play_tree_t* pt, play_tree_t* entry); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
167 |
18265 | 168 /// Prepend an item before its siblings. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
169 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
170 play_tree_prepend_entry(play_tree_t* pt, play_tree_t* entry); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
171 |
18265 | 172 /// Insert an item right after a siblings. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
173 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
174 play_tree_insert_entry(play_tree_t* pt, play_tree_t* entry); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
175 |
18265 | 176 /// Detach an item from the tree. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
177 void |
23872 | 178 play_tree_remove(play_tree_t* pt, int free_it,int with_children); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
179 |
18265 | 180 /// Add a file to an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
181 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
182 play_tree_add_file(play_tree_t* pt,char* file); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
183 |
18265 | 184 /// Remove a file from an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
185 int |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
186 play_tree_remove_file(play_tree_t* pt,char* file); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
187 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
188 |
18265 | 189 /// Add a config paramter to an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
190 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
191 play_tree_set_param(play_tree_t* pt, char* name, char* val); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
192 |
18265 | 193 /// Remove a config parameter from an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
194 int |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
195 play_tree_unset_param(play_tree_t* pt, char* name); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
196 |
18265 | 197 /// Copy the config parameters from one item to another. |
5217
3e7152b383ca
Set the params given to a playlist url to the playlist
albeu
parents:
4220
diff
changeset
|
198 void |
3e7152b383ca
Set the params given to a playlist url to the playlist
albeu
parents:
4220
diff
changeset
|
199 play_tree_set_params_from(play_tree_t* dest,play_tree_t* src); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
200 |
18265 | 201 /// \addtogroup PlaytreeIter |
202 ///@{ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
203 |
18265 | 204 /// Create a new iterator. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
205 play_tree_iter_t* |
8164
487cfc28525d
New config system + cleanup of header inter dependency
albeu
parents:
5217
diff
changeset
|
206 play_tree_iter_new(play_tree_t* pt, struct m_config* config); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
207 |
18265 | 208 /// Duplicate an iterator. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
209 play_tree_iter_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
210 play_tree_iter_new_copy(play_tree_iter_t* old); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
211 |
18265 | 212 /// Free an iterator. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
213 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
214 play_tree_iter_free(play_tree_iter_t* iter); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
215 |
18265 | 216 /// Step an iterator. |
217 /** \param iter The iterator. | |
218 * \param d The direction: d > 0 == next , d < 0 == prev | |
23872 | 219 * \param with_node TRUE == stop on nodes with children, FALSE == go directly to the next child |
18265 | 220 * \return See \ref PlaytreeIterReturn. |
221 */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26029
diff
changeset
|
222 int |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
223 play_tree_iter_step(play_tree_iter_t* iter, int d,int with_nodes); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
224 |
22289
780caed72ac7
cosmetics: typo fixes, usefuLL --> useful and aswell --> as well
diego
parents:
18316
diff
changeset
|
225 /// Step up, useful to break a loop, etc. |
18265 | 226 /** \param iter The iterator. |
227 * \param d The direction: d > 0 == next , d < 0 == prev | |
23872 | 228 * \param with_node TRUE == stop on nodes with children, FALSE == go directly to the next child |
18265 | 229 * \return See \ref PlaytreeIterReturn. |
230 */ | |
231 int | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
232 play_tree_iter_up_step(play_tree_iter_t* iter, int d,int with_nodes); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
233 |
22289
780caed72ac7
cosmetics: typo fixes, usefuLL --> useful and aswell --> as well
diego
parents:
18316
diff
changeset
|
234 /// Enter a node child list, only useful when stopping on nodes. |
18265 | 235 int |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
236 play_tree_iter_down_step(play_tree_iter_t* iter, int d,int with_nodes); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
237 |
18265 | 238 /// Get a file from the current item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
239 char* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
240 play_tree_iter_get_file(play_tree_iter_t* iter, int d); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
241 |
18265 | 242 ///@} |
243 // PlaytreeIter group | |
244 | |
245 /// Create a playtree from a playlist file. | |
246 /** \ingroup PlaytreeParser | |
247 */ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
248 play_tree_t* |
31179 | 249 parse_playtree(struct stream *stream, int forced); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
250 |
18265 | 251 /// Clean a tree by destroying all empty elements. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
252 play_tree_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
253 play_tree_cleanup(play_tree_t* pt); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
254 |
18265 | 255 /// Create a playtree from a playlist file. |
256 /** \ingroup PlaytreeParser | |
257 */ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
258 play_tree_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
259 parse_playlist_file(char* file); |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
260 |
18265 | 261 /// \defgroup PtAPI Playtree highlevel API |
262 /// \ingroup Playtree | |
263 /// Highlevel API with pt-suffix to different from low-level API | |
264 /// by Fabian Franz (mplayer@fabian-franz.de). | |
265 ///@{ | |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
266 |
18316
b3be7df634b0
spelling/grammar/wording fixes in doxygen and non-doxygen comments
diego
parents:
18265
diff
changeset
|
267 // Cleans up pt and creates a new iter. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
268 play_tree_iter_t* pt_iter_create(play_tree_t** pt, struct m_config* config); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
269 |
18265 | 270 /// Frees the iter. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
271 void pt_iter_destroy(play_tree_iter_t** iter); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
272 |
18265 | 273 /// Gets the next available file in the direction (d=-1 || d=+1). |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
274 char* pt_iter_get_file(play_tree_iter_t* iter, int d); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
275 |
18265 | 276 // Two Macros that implement forward and backward direction. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
277 #define pt_iter_get_next_file(iter) pt_iter_get_file(iter, 1) |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
278 #define pt_iter_get_prev_file(iter) pt_iter_get_file(iter, -1) |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
279 |
18265 | 280 /// Inserts entry into the playtree. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
281 void pt_iter_insert_entry(play_tree_iter_t* iter, play_tree_t* entry); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
282 |
18265 | 283 /// Replaces current entry in playtree with entry by doing insert and remove. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
284 void pt_iter_replace_entry(play_tree_iter_t* iter, play_tree_t* entry); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
285 |
18265 | 286 /// Adds a new file to the playtree, if it is not valid it is created. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
287 void pt_add_file(play_tree_t** ppt, char* filename); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
288 |
31346
c55e842e9ef2
Adjust comment after the removal of the pt_iter_add_gui_file macro.
diego
parents:
31320
diff
changeset
|
289 // Macro to use only the iter and not the other things. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
290 #define pt_iter_add_file(iter, filename) pt_add_file(&iter->tree, filename) |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
291 |
18265 | 292 /// Resets the iter and goes back to head. |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
293 void pt_iter_goto_head(play_tree_iter_t* iter); |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
294 |
18265 | 295 ///@} |
296 | |
26029 | 297 ///@} |
18265 | 298 |
26029 | 299 #endif /* MPLAYER_PLAYTREE_H */ |