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