• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef foopulseextdevicemanagerhfoo
2 #define foopulseextdevicemanagerhfoo
3 
4 /***
5   This file is part of PulseAudio.
6 
7   Copyright 2008 Lennart Poettering
8   Copyright 2009 Colin Guthrie
9 
10   PulseAudio is free software; you can redistribute it and/or modify
11   it under the terms of the GNU Lesser General Public License as published
12   by the Free Software Foundation; either version 2.1 of the License,
13   or (at your option) any later version.
14 
15   PulseAudio is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   General Public License for more details.
19 
20   You should have received a copy of the GNU Lesser General Public License
21   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
22 ***/
23 
24 #include <pulse/cdecl.h>
25 #include <pulse/context.h>
26 #include <pulse/version.h>
27 
28 /** \file
29  *
30  * Routines for controlling module-device-manager
31  */
32 
33 PA_C_DECL_BEGIN
34 
35 /* Don't extend this struct! It will break binary compatibility, because
36  * pa_ext_device_manager_info.role_priorities points to an array of structs
37  * instead of an array of pointers to structs. */
38 typedef struct pa_ext_device_manager_role_priority_info {
39     const char *role;
40     uint32_t priority;
41 } pa_ext_device_manager_role_priority_info;
42 
43 /** Stores information about one device in the device database that is
44  * maintained by module-device-manager. \since 0.9.21 */
45 typedef struct pa_ext_device_manager_info {
46     const char *name;            /**< Identifier string of the device. A string like "sink:" or similar followed by the name of the device. */
47     const char *description;     /**< The description of the device when it was last seen, if applicable and saved */
48     const char *icon;            /**< The icon given to the device */
49     uint32_t index;              /**< The device index if it is currently available or PA_INVALID_INDEX */
50     uint32_t n_role_priorities;  /**< How many role priorities do we have? */
51     pa_ext_device_manager_role_priority_info *role_priorities; /**< An array of role priority structures or NULL */
52 } pa_ext_device_manager_info;
53 
54 /** Callback prototype for pa_ext_device_manager_test(). \since 0.9.21 */
55 typedef void (*pa_ext_device_manager_test_cb_t)(
56         pa_context *c,
57         uint32_t version,
58         void *userdata);
59 
60 /** Test if this extension module is available in the server. \since 0.9.21 */
61 pa_operation *pa_ext_device_manager_test(
62         pa_context *c,
63         pa_ext_device_manager_test_cb_t cb,
64         void *userdata);
65 
66 /** Callback prototype for pa_ext_device_manager_read(). \since 0.9.21 */
67 typedef void (*pa_ext_device_manager_read_cb_t)(
68         pa_context *c,
69         const pa_ext_device_manager_info *info,
70         int eol,
71         void *userdata);
72 
73 /** Read all entries from the device database. \since 0.9.21 */
74 pa_operation *pa_ext_device_manager_read(
75         pa_context *c,
76         pa_ext_device_manager_read_cb_t cb,
77         void *userdata);
78 
79 /** Sets the description for a device. \since 0.9.21 */
80 pa_operation *pa_ext_device_manager_set_device_description(
81         pa_context *c,
82         const char* device,
83         const char* description,
84         pa_context_success_cb_t cb,
85         void *userdata);
86 
87 /** Delete entries from the device database. \since 0.9.21 */
88 pa_operation *pa_ext_device_manager_delete(
89         pa_context *c,
90         const char *const s[],
91         pa_context_success_cb_t cb,
92         void *userdata);
93 
94 /** Enable the role-based device-priority routing mode. \since 0.9.21 */
95 pa_operation *pa_ext_device_manager_enable_role_device_priority_routing(
96         pa_context *c,
97         int enable,
98         pa_context_success_cb_t cb,
99         void *userdata);
100 
101 /** Prefer a given device in the priority list. \since 0.9.21 */
102 pa_operation *pa_ext_device_manager_reorder_devices_for_role(
103         pa_context *c,
104         const char* role,
105         const char** devices,
106         pa_context_success_cb_t cb,
107         void *userdata);
108 
109 /** Subscribe to changes in the device database. \since 0.9.21 */
110 pa_operation *pa_ext_device_manager_subscribe(
111         pa_context *c,
112         int enable,
113         pa_context_success_cb_t cb,
114         void *userdata);
115 
116 /** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.21 */
117 typedef void (*pa_ext_device_manager_subscribe_cb_t)(
118         pa_context *c,
119         void *userdata);
120 
121 /** Set the subscription callback that is called when
122  * pa_ext_device_manager_subscribe() was called. \since 0.9.21 */
123 void pa_ext_device_manager_set_subscribe_cb(
124         pa_context *c,
125         pa_ext_device_manager_subscribe_cb_t cb,
126         void *userdata);
127 
128 PA_C_DECL_END
129 
130 #endif
131