Blame src/canberra.h.in

Packit 3ae693
/*-*- Mode: C; c-basic-offset: 8 -*-*/
Packit 3ae693
Packit 3ae693
#ifndef foocanberrahfoo
Packit 3ae693
#define foocanberrahfoo
Packit 3ae693
Packit 3ae693
/***
Packit 3ae693
  This file is part of libcanberra.
Packit 3ae693
Packit 3ae693
  Copyright 2008 Lennart Poettering
Packit 3ae693
Packit 3ae693
  libcanberra is free software; you can redistribute it and/or modify
Packit 3ae693
  it under the terms of the GNU Lesser General Public License as
Packit 3ae693
  published by the Free Software Foundation, either version 2.1 of the
Packit 3ae693
  License, or (at your option) any later version.
Packit 3ae693
Packit 3ae693
  libcanberra is distributed in the hope that it will be useful, but
Packit 3ae693
  WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ae693
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit 3ae693
  Lesser General Public License for more details.
Packit 3ae693
Packit 3ae693
  You should have received a copy of the GNU Lesser General Public
Packit 3ae693
  License along with libcanberra. If not, see
Packit 3ae693
  <http://www.gnu.org/licenses/>.
Packit 3ae693
***/
Packit 3ae693
Packit 3ae693
#include <sys/types.h>
Packit 3ae693
#include <sys/param.h>
Packit 3ae693
#include <inttypes.h>
Packit 3ae693
Packit 3ae693
#ifdef __cplusplus
Packit 3ae693
extern "C" {
Packit 3ae693
#endif
Packit 3ae693
Packit 3ae693
#ifndef __GNUC__
Packit 3ae693
/* Make sure __attribute__ works on non-gcc systems. Yes, might be a bit ugly */
Packit 3ae693
#define __attribute__(x)
Packit 3ae693
#endif
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_MAJOR:
Packit 3ae693
 *
Packit 3ae693
 * Evaluates to the major version number of libcanberra.
Packit 3ae693
 */
Packit 3ae693
#define CA_MAJOR (@CA_MAJOR@)
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_MINOR:
Packit 3ae693
 *
Packit 3ae693
 * Evaluates to the minor version number of libcanberra.
Packit 3ae693
 */
Packit 3ae693
#define CA_MINOR (@CA_MINOR@)
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_CHECK_VERSION:
Packit 3ae693
 *
Packit 3ae693
 * Evaluates to TRUE when the library version is newer than the
Packit 3ae693
 * specified parameters.
Packit 3ae693
 */
Packit 3ae693
#define CA_CHECK_VERSION(major,minor)                   \
Packit 3ae693
        ((CA_MAJOR > (major)) ||                        \
Packit 3ae693
         (CA_MAJOR == (major) && CA_MINOR >= (minor)))
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_NAME:
Packit 3ae693
 *
Packit 3ae693
 * A name describing the media being played. Localized if possible and applicable.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_NAME                         "media.name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_TITLE:
Packit 3ae693
 *
Packit 3ae693
 * A (song) title describing the media being played. Localized if possible and applicable.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_TITLE                        "media.title"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_ARTIST:
Packit 3ae693
 *
Packit 3ae693
 * The artist of this media. Localized if possible and applicable.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_ARTIST                       "media.artist"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_LANGUAGE:
Packit 3ae693
 *
Packit 3ae693
 * The language this media is in, in some standard POSIX locale string, such as "de_DE".
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_LANGUAGE                     "media.language"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_FILENAME:
Packit 3ae693
 *
Packit 3ae693
 * The file name this media was or can be loaded from.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_FILENAME                     "media.filename"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_ICON:
Packit 3ae693
 *
Packit 3ae693
 * An icon for this media in binary PNG format.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_ICON                         "media.icon"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_ICON_NAME:
Packit 3ae693
 *
Packit 3ae693
 * An icon name as defined in the XDG icon naming specifcation.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_ICON_NAME                    "media.icon_name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_MEDIA_ROLE:
Packit 3ae693
 *
Packit 3ae693
 * The "role" this media is played in. For event sounds the string
Packit 3ae693
 * "event". For other cases strings like "music", "video", "game", ...
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_MEDIA_ROLE                         "media.role"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_ID:
Packit 3ae693
 *
Packit 3ae693
 * A textual id for an event sound, as mandated by the XDG sound naming specification.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_ID                           "event.id"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_DESCRIPTION:
Packit 3ae693
 *
Packit 3ae693
 * A descriptive string for the sound event. Localized if possible and applicable.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_DESCRIPTION                  "event.description"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_MOUSE_X:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a mouse input event, the X
Packit 3ae693
 * position of the mouse cursor on the screen, formatted as string.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_MOUSE_X                      "event.mouse.x"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_MOUSE_Y:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a mouse input event, the Y
Packit 3ae693
 * position of the mouse cursor on the screen, formatted as string.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_MOUSE_Y                      "event.mouse.y"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_MOUSE_HPOS:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a mouse input event, the X
Packit 3ae693
 * position of the mouse cursor as fractional value between 0 and 1,
Packit 3ae693
 * formatted as string, 0 reflecting the left side of the screen, 1
Packit 3ae693
 * the right side.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_MOUSE_HPOS                   "event.mouse.hpos"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_MOUSE_VPOS:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a mouse input event, the Y
Packit 3ae693
 * position of the mouse cursor as fractional value between 0 and 1,
Packit 3ae693
 * formatted as string, 0 reflecting the top end of the screen, 1
Packit 3ae693
 * the bottom end.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_MOUSE_VPOS                   "event.mouse.vpos"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_EVENT_MOUSE_BUTTON:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a mouse input event, the
Packit 3ae693
 * number of the mouse button that triggered it, formatted as string. 1
Packit 3ae693
 * for left mouse button, 3 for right, 2 for middle.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_EVENT_MOUSE_BUTTON                 "event.mouse.button"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_NAME:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the
Packit 3ae693
 * name of this window as human readable string.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_NAME                        "window.name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_ID:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, some
Packit 3ae693
 * identification string for this window, so that the sound system can
Packit 3ae693
 * recognize specific windows.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_ID                          "window.id"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_ICON:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, binary
Packit 3ae693
 * icon data in PNG format for this window.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_ICON                        "window.icon"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_ICON_NAME:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, an
Packit 3ae693
 * icon name for this window, as defined in the XDG icon naming
Packit 3ae693
 * specification.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_ICON_NAME                   "window.icon_name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_X:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the X
Packit 3ae693
 * position of the window measured from the top left corner of the
Packit 3ae693
 * screen to the top left corner of the window.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.17
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_X                           "window.x"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_Y:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the y
Packit 3ae693
 * position of the window measured from the top left corner of the
Packit 3ae693
 * screen to the top left corner of the window.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.17
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_Y                           "window.y"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_WIDTH:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the
Packit 3ae693
 * pixel width of the window.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.17
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_WIDTH                       "window.width"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_HEIGHT:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the
Packit 3ae693
 * pixel height of the window.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.17
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_HEIGHT                      "window.height"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_HPOS:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the X
Packit 3ae693
 * position of the center of the window as fractional value between 0
Packit 3ae693
 * and 1, formatted as string, 0 reflecting the left side of the
Packit 3ae693
 * screen, 1 the right side.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.17
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_HPOS                        "window.hpos"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_VPOS:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen, the Y
Packit 3ae693
 * position of the center of the window as fractional value between 0
Packit 3ae693
 * and 1, formatted as string, 0 reflecting the top side of the
Packit 3ae693
 * screen, 1 the bottom side.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.17
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_VPOS                        "window.vpos"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_DESKTOP:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen and the
Packit 3ae693
 * windowing system supports multiple desktops, a comma seperated list
Packit 3ae693
 * of indexes of the desktops this window is visible on. If this
Packit 3ae693
 * property is an empty string, it is visible on all desktops
Packit 3ae693
 * (i.e. 'sticky'). The first desktop is 0. (e.g. "0,2,3")
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.18
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_DESKTOP                    "window.desktop"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_X11_DISPLAY:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen and the
Packit 3ae693
 * windowing system is X11, the X display name of the window (e.g. ":0").
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_X11_DISPLAY                 "window.x11.display"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_X11_SCREEN:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen and the
Packit 3ae693
 * windowing system is X11, the X screen id of the window formatted as
Packit 3ae693
 * string (e.g. "0").
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_X11_SCREEN                  "window.x11.screen"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_X11_MONITOR:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen and the
Packit 3ae693
 * windowing system is X11, the X monitor id of the window formatted as
Packit 3ae693
 * string (e.g. "0").
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_X11_MONITOR                 "window.x11.monitor"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_WINDOW_X11_XID:
Packit 3ae693
 *
Packit 3ae693
 * If this sound event was triggered by a window on the screen and the
Packit 3ae693
 * windowing system is X11, the XID of the window formatted as string.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_WINDOW_X11_XID                     "window.x11.xid"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_NAME:
Packit 3ae693
 *
Packit 3ae693
 * The name of the application this sound event was triggered by as
Packit 3ae693
 * human readable string. (e.g. "GNU Emacs") Localized if possible and
Packit 3ae693
 * applicable.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_NAME                   "application.name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_ID:
Packit 3ae693
 *
Packit 3ae693
 * An identifier for the program this sound event was triggered
Packit 3ae693
 * by. (e.g. "org.gnu.emacs").
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_ID                     "application.id"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_VERSION:
Packit 3ae693
 *
Packit 3ae693
 * A version number for the program this sound event was triggered
Packit 3ae693
 * by. (e.g. "22.2")
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_VERSION                "application.version"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_ICON:
Packit 3ae693
 *
Packit 3ae693
 * Binary icon data in PNG format for the application this sound event
Packit 3ae693
 * is triggered by.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_ICON                   "application.icon"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_ICON_NAME:
Packit 3ae693
 *
Packit 3ae693
 * An icon name for the application this sound event is triggered by,
Packit 3ae693
 * as defined in the XDG icon naming specification.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_ICON_NAME              "application.icon_name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_LANGUAGE:
Packit 3ae693
 *
Packit 3ae693
 * The locale string the application that is triggering this sound
Packit 3ae693
 * event is running in. A POSIX locale string such as de_DE@euro.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_LANGUAGE               "application.language"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_PROCESS_ID:
Packit 3ae693
 *
Packit 3ae693
 * The unix PID of the process that is triggering this sound event, formatted as string.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_PROCESS_ID             "application.process.id"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_PROCESS_BINARY:
Packit 3ae693
 *
Packit 3ae693
 * The path to the process binary of the process that is triggering this sound event.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_PROCESS_BINARY         "application.process.binary"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_PROCESS_USER:
Packit 3ae693
 *
Packit 3ae693
 * The user that owns the process that is triggering this sound event.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_PROCESS_USER           "application.process.user"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_APPLICATION_PROCESS_HOST:
Packit 3ae693
 *
Packit 3ae693
 * The host name of the host the process that is triggering this sound event runs on.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_APPLICATION_PROCESS_HOST           "application.process.host"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_CANBERRA_CACHE_CONTROL:
Packit 3ae693
 *
Packit 3ae693
 * A special property that can be used to control the automatic sound
Packit 3ae693
 * caching of sounds in the sound server. One of "permanent",
Packit 3ae693
 * "volatile", "never". "permanent" will cause this sample to be
Packit 3ae693
 * cached in the server permanently. This is useful for very
Packit 3ae693
 * frequently used sound events such as those used for input
Packit 3ae693
 * feedback. "volatile" may be used for cacheing sounds in the sound
Packit 3ae693
 * server temporarily. They will expire after some time or on cache
Packit 3ae693
 * pressure. Finally, "never" may be used for sounds that should never
Packit 3ae693
 * be cached, because they are only generated very seldomly or even
Packit 3ae693
 * only once at most (such as desktop login sounds).
Packit 3ae693
 *
Packit 3ae693
 * If this property is not explicitly passed to ca_context_play() it
Packit 3ae693
 * will default to "never". If it is not explicitly passed to
Packit 3ae693
 * ca_context_cache() it will default to "permanent".
Packit 3ae693
 *
Packit 3ae693
 * If the list of properties is handed on to the sound server this
Packit 3ae693
 * property is stripped from it.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_CANBERRA_CACHE_CONTROL             "canberra.cache-control"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_CANBERRA_VOLUME:
Packit 3ae693
 *
Packit 3ae693
 * A special property that can be used to control the volume this
Packit 3ae693
 * sound event is played in if the backend supports it. A floating
Packit 3ae693
 * point value for the decibel multiplier for the sound. 0 dB relates
Packit 3ae693
 * to zero gain, and is the default volume these sounds are played in.
Packit 3ae693
 *
Packit 3ae693
 * If the list of properties is handed on to the sound server this
Packit 3ae693
 * property is stripped from it.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_CANBERRA_VOLUME                    "canberra.volume"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_CANBERRA_XDG_THEME_NAME:
Packit 3ae693
 *
Packit 3ae693
 * A special property that can be used to control the XDG sound theme that
Packit 3ae693
 * is used for this sample.
Packit 3ae693
 *
Packit 3ae693
 * If the list of properties is handed on to the sound server this
Packit 3ae693
 * property is stripped from it.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_CANBERRA_XDG_THEME_NAME            "canberra.xdg-theme.name"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_CANBERRA_XDG_THEME_OUTPUT_PROFILE:
Packit 3ae693
 *
Packit 3ae693
 * A special property that can be used to control the XDG sound theme
Packit 3ae693
 * output profile that is used for this sample.
Packit 3ae693
 *
Packit 3ae693
 * If the list of properties is handed on to the sound server this
Packit 3ae693
 * property is stripped from it.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_CANBERRA_XDG_THEME_OUTPUT_PROFILE  "canberra.xdg-theme.output-profile"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_CANBERRA_ENABLE:
Packit 3ae693
 *
Packit 3ae693
 * A special property that can be used to control whether any sounds
Packit 3ae693
 * are played at all. If this property is "1" or unset sounds are
Packit 3ae693
 * played as normal. However, if it is "0" all calls to
Packit 3ae693
 * ca_context_play() will fail with CA_ERROR_DISABLED.
Packit 3ae693
 *
Packit 3ae693
 * If the list of properties is handed on to the sound server this
Packit 3ae693
 * property is stripped from it.
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_CANBERRA_ENABLE                    "canberra.enable"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * CA_PROP_CANBERRA_FORCE_CHANNEL:
Packit 3ae693
 *
Packit 3ae693
 * A special property that can be used to control on which channel a
Packit 3ae693
 * sound is played. The value should be one of mono, front-left,
Packit 3ae693
 * front-right, front-center, rear-left, rear-right, rear-center, lfe,
Packit 3ae693
 * front-left-of-center, front-right-of-center, side-left, side-right,
Packit 3ae693
 * top-center, top-front-left, top-front-right, top-front-center,
Packit 3ae693
 * top-rear-left, top-rear-right, top-rear-center. This property is
Packit 3ae693
 * only honoured by some backends, other backends may choose to ignore
Packit 3ae693
 * it completely.
Packit 3ae693
 *
Packit 3ae693
 * If the list of properties is handed on to the sound server this
Packit 3ae693
 * property is stripped from it.
Packit 3ae693
 *
Packit 3ae693
 * Since: 0.13
Packit 3ae693
 */
Packit 3ae693
#define CA_PROP_CANBERRA_FORCE_CHANNEL             "canberra.force_channel"
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * ca_context:
Packit 3ae693
 *
Packit 3ae693
 * A libcanberra context object.
Packit 3ae693
 */
Packit 3ae693
typedef struct ca_context ca_context;
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * ca_finish_callback_t:
Packit 3ae693
 * @c: The libcanberra context this callback is called for
Packit 3ae693
 * @id: The numerical id passed to the ca_context_play_full() when starting the event sound playback.
Packit 3ae693
 * @error_code: A numerical error code describing the reason this callback is called. If CA_SUCCESS is passed in the playback of the event sound was successfully completed.
Packit 3ae693
 * @userdata: Some arbitrary user data the caller of ca_context_play_full() passed in.
Packit 3ae693
 *
Packit 3ae693
 * Playback completion event callback. The context this callback is
Packit 3ae693
 * called in is undefined, it might or might not be called from a
Packit 3ae693
 * background thread, and from any stack frame. The code implementing
Packit 3ae693
 * this function may not call any libcanberra API call from this
Packit 3ae693
 * callback -- this might result in a deadlock. Instead it may only be
Packit 3ae693
 * used to asynchronously signal some kind of notification object
Packit 3ae693
 * (semaphore, message queue, ...).
Packit 3ae693
 */
Packit 3ae693
typedef void (*ca_finish_callback_t)(ca_context *c, uint32_t id, int error_code, void *userdata);
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * Error codes:
Packit 3ae693
 * @CA_SUCCESS: Success
Packit 3ae693
 *
Packit 3ae693
 * Error codes
Packit 3ae693
 */
Packit 3ae693
enum {
Packit 3ae693
        CA_SUCCESS = 0,
Packit 3ae693
        CA_ERROR_NOTSUPPORTED = -1,
Packit 3ae693
        CA_ERROR_INVALID = -2,
Packit 3ae693
        CA_ERROR_STATE = -3,
Packit 3ae693
        CA_ERROR_OOM = -4,
Packit 3ae693
        CA_ERROR_NODRIVER = -5,
Packit 3ae693
        CA_ERROR_SYSTEM = -6,
Packit 3ae693
        CA_ERROR_CORRUPT = -7,
Packit 3ae693
        CA_ERROR_TOOBIG = -8,
Packit 3ae693
        CA_ERROR_NOTFOUND = -9,
Packit 3ae693
        CA_ERROR_DESTROYED = -10,
Packit 3ae693
        CA_ERROR_CANCELED = -11,
Packit 3ae693
        CA_ERROR_NOTAVAILABLE = -12,
Packit 3ae693
        CA_ERROR_ACCESS = -13,
Packit 3ae693
        CA_ERROR_IO = -14,
Packit 3ae693
        CA_ERROR_INTERNAL = -15,
Packit 3ae693
        CA_ERROR_DISABLED = -16,
Packit 3ae693
        CA_ERROR_FORKED = -17,
Packit 3ae693
        CA_ERROR_DISCONNECTED = -18,
Packit 3ae693
        _CA_ERROR_MAX = -19
Packit 3ae693
};
Packit 3ae693
Packit 3ae693
/**
Packit 3ae693
 * ca_proplist:
Packit 3ae693
 *
Packit 3ae693
 * A canberra property list object. Basically a hashtable.
Packit 3ae693
 */
Packit 3ae693
typedef struct ca_proplist ca_proplist;
Packit 3ae693
Packit 3ae693
int ca_proplist_create(ca_proplist **p);
Packit 3ae693
int ca_proplist_destroy(ca_proplist *p);
Packit 3ae693
int ca_proplist_sets(ca_proplist *p, const char *key, const char *value);
Packit 3ae693
int ca_proplist_setf(ca_proplist *p, const char *key, const char *format, ...) __attribute__((format(printf, 3, 4)));
Packit 3ae693
int ca_proplist_set(ca_proplist *p, const char *key, const void *data, size_t nbytes);
Packit 3ae693
Packit 3ae693
int ca_context_create(ca_context **c);
Packit 3ae693
int ca_context_set_driver(ca_context *c, const char *driver);
Packit 3ae693
int ca_context_change_device(ca_context *c, const char *device);
Packit 3ae693
int ca_context_open(ca_context *c);
Packit 3ae693
int ca_context_destroy(ca_context *c);
Packit 3ae693
int ca_context_change_props(ca_context *c, ...) __attribute__((sentinel));
Packit 3ae693
int ca_context_change_props_full(ca_context *c, ca_proplist *p);
Packit 3ae693
int ca_context_play_full(ca_context *c, uint32_t id, ca_proplist *p, ca_finish_callback_t cb, void *userdata);
Packit 3ae693
int ca_context_play(ca_context *c, uint32_t id, ...) __attribute__((sentinel));
Packit 3ae693
int ca_context_cache_full(ca_context *c, ca_proplist *p);
Packit 3ae693
int ca_context_cache(ca_context *c, ...) __attribute__((sentinel));
Packit 3ae693
int ca_context_cancel(ca_context *c, uint32_t id);
Packit 3ae693
int ca_context_playing(ca_context *c, uint32_t id, int *playing);
Packit 3ae693
Packit 3ae693
const char *ca_strerror(int code);
Packit 3ae693
Packit 3ae693
#ifdef __cplusplus
Packit 3ae693
}
Packit 3ae693
#endif
Packit 3ae693
Packit 3ae693
#endif