proplist.h

Go to the documentation of this file.
00001 #ifndef foopulseproplisthfoo
00002 #define foopulseproplisthfoo
00003 
00004 /***
00005   This file is part of PulseAudio.
00006 
00007   Copyright 2007 Lennart Poettering
00008 
00009   PulseAudio is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU Lesser General Public License as
00011   published by the Free Software Foundation; either version 2.1 of the
00012   License, or (at your option) any later version.
00013 
00014   PulseAudio is distributed in the hope that it will be useful, but
00015   WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017   Lesser General Public License for more details.
00018 
00019   You should have received a copy of the GNU Lesser General Public
00020   License along with PulseAudio; if not, write to the Free Software
00021   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022   USA.
00023 ***/
00024 
00025 #include <sys/types.h>
00026 
00027 #include <pulse/cdecl.h>
00028 #include <pulse/gccmacro.h>
00029 
00030 PA_C_DECL_BEGIN
00031 
00032 /* Defined properties:
00033  *
00034  *    media.name                    "Guns'N'Roses: Civil War"
00035  *    media.title                   "Civil War"
00036  *    media.artist                  "Guns'N'Roses"
00037  *    media.language                "de_DE"
00038  *    media.filename
00039  *    media.icon                    Binary blob containing PNG icon data
00040  *    media.icon_name               Name from XDG icon naming spec
00041  *    media.role                    video, music, game, event, phone, production, filter, abstract, stream
00042  *    event.id                      Name from XDG sound naming spec
00043  *    event.description             "Button blabla clicked" for a11y
00044  *    event.mouse.x
00045  *    event.mouse.y
00046  *    event.mouse.hpos              Float formatted as string in range 0..1
00047  *    event.mouse.vpos              Float formatted as string in range 0..1
00048  *    event.mouse.button            Button number following X11 ordering
00049  *    window.name
00050  *    window.id                     "org.gnome.rhytmbox.MainWindow"
00051  *    window.icon                   Binary blob containing PNG icon data
00052  *    window.icon_name              Name from XDG icon naming spec
00053  *    window.x11.display
00054  *    window.x11.screen
00055  *    window.x11.monitor
00056  *    window.x11.xid
00057  *    application.name              "Rhythmbox Media Player"
00058  *    application.id                "org.gnome.rhythmbox"
00059  *    application.version
00060  *    application.icon              Binary blob containing PNG icon data
00061  *    application.icon_name         Name from XDG icon naming spec
00062  *    application.language
00063  *    application.process.id
00064  *    application.process.binary
00065  *    application.process.user
00066  *    application.process.host
00067  *    device.string
00068  *    device.api                    oss, alsa, sunaudio
00069  *    device.description
00070  *    device.bus_path
00071  *    device.serial
00072  *    device.vendor_product_id
00073  *    device.class                  sound, modem, monitor, filter, abstract
00074  *    device.form_factor            laptop-speakers, external-speakers, telephone, tv-capture, webcam-capture, microphone-capture, headset
00075  *    device.connector              isa, pci, usb, firewire, bluetooth
00076  *    device.access_mode            mmap, mmap_rewrite, serial
00077  *    device.master_device
00078  *    device.bufferin.buffer_size
00079  *    device.bufferin.fragment_size
00080  */
00081 #define PA_PROP_MEDIA_NAME                     "media.name"
00082 #define PA_PROP_MEDIA_TITLE                    "media.title"
00083 #define PA_PROP_MEDIA_ARTIST                   "media.artist"
00084 #define PA_PROP_MEDIA_LANGUAGE                 "media.language"
00085 #define PA_PROP_MEDIA_FILENAME                 "media.filename"
00086 #define PA_PROP_MEDIA_ICON                     "media.icon"
00087 #define PA_PROP_MEDIA_ICON_NAME                "media.icon_name"
00088 #define PA_PROP_MEDIA_ROLE                     "media.role"
00089 #define PA_PROP_EVENT_ID                       "event.id"
00090 #define PA_PROP_EVENT_DESCRIPTION              "event.description"
00091 #define PA_PROP_EVENT_MOUSE_X                  "event.mouse.x"
00092 #define PA_PROP_EVENT_MOUSE_Y                  "event.mouse.y"
00093 #define PA_PROP_EVENT_MOUSE_HPOS               "event.mouse.hpos"
00094 #define PA_PROP_EVENT_MOUSE_VPOS               "event.mouse.vpos"
00095 #define PA_PROP_EVENT_MOUSE_BUTTON             "event.mouse.button"
00096 #define PA_PROP_WINDOW_NAME                    "window.name"
00097 #define PA_PROP_WINDOW_ID                      "window.id"
00098 #define PA_PROP_WINDOW_ICON                    "window.icon"
00099 #define PA_PROP_WINDOW_ICON_NAME               "window.icon_name"
00100 #define PA_PROP_WINDOW_X11_DISPLAY             "window.x11.display"
00101 #define PA_PROP_WINDOW_X11_SCREEN              "window.x11.screen"
00102 #define PA_PROP_WINDOW_X11_MONITOR             "window.x11.monitor"
00103 #define PA_PROP_WINDOW_X11_XID                 "window.x11.xid"
00104 #define PA_PROP_APPLICATION_NAME               "application.name"
00105 #define PA_PROP_APPLICATION_ID                 "application.id"
00106 #define PA_PROP_APPLICATION_VERSION            "application.version"
00107 #define PA_PROP_APPLICATION_ICON               "application.icon"
00108 #define PA_PROP_APPLICATION_ICON_NAME          "application.icon_name"
00109 #define PA_PROP_APPLICATION_LANGUAGE           "application.language"
00110 #define PA_PROP_APPLICATION_PROCESS_ID         "application.process.id"
00111 #define PA_PROP_APPLICATION_PROCESS_BINARY     "application.process.binary"
00112 #define PA_PROP_APPLICATION_PROCESS_USER       "application.process.user"
00113 #define PA_PROP_APPLICATION_PROCESS_HOST       "application.process.host"
00114 #define PA_PROP_DEVICE_STRING                  "device.string"
00115 #define PA_PROP_DEVICE_API                     "device.api"
00116 #define PA_PROP_DEVICE_DESCRIPTION             "device.description"
00117 #define PA_PROP_DEVICE_BUS_PATH                "device.bus_path"
00118 #define PA_PROP_DEVICE_SERIAL                  "device.serial"
00119 #define PA_PROP_DEVICE_VENDOR_PRODUCT_ID       "device.vendor_product_id"
00120 #define PA_PROP_DEVICE_CLASS                   "device.class"
00121 #define PA_PROP_DEVICE_FORM_FACTOR             "device.form_factor"
00122 #define PA_PROP_DEVICE_CONNECTOR               "device.connector"
00123 #define PA_PROP_DEVICE_ACCESS_MODE             "device.access_mode"
00124 #define PA_PROP_DEVICE_MASTER_DEVICE           "device.master_device"
00125 #define PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE   "device.buffering.buffer_size"
00126 #define PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size"
00127 
00130 typedef struct pa_proplist pa_proplist;
00131 
00133 pa_proplist* pa_proplist_new(void);
00134 
00136 void pa_proplist_free(pa_proplist* p);
00137 
00142 int pa_proplist_sets(pa_proplist *p, const char *key, const char *value);
00143 
00149 int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...) PA_GCC_PRINTF_ATTR(3,4);
00150 
00154 int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes);
00155 
00156 /* Return a string entry for the specified key. Will return NULL if
00157  * the data is not valid UTF-8. Will return a NUL-terminated string in
00158  * an internally allocated buffer. The caller should make a copy of
00159  * the data before accessing the property list again. \since 0.9.11 */
00160 const char *pa_proplist_gets(pa_proplist *p, const char *key);
00161 
00167 int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes);
00168 
00170 typedef enum pa_update_mode {
00171     PA_UPDATE_SET,
00172     /*< Replace the entirey property list with the new one. Don't keep
00173      *  any of the old data around */
00174 
00175     PA_UPDATE_MERGE,
00176     /*< Merge new property list into the existing one, not replacing
00177      *  any old entries if they share a common key with the new
00178      *  property list. */
00179 
00180     PA_UPDATE_REPLACE
00181     /*< Merge new property list into the existing one, replacing all
00182      *  old entries that share a common key with the new property
00183      *  list. */
00184 } pa_update_mode_t;
00185 
00188 void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, pa_proplist *other);
00189 
00192 int pa_proplist_unset(pa_proplist *p, const char *key);
00193 
00199 int pa_proplist_unset_many(pa_proplist *p, const char * const keys[]);
00200 
00210 const char *pa_proplist_iterate(pa_proplist *p, void **state);
00211 
00214 char *pa_proplist_to_string(pa_proplist *p);
00215 
00218 int pa_proplist_contains(pa_proplist *p, const char *key);
00219 
00221 void pa_proplist_clear(pa_proplist *p);
00222 
00225 pa_proplist* pa_proplist_copy(pa_proplist *t);
00226 
00227 PA_C_DECL_END
00228 
00229 #endif

Generated on Tue Sep 16 10:58:58 2008 for PulseAudio by  doxygen 1.5.4