]> code.delx.au - pulseaudio/blob - polyp/polyplib-introspect.h
minor cleanups
[pulseaudio] / polyp / polyplib-introspect.h
1 #ifndef foopolyplibintrospecthfoo
2 #define foopolyplibintrospecthfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <inttypes.h>
26
27 #include "polyplib-operation.h"
28 #include "polyplib-context.h"
29 #include "cdecl.h"
30
31 /** \file
32 * Routines for daemon introspection. */
33
34 PA_C_DECL_BEGIN
35
36 struct pa_sink_info {
37 const char *name;
38 uint32_t index;
39 const char *description;
40 struct pa_sample_spec sample_spec;
41 uint32_t owner_module;
42 pa_volume_t volume;
43 uint32_t monitor_source;
44 const char *monitor_source_name;
45 pa_usec_t latency;
46 };
47
48 struct pa_operation* pa_context_get_sink_info_by_name(struct pa_context *c, const char *name, void (*cb)(struct pa_context *c, const struct pa_sink_info *i, int is_last, void *userdata), void *userdata);
49 struct pa_operation* pa_context_get_sink_info_by_index(struct pa_context *c, uint32_t id, void (*cb)(struct pa_context *c, const struct pa_sink_info *i, int is_last, void *userdata), void *userdata);
50 struct pa_operation* pa_context_get_sink_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_sink_info *i, int is_last, void *userdata), void *userdata);
51
52 struct pa_source_info {
53 const char *name;
54 uint32_t index;
55 const char *description;
56 struct pa_sample_spec sample_spec;
57 uint32_t owner_module;
58 uint32_t monitor_of_sink;
59 const char *monitor_of_sink_name;
60 };
61
62 struct pa_operation* pa_context_get_source_info_by_name(struct pa_context *c, const char *name, void (*cb)(struct pa_context *c, const struct pa_source_info *i, int is_last, void *userdata), void *userdata);
63 struct pa_operation* pa_context_get_source_info_by_index(struct pa_context *c, uint32_t id, void (*cb)(struct pa_context *c, const struct pa_source_info *i, int is_last, void *userdata), void *userdata);
64 struct pa_operation* pa_context_get_source_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_source_info *i, int is_last, void *userdata), void *userdata);
65
66 /** Server information */
67 struct pa_server_info {
68 const char *user_name; /**< User name of the daemon process */
69 const char *host_name; /**< Host name the daemon is running on */
70 const char *server_version; /**< Version string of the daemon */
71 const char *server_name; /**< Server package name (usually "polypaudio") */
72 struct pa_sample_spec sample_spec; /**< Default sample specification */
73 };
74
75 struct pa_operation* pa_context_get_server_info(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_server_info*i, void *userdata), void *userdata);
76
77 struct pa_module_info {
78 uint32_t index;
79 const char*name, *argument;
80 uint32_t n_used, auto_unload;
81 };
82
83 struct pa_operation* pa_context_get_module_info(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_module_info*i, int is_last, void *userdata), void *userdata);
84 struct pa_operation* pa_context_get_module_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_module_info*i, int is_last, void *userdata), void *userdata);
85
86 struct pa_client_info {
87 uint32_t index;
88 const char *name;
89 uint32_t owner_module;
90 const char *protocol_name;
91 };
92
93 struct pa_operation* pa_context_get_client_info(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_client_info*i, int is_last, void *userdata), void *userdata);
94 struct pa_operation* pa_context_get_client_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_client_info*i, int is_last, void *userdata), void *userdata);
95
96 /** Stores information about sink inputs */
97 struct pa_sink_input_info {
98 uint32_t index; /**< Name of this index */
99 const char *name; /**< Name of the sink input */
100 uint32_t owner_module; /**< Index of the module this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any module */
101 uint32_t client; /**< Index of the client this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any client */
102 uint32_t sink; /**< Index of the connected sink */
103 struct pa_sample_spec sample_spec; /**< The sample specification of the sink input */
104 pa_volume_t volume; /**< The volume of this sink input */
105 pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_latency_info for details */
106 pa_usec_t sink_usec; /**< Latency of the sink device, see pa_latency_info for details */
107 };
108
109 struct pa_operation* pa_context_get_sink_input_info(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_sink_input_info*i, int is_last, void *userdata), void *userdata);
110 struct pa_operation* pa_context_get_sink_input_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_sink_input_info*i, int is_last, void *userdata), void *userdata);
111
112 struct pa_source_output_info {
113 uint32_t index;
114 const char *name;
115 uint32_t owner_module;
116 uint32_t client;
117 uint32_t source;
118 struct pa_sample_spec sample_spec;
119 };
120
121 struct pa_operation* pa_context_get_source_output_info(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_source_output_info*i, int is_last, void *userdata), void *userdata);
122 struct pa_operation* pa_context_get_source_output_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_source_output_info*i, int is_last, void *userdata), void *userdata);
123
124 /** Set the volume of a sink device specified by its index */
125 struct pa_operation* pa_context_set_sink_volume_by_index(struct pa_context *c, uint32_t index, pa_volume_t volume, void (*cb)(struct pa_context *c, int success, void *userdata), void *userdata);
126
127 /** Set the volume of a sink device specified by its name */
128 struct pa_operation* pa_context_set_sink_volume_by_name(struct pa_context *c, const char *name, pa_volume_t volume, void (*cb)(struct pa_context *c, int success, void *userdata), void *userdata);
129
130 /** Set the volume of a sink input stream */
131 struct pa_operation* pa_context_set_sink_input_volume(struct pa_context *c, uint32_t index, pa_volume_t volume, void (*cb)(struct pa_context *c, int success, void *userdata), void *userdata);
132
133 /** Memory block statistics */
134 struct pa_stat_info {
135 uint32_t memblock_total; /**< Currently allocated memory blocks */
136 uint32_t memblock_total_size; /**< Currentl total size of allocated memory blocks */
137 uint32_t memblock_allocated; /**< Allocated memory blocks during the whole lifetime of the daemon */
138 uint32_t memblock_allocated_size; /**< Total size of all memory blocks allocated during the whole lifetime of the daemon */
139 };
140
141 /** Get daemon memory block statistics */
142 struct pa_operation* pa_context_stat(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_stat_info *i, void *userdata), void *userdata);
143
144 struct pa_sample_info {
145 uint32_t index;
146 const char *name;
147 uint32_t volume;
148 struct pa_sample_spec sample_spec;
149 uint32_t duration;
150 };
151
152 struct pa_operation* pa_context_get_sample_info_by_name(struct pa_context *c, const char *name, void (*cb)(struct pa_context *c, const struct pa_sample_info *i, int is_last, void *userdata), void *userdata);
153 struct pa_operation* pa_context_get_sample_info_by_index(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_sample_info *i, int is_last, void *userdata), void *userdata);
154 struct pa_operation* pa_context_get_sample_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_sample_info *i, int is_last, void *userdata), void *userdata);
155
156 PA_C_DECL_END
157
158 #endif