module-simple-protocol-unix.la module-cli-protocol-tcp.la \
libprotocol-cli.la module-cli-protocol-unix.la libtagstruct.la \
libpdispatch.la libprotocol-native.la libpstream-util.la \
- module-native-protocol-tcp.la module-native-protocol-unix.la \
+ module-native-protocol-tcp.la module-native-protocol-unix.la \
libpolyp.la
polypaudio_SOURCES = idxset.c idxset.h \
libprotocol_native_la_SOURCES = protocol-native.c protocol-native.h
libprotocol_native_la_LDFLAGS = -avoid-version
-libprotocol_native_la_LIBADD = libsocket-server.la libiochannel.la libpacket.la libpstream.la libpstream-util.la
+libprotocol_native_la_LIBADD = libsocket-server.la libiochannel.la libpacket.la libpstream.la libpstream-util.la libpdispatch.la
libtagstruct_la_SOURCES = tagstruct.c tagstruct.h
libtagstruct_la_LDFLAGS = -avoid-version
assert(c);
module_load(c, "module-oss-mmap", "/dev/dsp1");
- module_load(c, "module-pipe-sink", NULL);
+/* module_load(c, "module-pipe-sink", NULL);
module_load(c, "module-simple-protocol-tcp", NULL);
+ module_load(c, "module-simple-protocol-unix", NULL);*/
+ module_load(c, "module-cli-protocol-tcp", NULL);
+/* module_load(c, "module-cli-protocol-unix", NULL);
+ module_load(c, "module-native-protocol-tcp", NULL);*/
+ module_load(c, "module-native-protocol-unix", NULL);
module_load(c, "module-cli", NULL);
fprintf(stderr, "main: mainloop entry.\n");
#include "protocol-simple.h"
#define protocol_free protocol_simple_free
#define IPV4_PORT 4711
+ #define UNIX_SOCKET "/tmp/polypaudio_simple"
#else
#ifdef USE_PROTOCOL_CLI
#include "protocol-cli.h"
#define protocol_new protocol_cli_new
#define protocol_free protocol_cli_free
#define IPV4_PORT 4712
+ #define UNIX_SOCKET "/tmp/polypaudio_cli"
#else
#ifdef USE_PROTOCOL_NATIVE
#include "protocol-native.h"
#define protocol_new protocol_native_new
#define protocol_free protocol_native_free
#define IPV4_PORT 4713
+ #define UNIX_SOCKET "/tmp/polypaudio_native"
#else
#error "Broken build system"
#endif
if (!(s = socket_server_new_ipv4(c->mainloop, INADDR_LOOPBACK, IPV4_PORT)))
return -1;
#else
- if (!(s = socket_server_new_unix(c->mainloop, "/tmp/polypsimple")))
+ if (!(s = socket_server_new_unix(c->mainloop, UNIX_SOCKET)))
return -1;
#endif
pd->mainloop = mainloop;
pd->command_table = table;
pd->n_commands = entries;
+ pd->replies = NULL;
return pd;
}
#define DEFAULT_MAX_LENGTH 20480
#define DEFAULT_PREBUF 4096
#define DEFAULT_TIMEOUT 5
-#define DEFAULT_SERVER "/tmp/foo"
+#define DEFAULT_SERVER "/tmp/polypaudio_native"
struct pa_context {
char *name;
assert(c->io_source);
} else {
c->fixed_source = c->mainloop->source_fixed(c->mainloop, connect_fixed_cb, c);
- assert(c->io_source);
+ assert(c->fixed_source);
}
return 0;
t->data = (uint8_t*) data;
t->allocated = t->length = data ? length : 0;
t->rindex = 0;
- t->dynamic = !!data;
+ t->dynamic = !data;
return t;
}
static void extend(struct tagstruct*t, size_t l) {
assert(t && t->dynamic);
- if (t->allocated <= l)
+ if (l <= t->allocated)
return;
t->data = realloc(t->data, t->allocated = l+100);
}
void tagstruct_putu32(struct tagstruct*t, uint32_t i) {
- assert(t && i);
+ assert(t);
extend(t, 5);
t->data[t->length] = TAG_U32;
*((uint32_t*) (t->data+t->length+1)) = htonl(i);
}
void tagstruct_putu8(struct tagstruct*t, uint8_t c) {
- assert(t && c);
+ assert(t);
extend(t, 2);
t->data[t->length] = TAG_U8;
*(t->data+t->length+1) = c;