Mercurial > mplayer.hg
comparison playtree.h @ 9290:0e043196d176
this patch adds a high-level-api to playtree, allowing to use it more easily
and hopefully also letting one doing less mistakes, as current low-level-api
is not rock-solid ...
patch by Fabian Franz <FabianFranz@gmx.de>
author | arpi |
---|---|
date | Wed, 05 Feb 2003 23:02:05 +0000 |
parents | 5c15777f1c07 |
children | 1a14fde7680d |
comparison
equal
deleted
inserted
replaced
9289:f08b6945e839 | 9290:0e043196d176 |
---|---|
164 play_tree_cleanup(play_tree_t* pt); | 164 play_tree_cleanup(play_tree_t* pt); |
165 | 165 |
166 play_tree_t* | 166 play_tree_t* |
167 parse_playlist_file(char* file); | 167 parse_playlist_file(char* file); |
168 | 168 |
169 // Highlevel API with pt-suffix to different from low-level API | |
170 // by Fabian Franz (mplayer@fabian-franz.de) | |
171 | |
172 // Cleanups pt and creates a new iter | |
173 play_tree_iter_t* pt_iter_create(play_tree_t** pt, struct m_config* config); | |
174 | |
175 // Frees the iter | |
176 void pt_iter_destroy(play_tree_iter_t** iter); | |
177 | |
178 // Gets the next available file in the direction (d=-1 || d=+1) | |
179 char* pt_iter_get_file(play_tree_iter_t* iter, int d); | |
180 | |
181 // Two Macros that implement forward and backward direction | |
182 #define pt_iter_get_next_file(iter) pt_iter_get_file(iter, 1) | |
183 #define pt_iter_get_prev_file(iter) pt_iter_get_file(iter, -1) | |
184 | |
185 // Inserts entry into the playtree | |
186 void pt_iter_insert_entry(play_tree_iter_t* iter, play_tree_t* entry); | |
187 | |
188 //Replaces current entry in playtree with entry | |
189 //by doing insert and remove | |
190 void pt_iter_replace_entry(play_tree_iter_t* iter, play_tree_t* entry); | |
191 | |
192 // Adds a new file to the playtree, | |
193 // if it is not valid it is created | |
194 void pt_add_file(play_tree_t** ppt, char* filename); | |
195 | |
196 // Performs a convert to playtree-syntax, by concat path/file | |
197 // and performs pt_add_file | |
198 void pt_add_gui_file(play_tree_t** ppt, char* path, char* file); | |
199 | |
200 //Two macros to use only the iter and not the other things | |
201 #define pt_iter_add_file(iter, filename) pt_add_file(&iter->tree, filename) | |
202 #define pt_iter_add_gui_file(iter, path, name) pt_add_gui_file(&iter->tree, path, name) | |
203 | |
204 // Resets the iter and goes back to head | |
205 void pt_iter_goto_head(play_tree_iter_t* iter); | |
206 | |
169 #endif | 207 #endif |