]> code.delx.au - pulseaudio/blob - src/pulse/ext-device-manager.h
device-manager: Add an untested protocol extension.
[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-stream-restore
32 */
33
34 PA_C_DECL_BEGIN
35
36 /** Stores information about one device in the device database that is
37 * maintained by module-device-manager. \since 0.9.17 */
38 typedef struct pa_ext_device_manager_info {
39 const char *name; /**< Identifier string of the device. A string like "sink:" or similar followed by the name of the device. */
40 const char *description; /**< The description of the device when it was last seen, if applicable and saved */
41 } pa_ext_device_manager_info;
42
43 /** Callback prototype for pa_ext_device_manager_test(). \since 0.9.17 */
44 typedef void (*pa_ext_device_manager_test_cb_t)(
45 pa_context *c,
46 uint32_t version,
47 void *userdata);
48
49 /** Test if this extension module is available in the server. \since 0.9.17 */
50 pa_operation *pa_ext_device_manager_test(
51 pa_context *c,
52 pa_ext_device_manager_test_cb_t cb,
53 void *userdata);
54
55 /** Callback prototype for pa_ext_device_manager_read(). \since 0.9.17 */
56 typedef void (*pa_ext_device_manager_read_cb_t)(
57 pa_context *c,
58 const pa_ext_device_manager_info *info,
59 int eol,
60 void *userdata);
61
62 /** Read all entries from the device database. \since 0.9.17 */
63 pa_operation *pa_ext_device_manager_read(
64 pa_context *c,
65 pa_ext_device_manager_read_cb_t cb,
66 void *userdata);
67
68 /** Store entries in the device database. \since 0.9.17 */
69 pa_operation *pa_ext_device_manager_write(
70 pa_context *c,
71 pa_update_mode_t mode,
72 const pa_ext_device_manager_info data[],
73 unsigned n,
74 int apply_immediately,
75 pa_context_success_cb_t cb,
76 void *userdata);
77
78 /** Delete entries from the device database. \since 0.9.17 */
79 pa_operation *pa_ext_device_manager_delete(
80 pa_context *c,
81 const char *const s[],
82 pa_context_success_cb_t cb,
83 void *userdata);
84
85 /** Subscribe to changes in the device database. \since 0.9.17 */
86 pa_operation *pa_ext_device_manager_subscribe(
87 pa_context *c,
88 int enable,
89 pa_context_success_cb_t cb,
90 void *userdata);
91
92 /** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.17 */
93 typedef void (*pa_ext_device_manager_subscribe_cb_t)(
94 pa_context *c,
95 void *userdata);
96
97 /** Set the subscription callback that is called when
98 * pa_ext_device_manager_subscribe() was called. \since 0.9.17 */
99 void pa_ext_device_manager_set_subscribe_cb(
100 pa_context *c,
101 pa_ext_device_manager_subscribe_cb_t cb,
102 void *userdata);
103
104 PA_C_DECL_END
105
106 #endif