]> code.delx.au - pulseaudio/blob - src/pulse/ext-device-restore.h
alsa-mixer: Add surround 2.1 profile
[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/format.h>
28 #include <pulse/version.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 pa_device_type_t type; /**< Device type sink or source? */
41 uint32_t index; /**< The device index */
42 uint8_t n_formats; /**< How many formats do we have? */
43 pa_format_info **formats; /**< An array of formats (may be NULL if n_formats == 0) */
44 } pa_ext_device_restore_info;
45
46 /** Callback prototype for pa_ext_device_restore_test(). \since 1.0 */
47 typedef void (*pa_ext_device_restore_test_cb_t)(
48 pa_context *c,
49 uint32_t version,
50 void *userdata);
51
52 /** Test if this extension module is available in the server. \since 1.0 */
53 pa_operation *pa_ext_device_restore_test(
54 pa_context *c,
55 pa_ext_device_restore_test_cb_t cb,
56 void *userdata);
57
58 /** Subscribe to changes in the device database. \since 1.0 */
59 pa_operation *pa_ext_device_restore_subscribe(
60 pa_context *c,
61 int enable,
62 pa_context_success_cb_t cb,
63 void *userdata);
64
65 /** Callback prototype for pa_ext_device_restore_set_subscribe_cb(). \since 1.0 */
66 typedef void (*pa_ext_device_restore_subscribe_cb_t)(
67 pa_context *c,
68 pa_device_type_t type,
69 uint32_t idx,
70 void *userdata);
71
72 /** Set the subscription callback that is called when
73 * pa_ext_device_restore_subscribe() was called. \since 1.0 */
74 void pa_ext_device_restore_set_subscribe_cb(
75 pa_context *c,
76 pa_ext_device_restore_subscribe_cb_t cb,
77 void *userdata);
78
79 /** Callback prototype for pa_ext_device_restore_read_formats(). \since 1.0 */
80 typedef void (*pa_ext_device_restore_read_device_formats_cb_t)(
81 pa_context *c,
82 const pa_ext_device_restore_info *info,
83 int eol,
84 void *userdata);
85
86 /** Read the formats for all present devices from the device database. \since 1.0 */
87 pa_operation *pa_ext_device_restore_read_formats_all(
88 pa_context *c,
89 pa_ext_device_restore_read_device_formats_cb_t cb,
90 void *userdata);
91
92 /** Read an entry from the device database. \since 1.0 */
93 pa_operation *pa_ext_device_restore_read_formats(
94 pa_context *c,
95 pa_device_type_t type,
96 uint32_t idx,
97 pa_ext_device_restore_read_device_formats_cb_t cb,
98 void *userdata);
99
100 /** Read an entry from the device database. \since 1.0 */
101 pa_operation *pa_ext_device_restore_save_formats(
102 pa_context *c,
103 pa_device_type_t type,
104 uint32_t idx,
105 uint8_t n_formats,
106 pa_format_info **formats,
107 pa_context_success_cb_t cb,
108 void *userdata);
109
110 PA_C_DECL_END
111
112 #endif