1 module pulse.extdevicemanager;
2 
3 version(linux):
4 
5 import pulse.def;
6 import pulse.operation;
7 import pulse.context;
8 
9 extern (C):
10 
11 /***
12   This file is part of PulseAudio.
13 
14   Copyright 2008 Lennart Poettering
15   Copyright 2009 Colin Guthrie
16 
17   PulseAudio is free software; you can redistribute it and/or modify
18   it under the terms of the GNU Lesser General Public License as published
19   by the Free Software Foundation; either version 2.1 of the License,
20   or (at your option) any later version.
21 
22   PulseAudio is distributed in the hope that it will be useful, but
23   WITHOUT ANY WARRANTY; without even the implied warranty of
24   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25   General Public License for more details.
26 
27   You should have received a copy of the GNU Lesser General Public License
28   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
29 ***/
30 
31 /** \file
32  *
33  * Routines for controlling module-device-manager
34  */
35 
36 /* Don't extend this struct! It will break binary compatibility, because
37  * pa_ext_device_manager_info.role_priorities points to an array of structs
38  * instead of an array of pointers to structs. */
39 struct pa_ext_device_manager_role_priority_info
40 {
41     const(char)* role;
42     uint priority;
43 }
44 
45 /** Stores information about one device in the device database that is
46  * maintained by module-device-manager. \since 0.9.21 */
47 struct pa_ext_device_manager_info
48 {
49     const(char)* name; /**< Identifier string of the device. A string like "sink:" or similar followed by the name of the device. */
50     const(char)* description; /**< The description of the device when it was last seen, if applicable and saved */
51     const(char)* icon; /**< The icon given to the device */
52     uint index; /**< The device index if it is currently available or PA_INVALID_INDEX */
53     uint n_role_priorities; /**< How many role priorities do we have? */
54     pa_ext_device_manager_role_priority_info* role_priorities; /**< An array of role priority structures or NULL */
55 }
56 
57 /** Callback prototype for pa_ext_device_manager_test(). \since 0.9.21 */
58 alias pa_ext_device_manager_test_cb_t = void function (
59     pa_context* c,
60     uint version_,
61     void* userdata);
62 
63 /** Test if this extension module is available in the server. \since 0.9.21 */
64 pa_operation* pa_ext_device_manager_test (
65     pa_context* c,
66     pa_ext_device_manager_test_cb_t cb,
67     void* userdata);
68 
69 /** Callback prototype for pa_ext_device_manager_read(). \since 0.9.21 */
70 alias pa_ext_device_manager_read_cb_t = void function (
71     pa_context* c,
72     const(pa_ext_device_manager_info)* info,
73     int eol,
74     void* userdata);
75 
76 /** Read all entries from the device database. \since 0.9.21 */
77 pa_operation* pa_ext_device_manager_read (
78     pa_context* c,
79     pa_ext_device_manager_read_cb_t cb,
80     void* userdata);
81 
82 /** Sets the description for a device. \since 0.9.21 */
83 pa_operation* pa_ext_device_manager_set_device_description (
84     pa_context* c,
85     const(char)* device,
86     const(char)* description,
87     pa_context_success_cb_t cb,
88     void* userdata);
89 
90 /** Delete entries from the device database. \since 0.9.21 */
91 pa_operation* pa_ext_device_manager_delete (
92     pa_context* c,
93     const(char*)* s,
94     pa_context_success_cb_t cb,
95     void* userdata);
96 
97 /** Enable the role-based device-priority routing mode. \since 0.9.21 */
98 pa_operation* pa_ext_device_manager_enable_role_device_priority_routing (
99     pa_context* c,
100     int enable,
101     pa_context_success_cb_t cb,
102     void* userdata);
103 
104 /** Prefer a given device in the priority list. \since 0.9.21 */
105 pa_operation* pa_ext_device_manager_reorder_devices_for_role (
106     pa_context* c,
107     const(char)* role,
108     const(char*)* devices,
109     pa_context_success_cb_t cb,
110     void* userdata);
111 
112 /** Subscribe to changes in the device database. \since 0.9.21 */
113 pa_operation* pa_ext_device_manager_subscribe (
114     pa_context* c,
115     int enable,
116     pa_context_success_cb_t cb,
117     void* userdata);
118 
119 /** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.21 */
120 alias pa_ext_device_manager_subscribe_cb_t = void function (
121     pa_context* c,
122     void* userdata);
123 
124 /** Set the subscription callback that is called when
125  * pa_ext_device_manager_subscribe() was called. \since 0.9.21 */
126 void pa_ext_device_manager_set_subscribe_cb (
127     pa_context* c,
128     pa_ext_device_manager_subscribe_cb_t cb,
129     void* userdata);
130