annotate playtree.h @ 30234:9d09ff127c25

Add and use AF_FORMAT_IS_AC3 macro.
author reimar
date Mon, 11 Jan 2010 19:23:18 +0000
parents 0f1b5b68af32
children c1a3f1bbba26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
1 #ifndef MPLAYER_PLAYTREE_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
2 #define MPLAYER_PLAYTREE_H
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
3
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
4 /// \file
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
10 /// \defgroup PlaytreeIterReturn Playtree iterator return code
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
11 /// \ingroup PlaytreeIter
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
17 ///@}
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
18
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
19 /// \defgroup PlaytreeEntryTypes Playtree entry types
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
20 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
29
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
30 /// \defgroup PlaytreeEntryFlags Playtree flags
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
31 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
32 ///@{
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
33 /// Play the item children in random order.
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
34 #define PLAY_TREE_RND (1<<0)
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
35 /// Playtree flags used by the iterator to mark items already "randomly" played.
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
36 #define PLAY_TREE_RND_PLAYED (1<<8)
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
37 ///@}
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
38
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
39 /// \defgroup PlaytreeIterMode Playtree iterator mode
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
40 /// \ingroup PlaytreeIter
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
41 ///@{
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
42 #define PLAY_TREE_ITER_NORMAL 0
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
43 #define PLAY_TREE_ITER_RND 1
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
44 ///@}
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
45
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
46 /// \defgroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
47 ///@{
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
85 int flags;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
86 };
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
87
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
88
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
89 /// \defgroup PlaytreeIter Playtree iterator
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
90 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
91 ///@{
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
92
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
95 /// Root of the iterated tree.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
96 play_tree_t* root;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
97 /// Current position in the tree.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
98 play_tree_t* tree;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
99 /// \ref Config used.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
100 struct m_config* config;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
101 /// Looping status
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
102 int loop;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
108 int mode;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
109
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
110 /// loop/valid stack to save/revert status when we go up/down.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
111 int* status_stack;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
112 /// status stack size
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
113 int stack_size;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
114 };
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
115 ///@}
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
116
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
117 /// Create a new empty playtree item.
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
118 play_tree_t*
4043
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
121 /// Free a playtree item.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
122 /** \param pt Item to free.
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
123 * \param children If non-zero the item's children are recursively freed.
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
124 */
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
125 void
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
129 /// Free an item and its siblings.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
130 /** \param pt Item to free.
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
131 * \param children If non-zero the items' children are recursively freed.
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
132 */
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
133 void
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
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
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
140
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
183 /// \addtogroup PlaytreeIter
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
184 ///@{
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
185
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
198 /// Step an iterator.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
199 /** \param iter The iterator.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
200 * \param d The direction: d > 0 == next , d < 0 == prev
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
201 * \param with_node TRUE == stop on nodes with children, FALSE == go directly to the next child
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
202 * \return See \ref PlaytreeIterReturn.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
203 */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
204 int
4043
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
208 /** \param iter The iterator.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
209 * \param d The direction: d > 0 == next , d < 0 == prev
23872
4d936284a5ec typo fix: childs --> children
diego
parents: 23689
diff changeset
210 * \param with_node TRUE == stop on nodes with children, FALSE == go directly to the next child
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
211 * \return See \ref PlaytreeIterReturn.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
212 */
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
224 ///@}
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
225 // PlaytreeIter group
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
226
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
227 /// Create a playtree from a playlist file.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
228 /** \ingroup PlaytreeParser
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
237 /// Create a playtree from a playlist file.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
238 /** \ingroup PlaytreeParser
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
243 /// \defgroup PtAPI Playtree highlevel API
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
244 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
245 /// Highlevel API with pt-suffix to different from low-level API
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
246 /// by Fabian Franz (mplayer@fabian-franz.de).
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
271 /// \brief Performs a convert to playtree-syntax, by concat path/file
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
282 ///@}
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
283
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
284 ///@}
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
285
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
286 #endif /* MPLAYER_PLAYTREE_H */