This file is part of polypaudio.
polypaudio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
+ it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with polypaudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
#include <polyp/mainloop-signal.h>
#include <polyp/sample.h>
-#if PA_API_VERSION != PA_API_VERSION_0_6
+#if PA_API_VERSION != 8
#error Invalid Polypaudio API version
#endif
"Server Version: %s\n"
"Default Sample Specification: %s\n"
"Default Sink: %s\n"
- "Default Source: %s\n",
+ "Default Source: %s\n"
+ "Cookie: %08x\n",
i->user_name,
i->host_name,
i->server_name,
i->server_version,
s,
i->default_sink_name,
- i->default_source_name);
+ i->default_source_name,
+ i->cookie);
complete_action();
}
static void get_sink_info_callback(struct pa_context *c, const struct pa_sink_info *i, int is_last, void *userdata) {
- char s[PA_SAMPLE_SPEC_SNPRINT_MAX];
+ char s[PA_SAMPLE_SPEC_SNPRINT_MAX], tid[5];
if (is_last < 0) {
fprintf(stderr, "Failed to get sink information: %s\n", pa_strerror(pa_context_errno(c)));
printf("*** Sink #%u ***\n"
"Name: %s\n"
+ "Type: %s\n"
"Description: %s\n"
"Sample Specification: %s\n"
"Owner Module: %u\n"
"Latency: %0.0f usec\n",
i->index,
i->name,
+ pa_typeid_to_string(i->_typeid, tid, sizeof(tid)),
i->description,
s,
i->owner_module,
i->volume, pa_volume_to_dB(i->volume),
i->monitor_source,
(double) i->latency);
+
}
static void get_source_info_callback(struct pa_context *c, const struct pa_source_info *i, int is_last, void *userdata) {
- char s[PA_SAMPLE_SPEC_SNPRINT_MAX], t[32];
+ char s[PA_SAMPLE_SPEC_SNPRINT_MAX], t[32], tid[5];
if (is_last < 0) {
fprintf(stderr, "Failed to get source information: %s\n", pa_strerror(pa_context_errno(c)));
printf("*** Source #%u ***\n"
"Name: %s\n"
+ "Type: %s\n"
"Description: %s\n"
"Sample Specification: %s\n"
"Owner Module: %u\n"
"Monitor of Sink: %s\n"
"Latency: %0.0f usec\n",
i->index,
+ pa_typeid_to_string(i->_typeid, tid, sizeof(tid)),
i->name,
i->description,
s,
i->owner_module,
i->monitor_of_sink != PA_INVALID_INDEX ? t : "no",
(double) i->latency);
+
}
static void get_module_info_callback(struct pa_context *c, const struct pa_module_info *i, int is_last, void *userdata) {
}
static void get_client_info_callback(struct pa_context *c, const struct pa_client_info *i, int is_last, void *userdata) {
- char t[32];
+ char t[32], tid[5];
if (is_last < 0) {
fprintf(stderr, "Failed to get client information: %s\n", pa_strerror(pa_context_errno(c)));
printf("*** Client #%u ***\n"
"Name: %s\n"
- "Owner Module: %s\n"
- "Protocol Name: %s\n",
+ "Type: %s\n"
+ "Owner Module: %s\n",
i->index,
i->name,
- i->owner_module != PA_INVALID_INDEX ? t : "n/a",
- i->protocol_name);
+ pa_typeid_to_string(i->_typeid, tid, sizeof(tid)),
+ i->owner_module != PA_INVALID_INDEX ? t : "n/a");
}
static void get_sink_input_info_callback(struct pa_context *c, const struct pa_sink_input_info *i, int is_last, void *userdata) {
- char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX];
+ char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX], tid[5];
if (is_last < 0) {
fprintf(stderr, "Failed to get sink input information: %s\n", pa_strerror(pa_context_errno(c)));
printf("*** Sink Input #%u ***\n"
"Name: %s\n"
+ "Type: %s\n"
"Owner Module: %s\n"
"Client: %s\n"
"Sink: %u\n"
"Sample Specification: %s\n"
"Volume: 0x%03x (%0.2f dB)\n"
"Buffer Latency: %0.0f usec\n"
- "Sink Latency: %0.0f usec\n",
+ "Sink Latency: %0.0f usec\n"
+ "Resample method: %s\n",
i->index,
i->name,
+ pa_typeid_to_string(i->_typeid, tid, sizeof(tid)),
i->owner_module != PA_INVALID_INDEX ? t : "n/a",
i->client != PA_INVALID_INDEX ? k : "n/a",
i->sink,
s,
i->volume, pa_volume_to_dB(i->volume),
(double) i->buffer_usec,
- (double) i->sink_usec);
+ (double) i->sink_usec,
+ i->resample_method ? i->resample_method : "n/a");
}
+
static void get_source_output_info_callback(struct pa_context *c, const struct pa_source_output_info *i, int is_last, void *userdata) {
- char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX];
+ char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX], tid[5];
if (is_last < 0) {
fprintf(stderr, "Failed to get source output information: %s\n", pa_strerror(pa_context_errno(c)));
printf("*** Source Output #%u ***\n"
"Name: %s\n"
+ "Type: %s\n"
"Owner Module: %s\n"
"Client: %s\n"
"Source: %u\n"
"Sample Specification: %s\n"
"Buffer Latency: %0.0f usec\n"
- "Source Latency: %0.0f usec\n",
+ "Source Latency: %0.0f usec\n"
+ "Resample method: %s\n",
i->index,
i->name,
+ pa_typeid_to_string(i->_typeid, tid, sizeof(tid)),
i->owner_module != PA_INVALID_INDEX ? t : "n/a",
i->client != PA_INVALID_INDEX ? k : "n/a",
i->source,
s,
(double) i->buffer_usec,
- (double) i->source_usec);
+ (double) i->source_usec,
+ i->resample_method ? i->resample_method : "n/a");
}
static void get_sample_info_callback(struct pa_context *c, const struct pa_sample_info *i, int is_last, void *userdata) {
printf("\n");
nl = 1;
- printf("*** Autoload Entry ***\n"
+ printf("*** Autoload Entry #%u ***\n"
"Name: %s\n"
"Type: %s\n"
"Module: %s\n"
"Argument: %s\n",
+ i->index,
i->name,
i->type == PA_AUTOLOAD_SINK ? "sink" : "source",
i->module,
r = pa_signal_init(mainloop_api);
assert(r == 0);
pa_signal_new(SIGINT, exit_signal_callback, NULL);
+#ifdef SIGPIPE
signal(SIGPIPE, SIG_IGN);
+#endif
if (!(context = pa_context_new(mainloop_api, client_name))) {
fprintf(stderr, "pa_context_new() failed.\n");