summaryrefslogtreecommitdiffstats
path: root/src/pulse/proplist.h
blob: f74b3aa1f73cc4f473aad1e9afbc6e5fb77d6161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef foopulseproplisthfoo
#define foopulseproplisthfoo

/* $Id$ */

/***
  This file is part of PulseAudio.

  Copyright 2007 Lennart Poettering

  PulseAudio is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2.1 of the
  License, or (at your option) any later version.

  PulseAudio is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with PulseAudio; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA.
***/

#include <pulsecore/macro.h>

/* Defined properties:
 *
 *    x11.xid
 *    x11.display
 *    x11.x_pointer
 *    x11.y_pointer
 *    x11.button
 *    media.name
 *    media.title
 *    media.artist
 *    media.language
 *    media.filename
 *    media.icon
 *    media.icon_name
 *    media.role                    video, music, game, event, phone, production
 *    application.name
 *    application.version
 *    application.icon
 *    application.icon_name
 */

#define PA_PROP_X11_XID                  "x11.xid"
#define PA_PROP_X11_DISPLAY              "x11.display"
#define PA_PROP_X11_X_POINTER            "x11.x_pointer"
#define PA_PROP_X11_Y_POINTER            "x11.y_pointer"
#define PA_PROP_X11_BUTTON               "x11.button"
#define PA_PROP_MEDIA_NAME               "media.name"
#define PA_PROP_MEDIA_TITLE              "media.title"
#define PA_PROP_MEDIA_ARTIST             "media.artist"
#define PA_PROP_MEDIA_LANGUAGE           "media.language"
#define PA_PROP_MEDIA_FILENAME           "media.filename"
#define PA_PROP_MEDIA_ICON               "media.icon"
#define PA_PROP_MEDIA_ICON_NAME          "media.icon_name"
#define PA_PROP_MEDIA_ROLE               "media.role"
#define PA_PROP_APPLICATION_NAME         "application.name"
#define PA_PROP_APPLICATION_VERSION      "application.version"
#define PA_PROP_APPLICATION_ICON         "application.icon"
#define PA_PROP_APPLICATION_ICON_NAME    "application.icon_name"

typedef struct pa_proplist pa_proplist;

pa_proplist* pa_proplist_new(void);
void pa_proplist_free(pa_proplist* p);

/** Will accept only valid UTF-8 */
int pa_proplist_puts(pa_proplist *p, const char *key, const char *value);
int pa_proplist_put(pa_proplist *p, const char *key, const void *data, size_t nbytes);

/* Will return NULL if the data is not valid UTF-8 */
const char *pa_proplist_gets(pa_proplist *p, const char *key);
int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes);

void pa_proplist_merge(pa_proplist *p, pa_proplist *other);
int pa_proplist_remove(pa_proplist *p, const char *key);

const char *pa_proplist_iterate(pa_proplist *p, void **state);

char *pa_proplist_to_string(pa_proplist *p);

#endif