1 module pulse.extdevicerestore;
2 
3 version(linux):
4 
5 import pulse.def;
6 import pulse.operation;
7 import pulse.context;
8 import pulse.format;
9 
10 extern (C):
11 
12 /***
13   This file is part of PulseAudio.
14 
15   Copyright 2008 Lennart Poettering
16   Copyright 2011 Colin Guthrie
17 
18   PulseAudio is free software; you can redistribute it and/or modify
19   it under the terms of the GNU Lesser General Public License as published
20   by the Free Software Foundation; either version 2.1 of the License,
21   or (at your option) any later version.
22 
23   PulseAudio is distributed in the hope that it will be useful, but
24   WITHOUT ANY WARRANTY; without even the implied warranty of
25   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26   General Public License for more details.
27 
28   You should have received a copy of the GNU Lesser General Public License
29   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
30 ***/
31 
32 /** \file
33  *
34  * Routines for controlling module-device-restore
35  */
36 
37 /** Stores information about one device in the device database that is
38  * maintained by module-device-manager. \since 1.0 */
39 struct pa_ext_device_restore_info
40 {
41     pa_device_type_t type; /**< Device type sink or source? */
42     uint index; /**< The device index */
43     ubyte n_formats; /**< How many formats do we have? */
44     pa_format_info** formats; /**< An array of formats (may be NULL if n_formats == 0) */
45 }
46 
47 /** Callback prototype for pa_ext_device_restore_test(). \since 1.0 */
48 alias pa_ext_device_restore_test_cb_t = void function (
49     pa_context* c,
50     uint version_,
51     void* userdata);
52 
53 /** Test if this extension module is available in the server. \since 1.0 */
54 pa_operation* pa_ext_device_restore_test (
55     pa_context* c,
56     pa_ext_device_restore_test_cb_t cb,
57     void* userdata);
58 
59 /** Subscribe to changes in the device database. \since 1.0 */
60 pa_operation* pa_ext_device_restore_subscribe (
61     pa_context* c,
62     int enable,
63     pa_context_success_cb_t cb,
64     void* userdata);
65 
66 /** Callback prototype for pa_ext_device_restore_set_subscribe_cb(). \since 1.0 */
67 alias pa_ext_device_restore_subscribe_cb_t = void function (
68     pa_context* c,
69     pa_device_type_t type,
70     uint idx,
71     void* userdata);
72 
73 /** Set the subscription callback that is called when
74  * pa_ext_device_restore_subscribe() was called. \since 1.0 */
75 void pa_ext_device_restore_set_subscribe_cb (
76     pa_context* c,
77     pa_ext_device_restore_subscribe_cb_t cb,
78     void* userdata);
79 
80 /** Callback prototype for pa_ext_device_restore_read_formats(). \since 1.0 */
81 alias pa_ext_device_restore_read_device_formats_cb_t = void function (
82     pa_context* c,
83     const(pa_ext_device_restore_info)* info,
84     int eol,
85     void* userdata);
86 
87 /** Read the formats for all present devices from the device database. \since 1.0 */
88 pa_operation* pa_ext_device_restore_read_formats_all (
89     pa_context* c,
90     pa_ext_device_restore_read_device_formats_cb_t cb,
91     void* userdata);
92 
93 /** Read an entry from the device database. \since 1.0 */
94 pa_operation* pa_ext_device_restore_read_formats (
95     pa_context* c,
96     pa_device_type_t type,
97     uint idx,
98     pa_ext_device_restore_read_device_formats_cb_t cb,
99     void* userdata);
100 
101 /** Read an entry from the device database. \since 1.0 */
102 pa_operation* pa_ext_device_restore_save_formats (
103     pa_context* c,
104     pa_device_type_t type,
105     uint idx,
106     ubyte n_formats,
107     pa_format_info** formats,
108     pa_context_success_cb_t cb,
109     void* userdata);
110