annotate playtree.h @ 19020:979752b5fa5f

Telecine article on divx.com has gone 404, link to Wikipedia instead.
author diego
date Wed, 12 Jul 2006 12:35:09 +0000
parents b3be7df634b0
children 780caed72ac7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
1
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
2 /// \file
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
3 /// \ingroup Playtree
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 4043
diff changeset
4
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 4043
diff changeset
5 #ifndef __PLAYTREE_H
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 4043
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
11 /// \defgroup PlaytreeIterReturn Playtree iterator return code
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
12 /// \ingroup PlaytreeIter
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
18 ///@}
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
19
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
20 /// \defgroup PlaytreeEntryTypes Playtree entry types
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
21 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
30
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
31 /// \defgroup PlaytreeEntryFlags Playtree flags
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
32 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
33 ///@{
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
34 /// Play the item childs in random order.
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
35 #define PLAY_TREE_RND (1<<0)
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
36 /// Playtree flags used by the iterator to mark items already "randomly" played.
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
37 #define PLAY_TREE_RND_PLAYED (1<<8)
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
38 ///@}
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
39
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
40 /// \defgroup PlaytreeIterMode Playtree iterator mode
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
41 /// \ingroup PlaytreeIter
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
42 ///@{
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
43 #define PLAY_TREE_ITER_NORMAL 0
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
44 #define PLAY_TREE_ITER_RND 1
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
45 ///@}
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
46
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
47 /// \defgroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
48 ///@{
8174
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
86 int flags;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
87 };
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
88
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
89
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
90 /// \defgroup PlaytreeIter Playtree iterator
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
91 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
92 ///@{
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
93
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
96 /// Root of the iterated tree.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
97 play_tree_t* root;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
98 /// Current position in the tree.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
99 play_tree_t* tree;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
100 /// \ref Config used.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
101 struct m_config* config;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
102 /// Looping status
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
103 int loop;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
014e0ea85bdb Add random stepping support
albeu
parents: 8164
diff changeset
109 int mode;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
110
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
111 /// loop/valid stack to save/revert status when we go up/down.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
112 int* status_stack;
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
113 /// status stack size
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
114 int stack_size;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
115 };
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
116 ///@}
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
117
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
122 /// Free a playtree item.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
123 /** \param pt Item to free.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
124 * \param childs If non-zero the item's childs are recursively freed.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
125 */
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
126 void
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
127 play_tree_free(play_tree_t* pt, int childs);
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
130 /// Free an item and its siblings.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
131 /** \param pt Item to free.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
132 * \param childs If non-zero the items' childs are recursively freed.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
133 */
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
134 void
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
135 play_tree_free_list(play_tree_t* pt, int childs);
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
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
138 /// Set the childs 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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
141
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
161 play_tree_remove(play_tree_t* pt, int free_it,int with_childs);
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
162
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
184 /// \addtogroup PlaytreeIter
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
185 ///@{
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
186
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
199 /// Step an iterator.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
200 /** \param iter The iterator.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
201 * \param d The direction: d > 0 == next , d < 0 == prev
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
202 * \param with_node TRUE == stop on nodes with childs, FALSE == go directly to the next child
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
203 * \return See \ref PlaytreeIterReturn.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
208 /// Step up, usefull to break a loop, etc.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
209 /** \param iter The iterator.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
210 * \param d The direction: d > 0 == next , d < 0 == prev
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
211 * \param with_node TRUE == stop on nodes with childs, FALSE == go directly to the next child
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
212 * \return See \ref PlaytreeIterReturn.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
213 */
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
217 /// Enter a node child list, only usefull when stopping on nodes.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
225 ///@}
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
226 // PlaytreeIter group
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
227
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
228 /// Create a playtree from a playlist file.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
229 /** \ingroup PlaytreeParser
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
238 /// Create a playtree from a playlist file.
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
239 /** \ingroup PlaytreeParser
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
244 /// \defgroup PtAPI Playtree highlevel API
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
245 /// \ingroup Playtree
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
246 /// Highlevel API with pt-suffix to different from low-level API
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
247 /// by Fabian Franz (mplayer@fabian-franz.de).
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
272 /// \brief Performs a convert to playtree-syntax, by concat path/file
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
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
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
283 ///@}
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
284
4156
22fadd4022b5 playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents: 4043
diff changeset
285 #endif
18265
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
286
1a14fde7680d Doxygen Attack! - Chapter 3
albeu
parents: 9290
diff changeset
287 ///@}