]> code.delx.au - pulseaudio/blob - src/pulse/ext-device-manager.h
device-manager: Update docs version -> 0.9.20
[pulseaudio] / src / pulse / ext-device-manager.h
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, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 USA.
24 ***/
25
26 #include <pulse/context.h>
27 #include <pulse/version.h>
28
29 /** \file
30 *
31 * Routines for controlling module-device-manager
32 */
33
34 PA_C_DECL_BEGIN
35
36 typedef struct pa_ext_device_manager_role_priority_info {
37 const char *role;
38 uint32_t priority;
39 } pa_ext_device_manager_role_priority_info;
40
41 /** Stores information about one device in the device database that is
42 * maintained by module-device-manager. \since 0.9.21 */
43 typedef struct pa_ext_device_manager_info {
44 const char *name; /**< Identifier string of the device. A string like "sink:" or similar followed by the name of the device. */
45 const char *description; /**< The description of the device when it was last seen, if applicable and saved */
46 const char *icon; /**< The icon given to the device */
47 uint32_t index; /**< The device index if it is currently available or PA_INVALID_INDEX */
48 uint32_t n_role_priorities; /**< How many role priorities do we have? */
49 pa_ext_device_manager_role_priority_info *role_priorities; /**< An array of role priority structures or NULL */
50 } pa_ext_device_manager_info;
51
52 /** Callback prototype for pa_ext_device_manager_test(). \since 0.9.21 */
53 typedef void (*pa_ext_device_manager_test_cb_t)(
54 pa_context *c,
55 uint32_t version,
56 void *userdata);
57
58 /** Test if this extension module is available in the server. \since 0.9.21 */
59 pa_operation *pa_ext_device_manager_test(
60 pa_context *c,
61 pa_ext_device_manager_test_cb_t cb,
62 void *userdata);
63
64 /** Callback prototype for pa_ext_device_manager_read(). \since 0.9.21 */
65 typedef void (*pa_ext_device_manager_read_cb_t)(
66 pa_context *c,
67 const pa_ext_device_manager_info *info,
68 int eol,
69 void *userdata);
70
71 /** Read all entries from the device database. \since 0.9.21 */
72 pa_operation *pa_ext_device_manager_read(
73 pa_context *c,
74 pa_ext_device_manager_read_cb_t cb,
75 void *userdata);
76
77 /** Sets the description for a device. \since 0.9.21 */
78 pa_operation *pa_ext_device_manager_set_device_description(
79 pa_context *c,
80 const char* device,
81 const char* description,
82 pa_context_success_cb_t cb,
83 void *userdata);
84
85 /** Delete entries from the device database. \since 0.9.21 */
86 pa_operation *pa_ext_device_manager_delete(
87 pa_context *c,
88 const char *const s[],
89 pa_context_success_cb_t cb,
90 void *userdata);
91
92 /** Enable the role-based device-priority routing mode. \since 0.9.21 */
93 pa_operation *pa_ext_device_manager_enable_role_device_priority_routing(
94 pa_context *c,
95 int enable,
96 pa_context_success_cb_t cb,
97 void *userdata);
98
99 /** Prefer a given device in the priority list. \since 0.9.21 */
100 pa_operation *pa_ext_device_manager_reorder_devices_for_role(
101 pa_context *c,
102 const char* role,
103 const char** devices,
104 pa_context_success_cb_t cb,
105 void *userdata);
106
107 /** Subscribe to changes in the device database. \since 0.9.21 */
108 pa_operation *pa_ext_device_manager_subscribe(
109 pa_context *c,
110 int enable,
111 pa_context_success_cb_t cb,
112 void *userdata);
113
114 /** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.21 */
115 typedef void (*pa_ext_device_manager_subscribe_cb_t)(
116 pa_context *c,
117 void *userdata);
118
119 /** Set the subscription callback that is called when
120 * pa_ext_device_manager_subscribe() was called. \since 0.9.21 */
121 void pa_ext_device_manager_set_subscribe_cb(
122 pa_context *c,
123 pa_ext_device_manager_subscribe_cb_t cb,
124 void *userdata);
125
126 PA_C_DECL_END
127
128 #endif