PulseAudio  5.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, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  USA.
23 ***/
24 
25 #include <sys/types.h>
26 
27 #include <pulse/cdecl.h>
28 #include <pulse/gccmacro.h>
29 #include <pulse/version.h>
30 
34 PA_C_DECL_BEGIN
35 
37 #define PA_PROP_MEDIA_NAME "media.name"
38 
40 #define PA_PROP_MEDIA_TITLE "media.title"
41 
43 #define PA_PROP_MEDIA_ARTIST "media.artist"
44 
46 #define PA_PROP_MEDIA_COPYRIGHT "media.copyright"
47 
49 #define PA_PROP_MEDIA_SOFTWARE "media.software"
50 
52 #define PA_PROP_MEDIA_LANGUAGE "media.language"
53 
55 #define PA_PROP_MEDIA_FILENAME "media.filename"
56 
59 #define PA_PROP_MEDIA_ICON "media.icon"
60 
63 #define PA_PROP_MEDIA_ICON_NAME "media.icon_name"
64 
66 #define PA_PROP_MEDIA_ROLE "media.role"
67 
69 #define PA_PROP_FILTER_WANT "filter.want"
70 
72 #define PA_PROP_FILTER_APPLY "filter.apply"
73 
75 #define PA_PROP_FILTER_SUPPRESS "filter.suppress"
76 
78 #define PA_PROP_EVENT_ID "event.id"
79 
81 #define PA_PROP_EVENT_DESCRIPTION "event.description"
82 
84 #define PA_PROP_EVENT_MOUSE_X "event.mouse.x"
85 
87 #define PA_PROP_EVENT_MOUSE_Y "event.mouse.y"
88 
90 #define PA_PROP_EVENT_MOUSE_HPOS "event.mouse.hpos"
91 
93 #define PA_PROP_EVENT_MOUSE_VPOS "event.mouse.vpos"
94 
96 #define PA_PROP_EVENT_MOUSE_BUTTON "event.mouse.button"
97 
99 #define PA_PROP_WINDOW_NAME "window.name"
100 
102 #define PA_PROP_WINDOW_ID "window.id"
103 
106 #define PA_PROP_WINDOW_ICON "window.icon"
107 
110 #define PA_PROP_WINDOW_ICON_NAME "window.icon_name"
111 
113 #define PA_PROP_WINDOW_X "window.x"
114 
116 #define PA_PROP_WINDOW_Y "window.y"
117 
119 #define PA_PROP_WINDOW_WIDTH "window.width"
120 
122 #define PA_PROP_WINDOW_HEIGHT "window.height"
123 
125 #define PA_PROP_WINDOW_HPOS "window.hpos"
126 
128 #define PA_PROP_WINDOW_VPOS "window.vpos"
129 
131 #define PA_PROP_WINDOW_DESKTOP "window.desktop"
132 
134 #define PA_PROP_WINDOW_X11_DISPLAY "window.x11.display"
135 
137 #define PA_PROP_WINDOW_X11_SCREEN "window.x11.screen"
138 
140 #define PA_PROP_WINDOW_X11_MONITOR "window.x11.monitor"
141 
143 #define PA_PROP_WINDOW_X11_XID "window.x11.xid"
144 
146 #define PA_PROP_APPLICATION_NAME "application.name"
147 
149 #define PA_PROP_APPLICATION_ID "application.id"
150 
152 #define PA_PROP_APPLICATION_VERSION "application.version"
153 
156 #define PA_PROP_APPLICATION_ICON "application.icon"
157 
160 #define PA_PROP_APPLICATION_ICON_NAME "application.icon_name"
161 
163 #define PA_PROP_APPLICATION_LANGUAGE "application.language"
164 
166 #define PA_PROP_APPLICATION_PROCESS_ID "application.process.id"
167 
169 #define PA_PROP_APPLICATION_PROCESS_BINARY "application.process.binary"
170 
172 #define PA_PROP_APPLICATION_PROCESS_USER "application.process.user"
173 
175 #define PA_PROP_APPLICATION_PROCESS_HOST "application.process.host"
176 
178 #define PA_PROP_APPLICATION_PROCESS_MACHINE_ID "application.process.machine_id"
179 
181 #define PA_PROP_APPLICATION_PROCESS_SESSION_ID "application.process.session_id"
182 
184 #define PA_PROP_DEVICE_STRING "device.string"
185 
187 #define PA_PROP_DEVICE_API "device.api"
188 
190 #define PA_PROP_DEVICE_DESCRIPTION "device.description"
191 
193 #define PA_PROP_DEVICE_BUS_PATH "device.bus_path"
194 
196 #define PA_PROP_DEVICE_SERIAL "device.serial"
197 
199 #define PA_PROP_DEVICE_VENDOR_ID "device.vendor.id"
200 
202 #define PA_PROP_DEVICE_VENDOR_NAME "device.vendor.name"
203 
205 #define PA_PROP_DEVICE_PRODUCT_ID "device.product.id"
206 
208 #define PA_PROP_DEVICE_PRODUCT_NAME "device.product.name"
209 
211 #define PA_PROP_DEVICE_CLASS "device.class"
212 
214 #define PA_PROP_DEVICE_FORM_FACTOR "device.form_factor"
215 
217 #define PA_PROP_DEVICE_BUS "device.bus"
218 
221 #define PA_PROP_DEVICE_ICON "device.icon"
222 
225 #define PA_PROP_DEVICE_ICON_NAME "device.icon_name"
226 
228 #define PA_PROP_DEVICE_ACCESS_MODE "device.access_mode"
229 
231 #define PA_PROP_DEVICE_MASTER_DEVICE "device.master_device"
232 
234 #define PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE "device.buffering.buffer_size"
235 
237 #define PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size"
238 
240 #define PA_PROP_DEVICE_PROFILE_NAME "device.profile.name"
241 
243 #define PA_PROP_DEVICE_INTENDED_ROLES "device.intended_roles"
244 
246 #define PA_PROP_DEVICE_PROFILE_DESCRIPTION "device.profile.description"
247 
249 #define PA_PROP_MODULE_AUTHOR "module.author"
250 
252 #define PA_PROP_MODULE_DESCRIPTION "module.description"
253 
255 #define PA_PROP_MODULE_USAGE "module.usage"
256 
258 #define PA_PROP_MODULE_VERSION "module.version"
259 
261 #define PA_PROP_FORMAT_SAMPLE_FORMAT "format.sample_format"
262 
264 #define PA_PROP_FORMAT_RATE "format.rate"
265 
267 #define PA_PROP_FORMAT_CHANNELS "format.channels"
268 
270 #define PA_PROP_FORMAT_CHANNEL_MAP "format.channel_map"
271 
274 typedef struct pa_proplist pa_proplist;
275 
278 
281 
283 int pa_proplist_key_valid(const char *key);
284 
289 int pa_proplist_sets(pa_proplist *p, const char *key, const char *value);
290 
297 int pa_proplist_setp(pa_proplist *p, const char *pair);
298 
304 int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...) PA_GCC_PRINTF_ATTR(3,4);
305 
309 int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes);
310 
315 const char *pa_proplist_gets(pa_proplist *p, const char *key);
316 
322 int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes);
323 
325 typedef enum pa_update_mode {
329 
334 
340 
342 #define PA_UPDATE_SET PA_UPDATE_SET
343 #define PA_UPDATE_MERGE PA_UPDATE_MERGE
344 #define PA_UPDATE_REPLACE PA_UPDATE_REPLACE
345 
349 void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, const pa_proplist *other);
350 
353 int pa_proplist_unset(pa_proplist *p, const char *key);
354 
360 int pa_proplist_unset_many(pa_proplist *p, const char * const keys[]);
361 
371 const char *pa_proplist_iterate(pa_proplist *p, void **state);
372 
378 
382 char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep);
383 
386 pa_proplist *pa_proplist_from_string(const char *str);
387 
390 int pa_proplist_contains(pa_proplist *p, const char *key);
391 
394 
398 
400 unsigned pa_proplist_size(pa_proplist *p);
401 
404 
408 
409 PA_C_DECL_END
410 
411 #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:326
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:39
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:335
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:330
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:274
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:325
const char * pa_proplist_gets(pa_proplist *p, const char *key)
Return a string entry for the specified key.