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