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