Mercurial > mplayer.hg
annotate playtree.h @ 25007:eb36c7846fbe
Remove an useless conditional suggested by Emanuele Giaquinta.
author | ulion |
---|---|
date | Tue, 13 Nov 2007 15:08:17 +0000 |
parents | 4d936284a5ec |
children | 3baf6a2283da |
rev | line source |
---|---|
18265 | 1 |
2 /// \file | |
3 /// \ingroup Playtree | |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
4 |
23689
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
22289
diff
changeset
|
5 #ifndef PLAYTREE_H |
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
22289
diff
changeset
|
6 #define PLAYTREE_H |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
7 |
8164
487cfc28525d
New config system + cleanup of header inter dependency
albeu
parents:
5217
diff
changeset
|
8 struct stream_st; |
487cfc28525d
New config system + cleanup of header inter dependency
albeu
parents:
5217
diff
changeset
|
9 struct m_config; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
10 |
18265 | 11 /// \defgroup PlaytreeIterReturn Playtree iterator return code |
12 /// \ingroup PlaytreeIter | |
13 ///@{ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
14 #define PLAY_TREE_ITER_ERROR 0 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
15 #define PLAY_TREE_ITER_ENTRY 1 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
16 #define PLAY_TREE_ITER_NODE 2 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
17 #define PLAY_TREE_ITER_END 3 |
18265 | 18 ///@} |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
19 |
18265 | 20 /// \defgroup PlaytreeEntryTypes Playtree entry types |
21 /// \ingroup Playtree | |
22 ///@{ | |
4220
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
23 #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
|
24 #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
|
25 #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
|
26 #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
|
27 #define PLAY_TREE_ENTRY_FILE 3 |
18265 | 28 ///@} |
4220
fe2c20d52a25
Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual url
albeu
parents:
4156
diff
changeset
|
29 |
18265 | 30 |
31 /// \defgroup PlaytreeEntryFlags Playtree flags | |
32 /// \ingroup Playtree | |
33 ///@{ | |
23872 | 34 /// Play the item children in random order. |
8174 | 35 #define PLAY_TREE_RND (1<<0) |
18265 | 36 /// Playtree flags used by the iterator to mark items already "randomly" played. |
8174 | 37 #define PLAY_TREE_RND_PLAYED (1<<8) |
18265 | 38 ///@} |
8174 | 39 |
18265 | 40 /// \defgroup PlaytreeIterMode Playtree iterator mode |
41 /// \ingroup PlaytreeIter | |
42 ///@{ | |
8174 | 43 #define PLAY_TREE_ITER_NORMAL 0 |
44 #define PLAY_TREE_ITER_RND 1 | |
18265 | 45 ///@} |
46 | |
47 /// \defgroup Playtree | |
48 ///@{ | |
8174 | 49 |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
50 typedef struct play_tree play_tree_t; |
18265 | 51 /// \ingroup PlaytreeIter |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
52 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
|
53 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
|
54 |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
55 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
56 #if 0 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
57 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
|
58 // 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
|
59 struct play_tree_info { |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
60 char* title; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
61 char* author; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
62 char* copyright; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
63 char* abstract; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
64 // Some more ?? |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
65 } |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
66 #endif |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
67 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
68 struct play_tree_param { |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
69 char* name; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
70 char* value; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
71 }; |
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
72 |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
73 |
18265 | 74 /// Playtree item |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
75 struct play_tree { |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
76 play_tree_t* parent; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
77 play_tree_t* child; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
78 play_tree_t* next; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
79 play_tree_t* prev; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
80 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
81 //play_tree_info_t info; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
82 play_tree_param_t* params; |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
83 int loop; |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
84 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
|
85 int entry_type; |
8174 | 86 int flags; |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
87 }; |
18265 | 88 |
89 | |
90 /// \defgroup PlaytreeIter Playtree iterator | |
91 /// \ingroup Playtree | |
92 ///@{ | |
93 | |
94 /// Playtree iterator | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
95 struct play_tree_iter { |
18265 | 96 /// Root of the iterated tree. |
97 play_tree_t* root; | |
98 /// Current position in the tree. | |
99 play_tree_t* tree; | |
100 /// \ref Config used. | |
101 struct m_config* config; | |
102 /// Looping status | |
103 int loop; | |
104 /// Selected file in the current item. | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
105 int file; |
18265 | 106 /// Number of files in the current item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
107 int num_files; |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
108 int entry_pushed; |
8174 | 109 int mode; |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
110 |
18265 | 111 /// loop/valid stack to save/revert status when we go up/down. |
112 int* status_stack; | |
113 /// status stack size | |
114 int stack_size; | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
115 }; |
18265 | 116 ///@} |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
117 |
18265 | 118 /// Create a new empty playtree item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
119 play_tree_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
120 play_tree_new(void); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
121 |
18265 | 122 /// Free a playtree item. |
123 /** \param pt Item to free. | |
23872 | 124 * \param children If non-zero the item's children are recursively freed. |
18265 | 125 */ |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
126 void |
23872 | 127 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
|
128 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
129 |
18265 | 130 /// Free an item and its siblings. |
131 /** \param pt Item to free. | |
23872 | 132 * \param children If non-zero the items' children are recursively freed. |
18265 | 133 */ |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
134 void |
23872 | 135 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
|
136 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
137 |
23872 | 138 /// Set the children of a playtree item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
139 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
140 play_tree_set_child(play_tree_t* pt, play_tree_t* child); |
18265 | 141 |
142 /// Set the parent of a playtree item. | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
143 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
144 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
|
145 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
146 |
18265 | 147 /// Append an item after its siblings. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
148 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
149 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
|
150 |
18265 | 151 /// Prepend an item before its siblings. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
152 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
153 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
|
154 |
18265 | 155 /// Insert an item right after a siblings. |
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_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
|
158 |
18265 | 159 /// Detach an item from the tree. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
160 void |
23872 | 161 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
|
162 |
18265 | 163 /// Add a file to an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
164 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
165 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
|
166 |
18265 | 167 /// Remove a file from an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
168 int |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
169 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
|
170 |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
171 |
18265 | 172 /// Add a config paramter to an item. |
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_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
|
175 |
18265 | 176 /// Remove a config parameter from an item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
177 int |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
178 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
|
179 |
18265 | 180 /// 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
|
181 void |
3e7152b383ca
Set the params given to a playlist url to the playlist
albeu
parents:
4220
diff
changeset
|
182 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
|
183 |
18265 | 184 /// \addtogroup PlaytreeIter |
185 ///@{ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
186 |
18265 | 187 /// Create a new iterator. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
188 play_tree_iter_t* |
8164
487cfc28525d
New config system + cleanup of header inter dependency
albeu
parents:
5217
diff
changeset
|
189 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
|
190 |
18265 | 191 /// Duplicate an iterator. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
192 play_tree_iter_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
193 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
|
194 |
18265 | 195 /// Free an iterator. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
196 void |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
197 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
|
198 |
18265 | 199 /// Step an iterator. |
200 /** \param iter The iterator. | |
201 * \param d The direction: d > 0 == next , d < 0 == prev | |
23872 | 202 * \param with_node TRUE == stop on nodes with children, FALSE == go directly to the next child |
18265 | 203 * \return See \ref PlaytreeIterReturn. |
204 */ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
205 int |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
206 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
|
207 |
22289
780caed72ac7
cosmetics: typo fixes, usefuLL --> useful and aswell --> as well
diego
parents:
18316
diff
changeset
|
208 /// Step up, useful to break a loop, etc. |
18265 | 209 /** \param iter The iterator. |
210 * \param d The direction: d > 0 == next , d < 0 == prev | |
23872 | 211 * \param with_node TRUE == stop on nodes with children, FALSE == go directly to the next child |
18265 | 212 * \return See \ref PlaytreeIterReturn. |
213 */ | |
214 int | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
215 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
|
216 |
22289
780caed72ac7
cosmetics: typo fixes, usefuLL --> useful and aswell --> as well
diego
parents:
18316
diff
changeset
|
217 /// Enter a node child list, only useful when stopping on nodes. |
18265 | 218 int |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
219 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
|
220 |
18265 | 221 /// Get a file from the current item. |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
222 char* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
223 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
|
224 |
18265 | 225 ///@} |
226 // PlaytreeIter group | |
227 | |
228 /// Create a playtree from a playlist file. | |
229 /** \ingroup PlaytreeParser | |
230 */ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
231 play_tree_t* |
8925
5c15777f1c07
this patch adds an fallback to playlist (any but the plaintext-list format)
arpi
parents:
8174
diff
changeset
|
232 parse_playtree(struct stream_st *stream, int forced); |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
233 |
18265 | 234 /// 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
|
235 play_tree_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
236 play_tree_cleanup(play_tree_t* pt); |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
237 |
18265 | 238 /// Create a playtree from a playlist file. |
239 /** \ingroup PlaytreeParser | |
240 */ | |
4043
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
241 play_tree_t* |
25590564842f
tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff
changeset
|
242 parse_playlist_file(char* file); |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
243 |
18265 | 244 /// \defgroup PtAPI Playtree highlevel API |
245 /// \ingroup Playtree | |
246 /// Highlevel API with pt-suffix to different from low-level API | |
247 /// by Fabian Franz (mplayer@fabian-franz.de). | |
248 ///@{ | |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
249 |
18316
b3be7df634b0
spelling/grammar/wording fixes in doxygen and non-doxygen comments
diego
parents:
18265
diff
changeset
|
250 // 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
|
251 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
|
252 |
18265 | 253 /// 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
|
254 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
|
255 |
18265 | 256 /// 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
|
257 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
|
258 |
18265 | 259 // 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
|
260 #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
|
261 #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
|
262 |
18265 | 263 /// 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
|
264 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
|
265 |
18265 | 266 /// 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
|
267 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
|
268 |
18265 | 269 /// 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
|
270 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
|
271 |
18265 | 272 /// \brief Performs a convert to playtree-syntax, by concat path/file |
273 /// and performs pt_add_file | |
9290
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
274 void pt_add_gui_file(play_tree_t** ppt, char* path, char* file); |
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 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
|
277 #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
|
278 #define pt_iter_add_gui_file(iter, path, name) pt_add_gui_file(&iter->tree, path, name) |
0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
arpi
parents:
8925
diff
changeset
|
279 |
18265 | 280 /// 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
|
281 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
|
282 |
18265 | 283 ///@} |
284 | |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
4043
diff
changeset
|
285 #endif |
18265 | 286 |
287 ///@} |