PulseAudio  6.0
proplist.h
Go to the documentation of this file.
1 #ifndef foopulseproplisthfoo
2 #define foopulseproplisthfoo
3 
4 /***
5  This file is part of PulseAudio.
6 
7  Copyright 2007 Lennart Poettering
8 
9  PulseAudio is free software; you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as
11  published by the Free Software Foundation; either version 2.1 of the
12  License, or (at your option) any later version.
13 
14  PulseAudio is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
21 ***/
22 
23 #include <sys/types.h>
24 
25 #include <pulse/cdecl.h>
26 #include <pulse/gccmacro.h>
27 #include <pulse/version.h>
28 
32 PA_C_DECL_BEGIN
33 
35 #define PA_PROP_MEDIA_NAME "media.name"
36 
38 #define PA_PROP_MEDIA_TITLE "media.title"
39 
41 #define PA_PROP_MEDIA_ARTIST "media.artist"
42 
44 #define PA_PROP_MEDIA_COPYRIGHT "media.copyright"
45 
47 #define PA_PROP_MEDIA_SOFTWARE "media.software"
48 
50 #define PA_PROP_MEDIA_LANGUAGE "media.language"
51 
53 #define PA_PROP_MEDIA_FILENAME "media.filename"
54 
57 #define PA_PROP_MEDIA_ICON "media.icon"
58 
61 #define PA_PROP_MEDIA_ICON_NAME "media.icon_name"
62 
64 #define PA_PROP_MEDIA_ROLE "media.role"
65 
67 #define PA_PROP_FILTER_WANT "filter.want"
68 
70 #define PA_PROP_FILTER_APPLY "filter.apply"
71 
73 #define PA_PROP_FILTER_SUPPRESS "filter.suppress"
74 
76 #define PA_PROP_EVENT_ID "event.id"
77 
79 #define PA_PROP_EVENT_DESCRIPTION "event.description"
80 
82 #define PA_PROP_EVENT_MOUSE_X "event.mouse.x"
83 
85 #define PA_PROP_EVENT_MOUSE_Y "event.mouse.y"
86 
88 #define PA_PROP_EVENT_MOUSE_HPOS "event.mouse.hpos"
89 
91 #define PA_PROP_EVENT_MOUSE_VPOS "event.mouse.vpos"
92 
94 #define PA_PROP_EVENT_MOUSE_BUTTON "event.mouse.button"
95 
97 #define PA_PROP_WINDOW_NAME "window.name"
98 
100 #define PA_PROP_WINDOW_ID "window.id"
101 
104 #define PA_PROP_WINDOW_ICON "window.icon"
105 
108 #define PA_PROP_WINDOW_ICON_NAME "window.icon_name"
109 
111 #define PA_PROP_WINDOW_X "window.x"
112 
114 #define PA_PROP_WINDOW_Y "window.y"
115 
117 #define PA_PROP_WINDOW_WIDTH "window.width"
118 
120 #define PA_PROP_WINDOW_HEIGHT "window.height"
121 
123 #define PA_PROP_WINDOW_HPOS "window.hpos"
124 
126 #define PA_PROP_WINDOW_VPOS "window.vpos"
127 
129 #define PA_PROP_WINDOW_DESKTOP "window.desktop"
130 
132 #define PA_PROP_WINDOW_X11_DISPLAY "window.x11.display"
133 
135 #define PA_PROP_WINDOW_X11_SCREEN "window.x11.screen"
136 
138 #define PA_PROP_WINDOW_X11_MONITOR "window.x11.monitor"
139 
141 #define PA_PROP_WINDOW_X11_XID "window.x11.xid"
142 
144 #define PA_PROP_APPLICATION_NAME "application.name"
145 
147 #define PA_PROP_APPLICATION_ID "application.id"
148 
150 #define PA_PROP_APPLICATION_VERSION "application.version"
151 
154 #define PA_PROP_APPLICATION_ICON "application.icon"
155 
158 #define PA_PROP_APPLICATION_ICON_NAME "application.icon_name"
159 
161 #define PA_PROP_APPLICATION_LANGUAGE "application.language"
162 
164 #define PA_PROP_APPLICATION_PROCESS_ID "application.process.id"
165 
167 #define PA_PROP_APPLICATION_PROCESS_BINARY "application.process.binary"
168 
170 #define PA_PROP_APPLICATION_PROCESS_USER "application.process.user"
171 
173 #define PA_PROP_APPLICATION_PROCESS_HOST "application.process.host"
174 
176 #define PA_PROP_APPLICATION_PROCESS_MACHINE_ID "application.process.machine_id"
177 
179 #define PA_PROP_APPLICATION_PROCESS_SESSION_ID "application.process.session_id"
180 
182 #define PA_PROP_DEVICE_STRING "device.string"
183 
185 #define PA_PROP_DEVICE_API "device.api"
186 
188 #define PA_PROP_DEVICE_DESCRIPTION "device.description"
189 
191 #define PA_PROP_DEVICE_BUS_PATH "device.bus_path"
192 
194 #define PA_PROP_DEVICE_SERIAL "device.serial"
195 
197 #define PA_PROP_DEVICE_VENDOR_ID "device.vendor.id"
198 
200 #define PA_PROP_DEVICE_VENDOR_NAME "device.vendor.name"
201 
203 #define PA_PROP_DEVICE_PRODUCT_ID "device.product.id"
204 
206 #define PA_PROP_DEVICE_PRODUCT_NAME "device.product.name"
207 
209 #define PA_PROP_DEVICE_CLASS "device.class"
210 
212 #define PA_PROP_DEVICE_FORM_FACTOR "device.form_factor"
213 
215 #define PA_PROP_DEVICE_BUS "device.bus"
216 
219 #define PA_PROP_DEVICE_ICON "device.icon"
220 
223 #define PA_PROP_DEVICE_ICON_NAME "device.icon_name"
224 
226 #define PA_PROP_DEVICE_ACCESS_MODE "device.access_mode"
227 
229 #define PA_PROP_DEVICE_MASTER_DEVICE "device.master_device"
230 
232 #define PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE "device.buffering.buffer_size"
233 
235 #define PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size"
236 
238 #define PA_PROP_DEVICE_PROFILE_NAME "device.profile.name"
239 
241 #define PA_PROP_DEVICE_INTENDED_ROLES "device.intended_roles"
242 
244 #define PA_PROP_DEVICE_PROFILE_DESCRIPTION "device.profile.description"
245 
247 #define PA_PROP_MODULE_AUTHOR "module.author"
248 
250 #define PA_PROP_MODULE_DESCRIPTION "module.description"
251 
253 #define PA_PROP_MODULE_USAGE "module.usage"
254 
256 #define PA_PROP_MODULE_VERSION "module.version"
257 
259 #define PA_PROP_FORMAT_SAMPLE_FORMAT "format.sample_format"
260 
262 #define PA_PROP_FORMAT_RATE "format.rate"
263 
265 #define PA_PROP_FORMAT_CHANNELS "format.channels"
266 
268 #define PA_PROP_FORMAT_CHANNEL_MAP "format.channel_map"
269 
272 typedef struct pa_proplist pa_proplist;
273 
276 
279 
281 int pa_proplist_key_valid(const char *key);
282 
287 int pa_proplist_sets(pa_proplist *p, const char *key, const char *value);
288 
295 int pa_proplist_setp(pa_proplist *p, const char *pair);
296 
302 int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...) PA_GCC_PRINTF_ATTR(3,4);
303 
307 int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes);
308 
313 const char *pa_proplist_gets(pa_proplist *p, const char *key);
314 
320 int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes);
321 
323 typedef enum pa_update_mode {
327 
332 
338 
340 #define PA_UPDATE_SET PA_UPDATE_SET
341 #define PA_UPDATE_MERGE PA_UPDATE_MERGE
342 #define PA_UPDATE_REPLACE PA_UPDATE_REPLACE
343 
347 void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, const pa_proplist *other);
348 
351 int pa_proplist_unset(pa_proplist *p, const char *key);
352 
358 int pa_proplist_unset_many(pa_proplist *p, const char * const keys[]);
359 
369 const char *pa_proplist_iterate(pa_proplist *p, void **state);
370 
376 
380 char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep);
381 
384 pa_proplist *pa_proplist_from_string(const char *str);
385 
388 int pa_proplist_contains(pa_proplist *p, const char *key);
389 
392 
396 
398 unsigned pa_proplist_size(pa_proplist *p);
399 
402 
406 
407 PA_C_DECL_END
408 
409 #endif
int int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes)
Append a new arbitrary data entry to the property list, possibly overwriting an already existing entr...
void pa_proplist_clear(pa_proplist *p)
Remove all entries from the property list object.
void pa_proplist_free(pa_proplist *p)
Free the property list.
int pa_proplist_isempty(pa_proplist *p)
Returns 0 when the proplist is empty, positive otherwise.
Replace the entire property list with the new one.
Definition: proplist.h:324
int pa_proplist_sets(pa_proplist *p, const char *key, const char *value)
Append a new string entry to the property list, possibly overwriting an already existing entry with t...
#define PA_GCC_PRINTF_ATTR(a, b)
If we're in GNU C, use some magic for detecting invalid format strings.
Definition: gccmacro.h:37
int pa_proplist_key_valid(const char *key)
Returns a non-zero value if the key is valid.
pa_proplist * pa_proplist_new(void)
Allocate a property list.
int pa_proplist_contains(pa_proplist *p, const char *key)
Returns 1 if an entry for the specified key exists in the property list.
int pa_proplist_unset_many(pa_proplist *p, const char *const keys[])
Similar to pa_proplist_unset() but takes an array of keys to remove.
int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes)
Store the value for the specified key in data.
int pa_proplist_equal(pa_proplist *a, pa_proplist *b)
Return non-zero when a and b have the same keys and values.
pa_proplist * pa_proplist_from_string(const char *str)
Allocate a new property list and assign key/value from a human readable string.
enum pa_update_mode pa_update_mode_t
Update mode enum for pa_proplist_update().
GCC attribute macros.
Merge new property list into the existing one, replacing all old entries that share a common key with...
Definition: proplist.h:333
pa_proplist * pa_proplist_copy(const pa_proplist *p)
Allocate a new property list and copy over every single entry from the specified list.
Merge new property list into the existing one, not replacing any old entries if they share a common k...
Definition: proplist.h:328
Define header version.
char * pa_proplist_to_string(pa_proplist *p)
Format the property list nicely as a human readable string.
char * pa_proplist_to_string_sep(pa_proplist *p, const char *sep)
Format the property list nicely as a human readable string and choose the separator.
const char * pa_proplist_iterate(pa_proplist *p, void **state)
Iterate through the property list.
int pa_proplist_setf(pa_proplist *p, const char *key, const char *format,...) PA_GCC_PRINTF_ATTR(3
Append a new string entry to the property list, possibly overwriting an already existing entry with t...
int pa_proplist_unset(pa_proplist *p, const char *key)
Removes a single entry from the property list, identified be the specified key name.
int pa_proplist_setp(pa_proplist *p, const char *pair)
Append a new string entry to the property list, possibly overwriting an already existing entry with t...
struct pa_proplist pa_proplist
A property list object.
Definition: proplist.h:272
unsigned pa_proplist_size(pa_proplist *p)
Return the number of entries in the property list.
void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, const pa_proplist *other)
Merge property list "other" into "p", adhering the merge mode as specified in "mode".
pa_update_mode
Update mode enum for pa_proplist_update().
Definition: proplist.h:323
const char * pa_proplist_gets(pa_proplist *p, const char *key)
Return a string entry for the specified key.