1 | //introspect.c: |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010 |
---|
5 | * The code (may) include prototypes and comments (and maybe |
---|
6 | * other code fragements) from libpulse*. They are mostly copyrighted by: |
---|
7 | * Lennart Poettering <poettering@users.sourceforge.net> and |
---|
8 | * Pierre Ossman <drzeus@drzeus.cx> |
---|
9 | * |
---|
10 | * This file is part of libroarpulse a part of RoarAudio, |
---|
11 | * a cross-platform sound system for both, home and professional use. |
---|
12 | * See README for details. |
---|
13 | * |
---|
14 | * This file is free software; you can redistribute it and/or modify |
---|
15 | * it under the terms of the GNU General Public License version 3 |
---|
16 | * as published by the Free Software Foundation. |
---|
17 | * |
---|
18 | * RoarAudio is distributed in the hope that it will be useful, |
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | * GNU General Public License for more details. |
---|
22 | * |
---|
23 | * You should have received a copy of the GNU General Public License |
---|
24 | * along with this software; see the file COPYING. If not, write to |
---|
25 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
26 | * |
---|
27 | * NOTE for everyone want's to change something and send patches: |
---|
28 | * read README and HACKING! There a addition information on |
---|
29 | * the license of this document you need to read before you send |
---|
30 | * any patches. |
---|
31 | * |
---|
32 | * NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc |
---|
33 | * or libpulse*: |
---|
34 | * The libs libroaresd, libroararts and libroarpulse link this libroar |
---|
35 | * and are therefore GPL. Because of this it may be illigal to use |
---|
36 | * them with any software that uses libesd, libartsc or libpulse*. |
---|
37 | */ |
---|
38 | |
---|
39 | #include <libroarpulse/libroarpulse.h> |
---|
40 | |
---|
41 | /** Get information about a sink by its name */ |
---|
42 | pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name, pa_sink_info_cb_t cb, void *userdata); |
---|
43 | |
---|
44 | /** Get information about a sink by its index */ |
---|
45 | pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t id, pa_sink_info_cb_t cb, void *userdata); |
---|
46 | |
---|
47 | /** Get the complete sink list */ |
---|
48 | pa_operation* pa_context_get_sink_info_list(pa_context *c, pa_sink_info_cb_t cb, void *userdata); |
---|
49 | |
---|
50 | /** Get information about a source by its name */ |
---|
51 | pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name, pa_source_info_cb_t cb, void *userdata); |
---|
52 | |
---|
53 | /** Get information about a source by its index */ |
---|
54 | pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t id, pa_source_info_cb_t cb, void *userdata); |
---|
55 | |
---|
56 | /** Get the complete source list */ |
---|
57 | pa_operation* pa_context_get_source_info_list(pa_context *c, pa_source_info_cb_t cb, void *userdata); |
---|
58 | |
---|
59 | /** Get some information about the server */ |
---|
60 | pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata) { |
---|
61 | struct roar_stream stream; |
---|
62 | struct roar_client client; |
---|
63 | pa_server_info painfo; |
---|
64 | |
---|
65 | if ( c == NULL ) |
---|
66 | return roar_pa_op_new_done(); |
---|
67 | |
---|
68 | if ( roar_server_oinfo(roar_pa_context_get_con(c), &stream) == -1 ) |
---|
69 | return roar_pa_op_new_done(); |
---|
70 | |
---|
71 | if ( roar_get_client(roar_pa_context_get_con(c), &client, 0) == -1 ) |
---|
72 | return roar_pa_op_new_done(); |
---|
73 | |
---|
74 | memset(&painfo, 0, sizeof(painfo)); |
---|
75 | |
---|
76 | painfo.user_name = "(none)"; |
---|
77 | painfo.host_name = pa_context_get_server(c); |
---|
78 | painfo.server_version = pa_get_library_version(); |
---|
79 | painfo.server_name = "pulseaudio"; |
---|
80 | painfo.default_sink_name = NULL; |
---|
81 | painfo.default_source_name = NULL; |
---|
82 | painfo.cookie = 0x524F4152; |
---|
83 | painfo.cookie ^= (client.pid & 0xFF) | (client.uid & 0xFF) << 8 | (client.gid & 0xFF) << 16; |
---|
84 | |
---|
85 | if ( cb != NULL ) { |
---|
86 | cb(c, &painfo, userdata); |
---|
87 | } |
---|
88 | |
---|
89 | return roar_pa_op_new_done(); |
---|
90 | } |
---|
91 | |
---|
92 | /** Get some information about a module by its index */ |
---|
93 | pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_info_cb_t cb, void *userdata); |
---|
94 | |
---|
95 | /** Get the complete list of currently loaded modules */ |
---|
96 | pa_operation* pa_context_get_module_info_list(pa_context *c, pa_module_info_cb_t cb, void *userdata); |
---|
97 | |
---|
98 | /** Get information about a client by its index */ |
---|
99 | pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_info_cb_t cb, void *userdata); |
---|
100 | |
---|
101 | /** Get the complete client list */ |
---|
102 | pa_operation* pa_context_get_client_info_list(pa_context *c, pa_client_info_cb_t cb, void *userdata); |
---|
103 | |
---|
104 | /** Get some information about a sink input by its index */ |
---|
105 | pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata); |
---|
106 | |
---|
107 | /** Get the complete sink input list */ |
---|
108 | pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata); |
---|
109 | |
---|
110 | /** Get information about a source output by its index */ |
---|
111 | pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_source_output_info_cb_t cb, void *userdata); |
---|
112 | |
---|
113 | /** Get the complete list of source outputs */ |
---|
114 | pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_output_info_cb_t cb, void *userdata); |
---|
115 | |
---|
116 | /** Set the volume of a sink device specified by its index */ |
---|
117 | pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); |
---|
118 | |
---|
119 | /** Set the volume of a sink device specified by its name */ |
---|
120 | pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); |
---|
121 | |
---|
122 | /** Set the mute switch of a sink device specified by its index \since 0.8 */ |
---|
123 | pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata); |
---|
124 | |
---|
125 | /** Set the mute switch of a sink device specified by its name \since 0.8 */ |
---|
126 | pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata); |
---|
127 | |
---|
128 | /** Set the volume of a sink input stream */ |
---|
129 | pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); |
---|
130 | |
---|
131 | /** Set the volume of a source device specified by its index \since 0.8 */ |
---|
132 | pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); |
---|
133 | |
---|
134 | /** Set the volume of a source device specified by its name \since 0.8 */ |
---|
135 | pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); |
---|
136 | |
---|
137 | /** Set the mute switch of a source device specified by its index \since 0.8 */ |
---|
138 | pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata); |
---|
139 | |
---|
140 | /** Set the mute switch of a source device specified by its name \since 0.8 */ |
---|
141 | pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata); |
---|
142 | |
---|
143 | /** Get daemon memory block statistics */ |
---|
144 | pa_operation* pa_context_stat(pa_context *c, pa_stat_info_cb_t cb, void *userdata); |
---|
145 | |
---|
146 | /** Get information about a sample by its name */ |
---|
147 | pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name, pa_sample_info_cb_t cb, void *userdata); |
---|
148 | |
---|
149 | /** Get information about a sample by its index */ |
---|
150 | pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, pa_sample_info_cb_t cb, void *userdata); |
---|
151 | |
---|
152 | /** Get the complete list of samples stored in the daemon. */ |
---|
153 | pa_operation* pa_context_get_sample_info_list(pa_context *c, pa_sample_info_cb_t cb, void *userdata); |
---|
154 | |
---|
155 | /** Kill a client. \since 0.5 */ |
---|
156 | pa_operation* pa_context_kill_client(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata); |
---|
157 | |
---|
158 | /** Kill a sink input. \since 0.5 */ |
---|
159 | pa_operation* pa_context_kill_sink_input(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata); |
---|
160 | |
---|
161 | /** Kill a source output. \since 0.5 */ |
---|
162 | pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata); |
---|
163 | |
---|
164 | /** Load a module. \since 0.5 */ |
---|
165 | pa_operation* pa_context_load_module(pa_context *c, const char*name, const char *argument, pa_context_index_cb_t cb, void *userdata); |
---|
166 | |
---|
167 | /** Unload a module. \since 0.5 */ |
---|
168 | pa_operation* pa_context_unload_module(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata); |
---|
169 | |
---|
170 | |
---|
171 | /** Get info about a specific autoload entry. \since 0.6 */ |
---|
172 | pa_operation* pa_context_get_autoload_info_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_autoload_info_cb_t cb, void *userdata); |
---|
173 | |
---|
174 | /** Get info about a specific autoload entry. \since 0.6 */ |
---|
175 | pa_operation* pa_context_get_autoload_info_by_index(pa_context *c, uint32_t idx, pa_autoload_info_cb_t cb, void *userdata); |
---|
176 | |
---|
177 | /** Get the complete list of autoload entries. \since 0.5 */ |
---|
178 | pa_operation* pa_context_get_autoload_info_list(pa_context *c, pa_autoload_info_cb_t cb, void *userdata); |
---|
179 | |
---|
180 | /** Add a new autoload entry. \since 0.5 */ |
---|
181 | pa_operation* pa_context_add_autoload(pa_context *c, const char *name, pa_autoload_type_t type, const char *module, const char*argument, pa_context_index_cb_t, void* userdata); |
---|
182 | |
---|
183 | /** Remove an autoload entry. \since 0.6 */ |
---|
184 | pa_operation* pa_context_remove_autoload_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_context_success_cb_t cb, void* userdata); |
---|
185 | |
---|
186 | /** Remove an autoload entry. \since 0.6 */ |
---|
187 | pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void* userdata); |
---|
188 | |
---|
189 | /** Move the specified sink input to a different sink. \since 0.9.5 */ |
---|
190 | pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, char *sink_name, pa_context_success_cb_t cb, void* userdata); |
---|
191 | |
---|
192 | /** Move the specified sink input to a different sink. \since 0.9.5 */ |
---|
193 | pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, uint32_t sink_idx, pa_context_success_cb_t cb, void* userdata); |
---|
194 | |
---|
195 | /** Move the specified source output to a different source. \since 0.9.5 */ |
---|
196 | pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, char *source_name, pa_context_success_cb_t cb, void* userdata); |
---|
197 | |
---|
198 | /** Move the specified source output to a different source. \since 0.9.5 */ |
---|
199 | pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata); |
---|
200 | |
---|
201 | //ll |
---|