PulseAudio 2.0

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 #include <pulse/version.h>
00030 
00034 PA_C_DECL_BEGIN
00035 
00037 #define PA_PROP_MEDIA_NAME                     "media.name"
00038 
00040 #define PA_PROP_MEDIA_TITLE                    "media.title"
00041 
00043 #define PA_PROP_MEDIA_ARTIST                   "media.artist"
00044 
00046 #define PA_PROP_MEDIA_COPYRIGHT                "media.copyright"
00047 
00049 #define PA_PROP_MEDIA_SOFTWARE                 "media.software"
00050 
00052 #define PA_PROP_MEDIA_LANGUAGE                 "media.language"
00053 
00055 #define PA_PROP_MEDIA_FILENAME                 "media.filename"
00056 
00059 #define PA_PROP_MEDIA_ICON                     "media.icon"
00060 
00063 #define PA_PROP_MEDIA_ICON_NAME                "media.icon_name"
00064 
00066 #define PA_PROP_MEDIA_ROLE                     "media.role"
00067 
00069 #define PA_PROP_FILTER_WANT                    "filter.want"
00070 
00072 #define PA_PROP_FILTER_APPLY                   "filter.apply"
00073 
00075 #define PA_PROP_FILTER_SUPPRESS                "filter.suppress"
00076 
00078 #define PA_PROP_EVENT_ID                       "event.id"
00079 
00081 #define PA_PROP_EVENT_DESCRIPTION              "event.description"
00082 
00084 #define PA_PROP_EVENT_MOUSE_X                  "event.mouse.x"
00085 
00087 #define PA_PROP_EVENT_MOUSE_Y                  "event.mouse.y"
00088 
00090 #define PA_PROP_EVENT_MOUSE_HPOS               "event.mouse.hpos"
00091 
00093 #define PA_PROP_EVENT_MOUSE_VPOS               "event.mouse.vpos"
00094 
00096 #define PA_PROP_EVENT_MOUSE_BUTTON             "event.mouse.button"
00097 
00099 #define PA_PROP_WINDOW_NAME                    "window.name"
00100 
00102 #define PA_PROP_WINDOW_ID                      "window.id"
00103 
00106 #define PA_PROP_WINDOW_ICON                    "window.icon"
00107 
00110 #define PA_PROP_WINDOW_ICON_NAME               "window.icon_name"
00111 
00113 #define PA_PROP_WINDOW_X                       "window.x"
00114 
00116 #define PA_PROP_WINDOW_Y                       "window.y"
00117 
00119 #define PA_PROP_WINDOW_WIDTH                   "window.width"
00120 
00122 #define PA_PROP_WINDOW_HEIGHT                  "window.height"
00123 
00125 #define PA_PROP_WINDOW_HPOS                    "window.hpos"
00126 
00128 #define PA_PROP_WINDOW_VPOS                    "window.vpos"
00129 
00131 #define PA_PROP_WINDOW_DESKTOP                 "window.desktop"
00132 
00134 #define PA_PROP_WINDOW_X11_DISPLAY             "window.x11.display"
00135 
00137 #define PA_PROP_WINDOW_X11_SCREEN              "window.x11.screen"
00138 
00140 #define PA_PROP_WINDOW_X11_MONITOR             "window.x11.monitor"
00141 
00143 #define PA_PROP_WINDOW_X11_XID                 "window.x11.xid"
00144 
00146 #define PA_PROP_APPLICATION_NAME               "application.name"
00147 
00149 #define PA_PROP_APPLICATION_ID                 "application.id"
00150 
00152 #define PA_PROP_APPLICATION_VERSION            "application.version"
00153 
00156 #define PA_PROP_APPLICATION_ICON               "application.icon"
00157 
00160 #define PA_PROP_APPLICATION_ICON_NAME          "application.icon_name"
00161 
00163 #define PA_PROP_APPLICATION_LANGUAGE           "application.language"
00164 
00166 #define PA_PROP_APPLICATION_PROCESS_ID         "application.process.id"
00167 
00169 #define PA_PROP_APPLICATION_PROCESS_BINARY     "application.process.binary"
00170 
00172 #define PA_PROP_APPLICATION_PROCESS_USER       "application.process.user"
00173 
00175 #define PA_PROP_APPLICATION_PROCESS_HOST       "application.process.host"
00176 
00178 #define PA_PROP_APPLICATION_PROCESS_MACHINE_ID "application.process.machine_id"
00179 
00181 #define PA_PROP_APPLICATION_PROCESS_SESSION_ID "application.process.session_id"
00182 
00184 #define PA_PROP_DEVICE_STRING                  "device.string"
00185 
00187 #define PA_PROP_DEVICE_API                     "device.api"
00188 
00190 #define PA_PROP_DEVICE_DESCRIPTION             "device.description"
00191 
00193 #define PA_PROP_DEVICE_BUS_PATH                "device.bus_path"
00194 
00196 #define PA_PROP_DEVICE_SERIAL                  "device.serial"
00197 
00199 #define PA_PROP_DEVICE_VENDOR_ID               "device.vendor.id"
00200 
00202 #define PA_PROP_DEVICE_VENDOR_NAME             "device.vendor.name"
00203 
00205 #define PA_PROP_DEVICE_PRODUCT_ID              "device.product.id"
00206 
00208 #define PA_PROP_DEVICE_PRODUCT_NAME            "device.product.name"
00209 
00211 #define PA_PROP_DEVICE_CLASS                   "device.class"
00212 
00214 #define PA_PROP_DEVICE_FORM_FACTOR             "device.form_factor"
00215 
00217 #define PA_PROP_DEVICE_BUS                     "device.bus"
00218 
00221 #define PA_PROP_DEVICE_ICON                    "device.icon"
00222 
00225 #define PA_PROP_DEVICE_ICON_NAME               "device.icon_name"
00226 
00228 #define PA_PROP_DEVICE_ACCESS_MODE             "device.access_mode"
00229 
00231 #define PA_PROP_DEVICE_MASTER_DEVICE           "device.master_device"
00232 
00234 #define PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE   "device.buffering.buffer_size"
00235 
00237 #define PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size"
00238 
00240 #define PA_PROP_DEVICE_PROFILE_NAME            "device.profile.name"
00241 
00243 #define PA_PROP_DEVICE_INTENDED_ROLES          "device.intended_roles"
00244 
00246 #define PA_PROP_DEVICE_PROFILE_DESCRIPTION     "device.profile.description"
00247 
00249 #define PA_PROP_MODULE_AUTHOR                  "module.author"
00250 
00252 #define PA_PROP_MODULE_DESCRIPTION             "module.description"
00253 
00255 #define PA_PROP_MODULE_USAGE                   "module.usage"
00256 
00258 #define PA_PROP_MODULE_VERSION                 "module.version"
00259 
00261 #define PA_PROP_FORMAT_SAMPLE_FORMAT           "format.sample_format"
00262 
00264 #define PA_PROP_FORMAT_RATE                    "format.rate"
00265 
00267 #define PA_PROP_FORMAT_CHANNELS                "format.channels"
00268 
00270 #define PA_PROP_FORMAT_CHANNEL_MAP             "format.channel_map"
00271 
00274 typedef struct pa_proplist pa_proplist;
00275 
00277 pa_proplist* pa_proplist_new(void);
00278 
00280 void pa_proplist_free(pa_proplist* p);
00281 
00286 int pa_proplist_sets(pa_proplist *p, const char *key, const char *value);
00287 
00294 int pa_proplist_setp(pa_proplist *p, const char *pair);
00295 
00301 int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...) PA_GCC_PRINTF_ATTR(3,4);
00302 
00306 int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes);
00307 
00312 const char *pa_proplist_gets(pa_proplist *p, const char *key);
00313 
00319 int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes);
00320 
00322 typedef enum pa_update_mode {
00323     PA_UPDATE_SET,
00326 
00327     PA_UPDATE_MERGE,
00331 
00332     PA_UPDATE_REPLACE
00336 } pa_update_mode_t;
00337 
00339 #define PA_UPDATE_SET PA_UPDATE_SET
00340 #define PA_UPDATE_MERGE PA_UPDATE_MERGE
00341 #define PA_UPDATE_REPLACE PA_UPDATE_REPLACE
00342 
00346 void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, const pa_proplist *other);
00347 
00350 int pa_proplist_unset(pa_proplist *p, const char *key);
00351 
00357 int pa_proplist_unset_many(pa_proplist *p, const char * const keys[]);
00358 
00368 const char *pa_proplist_iterate(pa_proplist *p, void **state);
00369 
00374 char *pa_proplist_to_string(pa_proplist *p);
00375 
00379 char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep);
00380 
00383 pa_proplist *pa_proplist_from_string(const char *str);
00384 
00387 int pa_proplist_contains(pa_proplist *p, const char *key);
00388 
00390 void pa_proplist_clear(pa_proplist *p);
00391 
00394 pa_proplist* pa_proplist_copy(const pa_proplist *p);
00395 
00397 unsigned pa_proplist_size(pa_proplist *p);
00398 
00400 int pa_proplist_isempty(pa_proplist *p);
00401 
00404 int pa_proplist_equal(pa_proplist *a, pa_proplist *b);
00405 
00406 PA_C_DECL_END
00407 
00408 #endif