]> code.delx.au - pulseaudio/blob - src/pulse/ext-device-restore.h
ext-device-restore: Include format.h
[pulseaudio] / src / pulse / ext-device-restore.h
1 #ifndef foopulseextdevicerestorehfoo
2 #define foopulseextdevicerestorehfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2008 Lennart Poettering
8 Copyright 2011 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 #include <pulse/format.h>
29
30 /** \file
31 *
32 * Routines for controlling module-device-restore
33 */
34
35 PA_C_DECL_BEGIN
36
37 /** Stores information about one device in the device database that is
38 * maintained by module-device-manager. \since 1.0 */
39 typedef struct pa_ext_device_restore_info {
40 uint32_t index; /**< The device index */
41 uint8_t n_formats; /**< How many formats do we have? */
42 pa_format_info **formats; /**< An array of formats (may be NULL if n_formats == 0) */
43 } pa_ext_device_restore_info;
44
45 /** Callback prototype for pa_ext_device_restore_test(). \since 1.0 */
46 typedef void (*pa_ext_device_restore_test_cb_t)(
47 pa_context *c,
48 uint32_t version,
49 void *userdata);
50
51 /** Test if this extension module is available in the server. \since 1.0 */
52 pa_operation *pa_ext_device_restore_test(
53 pa_context *c,
54 pa_ext_device_restore_test_cb_t cb,
55 void *userdata);
56
57 /** Subscribe to changes in the device database. \since 1.0 */
58 pa_operation *pa_ext_device_restore_subscribe(
59 pa_context *c,
60 int enable,
61 pa_context_success_cb_t cb,
62 void *userdata);
63
64 /** Callback prototype for pa_ext_device_restore_set_subscribe_cb(). \since 1.0 */
65 typedef void (*pa_ext_device_restore_subscribe_cb_t)(
66 pa_context *c,
67 uint32_t idx,
68 void *userdata);
69
70 /** Set the subscription callback that is called when
71 * pa_ext_device_restore_subscribe() was called. \since 1.0 */
72 void pa_ext_device_restore_set_subscribe_cb(
73 pa_context *c,
74 pa_ext_device_restore_subscribe_cb_t cb,
75 void *userdata);
76
77 /** Callback prototype for pa_ext_device_restore_read_sink_formats(). \since 1.0 */
78 typedef void (*pa_ext_device_restore_read_device_formats_cb_t)(
79 pa_context *c,
80 const pa_ext_device_restore_info *info,
81 int eol,
82 void *userdata);
83
84 /** Read the formats for all present sinks from the device database. \since 1.0 */
85 pa_operation *pa_ext_device_restore_read_sink_formats_all(
86 pa_context *c,
87 pa_ext_device_restore_read_device_formats_cb_t cb,
88 void *userdata);
89
90 /** Read an entry from the device database. \since 1.0 */
91 pa_operation *pa_ext_device_restore_read_sink_formats(
92 pa_context *c,
93 uint32_t idx,
94 pa_ext_device_restore_read_device_formats_cb_t cb,
95 void *userdata);
96
97 /** Read an entry from the device database. \since 1.0 */
98 pa_operation *pa_ext_device_restore_save_sink_formats(
99 pa_context *c,
100 uint32_t idx,
101 uint8_t n_formats,
102 pa_format_info **formats,
103 pa_context_success_cb_t cb,
104 void *userdata);
105
106 PA_C_DECL_END
107
108 #endif