1 #ifndef foopolyplibhfoo
2 #define foopolyplibhfoo
7 This file is part of polypaudio.
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.
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.
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
25 #include <sys/types.h>
28 #include "polyplib-def.h"
29 #include "mainloop-api.h"
37 struct pa_context
*pa_context_new(struct pa_mainloop_api
*mainloop
, const char *name
);
39 int pa_context_connect(
42 void (*complete
) (struct pa_context
*c
, int success
, void *userdata
),
47 void (*complete
) (struct pa_context
*c
, void *userdata
),
50 void pa_context_free(struct pa_context
*c
);
52 void pa_context_set_die_callback(struct pa_context
*c
, void (*cb
)(struct pa_context
*c
, void *userdata
), void *userdata
);
54 int pa_context_is_dead(struct pa_context
*c
);
55 int pa_context_is_ready(struct pa_context
*c
);
56 int pa_context_errno(struct pa_context
*c
);
58 int pa_context_is_pending(struct pa_context
*c
);
60 void pa_context_exit(struct pa_context
*c
);
61 void pa_context_stat(struct pa_context
*c
, void (*cb
)(struct pa_context
*c
, uint32_t count
, uint32_t total
, void *userdata
), void *userdata
);
65 struct pa_stream
* pa_stream_new(
67 enum pa_stream_direction dir
,
70 const struct pa_sample_spec
*ss
,
71 const struct pa_buffer_attr
*attr
,
72 void (*complete
) (struct pa_stream
*s
, int success
, void *userdata
),
75 void pa_stream_free(struct pa_stream
*p
);
79 void (*complete
) (struct pa_stream
*s
, void *userdata
),
83 void pa_stream_set_die_callback(struct pa_stream
*s
, void (*cb
)(struct pa_stream
*s
, void *userdata
), void *userdata
);
85 void pa_stream_set_write_callback(struct pa_stream
*p
, void (*cb
)(struct pa_stream
*p
, size_t length
, void *userdata
), void *userdata
);
86 void pa_stream_write(struct pa_stream
*p
, const void *data
, size_t length
);
87 size_t pa_stream_writable_size(struct pa_stream
*p
);
89 void pa_stream_set_read_callback(struct pa_stream
*p
, void (*cb
)(struct pa_stream
*p
, const void*data
, size_t length
, void *userdata
), void *userdata
);
91 int pa_stream_is_dead(struct pa_stream
*p
);
92 int pa_stream_is_ready(struct pa_stream
*p
);
94 void pa_stream_get_latency(struct pa_stream
*p
, void (*cb
)(struct pa_stream
*p
, uint32_t latency
, void *userdata
), void *userdata
);
96 struct pa_context
* pa_stream_get_context(struct pa_stream
*p
);
98 struct pa_stream
* pa_context_upload_sample(struct pa_context
*c
, const char *name
, const struct pa_sample_spec
*ss
, size_t length
, void (*cb
) (struct pa_stream
*s
, int success
, void *userdata
), void *userdata
);
99 void pa_stream_finish_sample(struct pa_stream
*p
, void (*cb
)(struct pa_stream
*s
, int success
, void *userdata
), void *userdata
);
101 void pa_context_play_sample(struct pa_context
*c
, const char *name
, const char *dev
, uint32_t volume
, void (*cb
)(struct pa_context
*c
, int success
, void *userdata
), void *userdata
);
102 void pa_context_remove_sample(struct pa_context
*c
, const char *name
, void (*cb
)(struct pa_context
*c
, int success
, void *userdata
), void *userdata
);
104 struct pa_sink_info
{
107 const char *description
;
108 struct pa_sample_spec sample_spec
;
109 uint32_t owner_module
;
111 uint32_t monitor_source
;
112 const char *monitor_source_name
;
116 void 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
);
117 void 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
);
118 void 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
);
120 struct pa_source_info
{
123 const char *description
;
124 struct pa_sample_spec sample_spec
;
125 uint32_t owner_module
;
126 uint32_t monitor_of_sink
;
127 const char *monitor_of_sink_name
;
130 void 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
);
131 void 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
);
132 void 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
);
134 struct pa_server_info
{
135 const char *user_name
;
136 const char *host_name
;
137 const char *server_version
;
138 const char *server_name
;
139 struct pa_sample_spec sample_spec
;
142 void 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
);
144 struct pa_module_info
{
146 const char*name
, *argument
;
147 uint32_t n_used
, auto_unload
;
150 void 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
);
151 void 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
);
153 struct pa_client_info
{
156 uint32_t owner_module
;
157 const char *protocol_name
;
160 void 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
);
161 void 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
);
163 void pa_context_subscribe(struct pa_context
*c
, enum pa_subscription_mask m
, void (*cb
)(struct pa_context
*c
, enum pa_subscription_event_type t
, uint32_t index
, void *userdata
), void *userdata
);