From 39ed60f403d82a78ec75dfc8f1ea67c710f7125b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 26 Aug 2004 16:07:12 +0000 Subject: make it compile - nothing more git-svn-id: file:///home/lennart/svn/public/xmms-pulse/trunk@7 ef929aba-56e2-0310-84e0-b7573d389508 --- Makefile.am | 41 +++++++++++++++ bootstrap.sh | 47 +++++++++++++++++ configure.ac | 97 +++++++++++++++++++++++++++++++++++ doc/Makefile.am | 36 +++++++++++++ doc/README.html.in | 107 ++++++++++++++++++++++++++++++++++++++ doc/style.css | 34 ++++++++++++ src/Makefile.am | 27 ++++++++++ src/plugin.c | 148 ++++++++++++++++++++++++++++++++++------------------- 8 files changed, 483 insertions(+), 54 deletions(-) create mode 100644 Makefile.am create mode 100755 bootstrap.sh create mode 100644 configure.ac create mode 100644 doc/Makefile.am create mode 100644 doc/README.html.in create mode 100644 doc/style.css create mode 100644 src/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..2dd3060 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,41 @@ +# $Id$ +# +# This file is part of xmms-polyp. +# +# xmms-polyp is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# xmms-polyp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# 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 +# along with xmms-polyp; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. + +EXTRA_DIST = bootstrap.sh README LICENSE +SUBDIRS=src doc + +MAINTAINERCLEANFILES=README +noinst_DATA = README + +README: + rm -f README + $(MAKE) -C doc README + cd $(srcdir) && ln -s doc/README README + +homepage: all dist + test -d $$HOME/homepage/private + mkdir -p $$HOME/homepage/private/projects/xmms-polyp + cp *.tar.gz $$HOME/homepage/private/projects/xmms-polyp + cp doc/README.html doc/style.css $$HOME/homepage/private/projects/xmms-polyp + cp $$HOME/homepage/private/projects/xmms-polyp/README.html $$HOME/homepage/private/projects/xmms-polyp/index.html + +distcleancheck: + @: + +.PHONY: homepage distcleancheck diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..dd5d53b --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# $Id$ + +# This file is part of xmms-polyp. +# +# xmms-polyp is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# xmms-polyp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# 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 +# along with xmms-polyp; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +run_versioned() { + local P + type -p "$1-$2" &> /dev/null && P="$1-$2" || local P="$1" + + shift 2 + "$P" "$@" +} + +if [ "x$1" = "xam" ] ; then + set -ex + run_versioned automake 1.7 -a -c --foreign + ./config.status +else + set -ex + + rm -rf autom4te.cache + rm -f config.cache + + run_versioned aclocal 1.7 + libtoolize -c --force + autoheader + run_versioned automake 1.7 -a -c --foreign + autoconf -Wall + + CFLAGS="-g -O0" ./configure --sysconfdir=/etc "$@" + + make clean +fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a070ae3 --- /dev/null +++ b/configure.ac @@ -0,0 +1,97 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +# $Id$ + +# This file is part of xmms-polyp. +# +# xmms-polyp is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# xmms-polyp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# 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 +# along with xmms-polyp; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +AC_PREREQ(2.57) +AC_INIT([xmms-polyp],[0.1],[mzkzzfcbylc (at) 0pointer (dot) de]) +AC_CONFIG_SRCDIR([src/plugin.c]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([foreign -Wall]) + +AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/xmms-polyp/]) + +if type -p stow > /dev/null && test -d /usr/local/stow ; then + AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***]) + ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}" +fi + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_LN_S +AC_PROG_LIBTOOL + +AC_TYPE_SIGNAL +AC_HEADER_STDC +AC_CHECK_FUNCS([memset strdup]) +AC_C_CONST +AC_FUNC_MALLOC + +if test -d ../polypaudio ; then + POLYP_CFLAGS='-I$(top_srcdir)/../polypaudio' + POLYP_LIBS='-L$(top_srcdir)/../polypaudio/polyp -lpolyp-simple' + echo "*** Found polypaudio in ../polypaudio, using that version ***" +else + PKG_CHECK_MODULES(POLYP, [ polyplib-simple ]) +fi + +AC_SUBST(POLYP_LIBS) +AC_SUBST(POLYP_CFLAGS) + +AC_PATH_PROG(XMMS_CONFIG, xmms-config) + +if test "x$XMMS_CONFIG" = "x" ; then + AC_MSG_ERROR([*** Please install xmms-config of the xmms-dev package into your \$PATH ***]) +fi + +XMMS_CFLAGS=$($XMMS_CONFIG --cflags) +XMMS_LIBS=$($XMMS_CONFIG --libs) +XMMS_OUTPUTPLUGINDIR=$($XMMS_CONFIG --output-plugin-dir) + +AC_SUBST(XMMS_CFLAGS) +AC_SUBST(XMMS_LIBS) +AC_SUBST(XMMS_OUTPUTPLUGINDIR) + +# If using GCC specifiy some additional parameters +if test "x$GCC" = "xyes" ; then + CFLAGS="$CFLAGS -pipe -Wall -W -Wno-unused-parameter" +fi + +# LYNX documentation generation +AC_ARG_ENABLE(lynx, + AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation), +[case "${enableval}" in + yes) lynx=yes ;; + no) lynx=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;; +esac],[lynx=yes]) + +if test x$lynx = xyes ; then + AC_CHECK_PROG(have_lynx, lynx, yes, no) + + if test x$have_lynx = xno ; then + AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***]) + fi +fi + +AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes]) + +AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile doc/README.html]) +AC_OUTPUT diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..38651bd --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,36 @@ +# $Id$ + +# This file is part of xmms-polyp. +# +# xmms-polyp is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# xmms-polyp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# 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 +# along with xmms-polyp; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +noinst_DATA = README.html README +EXTRA_DIST = $(noinst_DATA) style.css README.html.in + +MAINTAINERCLEANFILES = README README.html +CLEANFILES = + +if USE_LYNX +README: README.html + lynx --dump $^ | sed 's,file://localhost/.*/doc/README.html,README,' > $@ + +CLEANFILES += README +endif + +tidy: README.html + tidy -e < README.html + +.PHONY: tidy + diff --git a/doc/README.html.in b/doc/README.html.in new file mode 100644 index 0000000..dc7bbb1 --- /dev/null +++ b/doc/README.html.in @@ -0,0 +1,107 @@ + + + + + +xmms-polyp @PACKAGE_VERSION@ + + + + +

xmms-polyp @PACKAGE_VERSION@

+ +

Copyright 2004 Lennart Poettering <@PACKAGE_BUGREPORT@>

+ + + +

License

+ +

This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version.

+ +

This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +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 +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

+ +

News

+ +
Fri Aug 20 2004:

Version 0.1 released

+ +

Overview

+ +

xmms-polyp is a libao driver for the polypaudio sound server.

+ +

Status

+ +

It works, what is more to say?

+ +

Documentation

+ +

There is not much to say. Just install this software, the driver will then be available under the name polyp.

+ +

Requirements

+ +

Currently, xmms-polyp is tested on Linux only.

+ +

xmms-polyp was developed and tested on Debian GNU/Linux +"testing" from July 2004, it should work on most other Linux +distributions (and maybe Unix versions) since it uses GNU autoconf for +source code configuration.

+ +

Obviously xmms-polyp requires an installation of +polypaudio (version 0.2) and libao (version 0.8.5 +works, earlier versions probably as well).

+ +

Installation

+ +

As this package is made with the GNU autotools you should run +./configure inside the distribution directory for configuring +the source tree. After that you should run make for +compilation and make install (as root) for installation of +xmms-polyp.

+ +

Make sure that xmms-polyp's driver files are installed +into libao's driver directory. The exact path differs from +distribution to distribution, but is probably something like +/usr/lib/ao/plugins-2. To install xmms-polyp to +that directory make sure to pass --prefix=/usr to the +configure command line.

+ +

Acknowledgements

+ +

None so far.

+ +

Download

+ +

The newest release is always available from @PACKAGE_URL@

+ +

The current release is @PACKAGE_VERSION@

+ +

Get xmms-polyp's development sources from the Subversion repository. (viewcvs)

+ +

If you want to be notified whenever I release a new version of this software use the subscription feature of Freshmeat.

+ +
+
Lennart Poettering <@PACKAGE_BUGREPORT@>, August 2004
+
$Id$
+ + + diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..ac4ffa1 --- /dev/null +++ b/doc/style.css @@ -0,0 +1,34 @@ +/* $Id$ */ + +/*** + * This file is part of xmms-polyp. + * + * xmms-polyp is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xmms-polyp is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * 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 + * along with xmms-polyp; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + ***/ + +body { color: black; background-color: white; margin: 0.5cm; } +a:link, a:visited { color: #900000; } +p { margin-left: 0.5cm; margin-right: 0.5cm; } +div.news-date { margin-left: 0.5cm; font-size: 80%; color: #4f0000; } +p.news-text { margin-left: 1cm; } +h1 { color: #00009F; } +h2 { color: #00009F; } +h3 { color: #00004F; margin-left: 0.5cm; } +ul { margin-left: .5cm; } +ol { margin-left: .5cm; } +pre { margin-left: .5cm; background-color: #f0f0f0; padding: 0.4cm;} +.grey { color: #afafaf; } +table { margin-left: 1cm; border:1px solid lightgrey; padding: 0.2cm; } +td { padding-left:10px; padding-right:10px; } diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..ee1d5fd --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,27 @@ +# $Id$ +# +# This file is part of xmms-polyp. +# +# xmms-polyp is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# xmms-polyp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# 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 +# along with xmms-polyp; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. + +xmmsplugindir=$(XMMS_OUTPUTPLUGINDIR) + +xmmsplugin_LTLIBRARIES=libpolyp.la + +libpolyp_la_SOURCES=plugin.c +libpolyp_la_LDFLAGS=-module -avoid-version +libpolyp_la_LIBADD=$(AM_LIBADD) $(POLYP_LIBS) $(XMMS_LIBS) +libpolyp_la_CFLAGS=$(AM_CFLAGS) $(POLYP_CFLAGS) $(XMMS_CFLAGS) diff --git a/src/plugin.c b/src/plugin.c index 4f9b515..640540d 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,13 @@ +#include +#include #include +#include +#include +#include +#include #include +#include static pthread_cond_t request_cond = PTHREAD_COND_INITIALIZER; static pthread_mutex_t request_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -16,7 +23,9 @@ struct request { MESSAGE_LATENCY, MESSAGE_WRITABLE, MESSAGE_TRIGGER, - } type; + MESSAGE_GETVOLUME, + MESSAGE_SETVOLUME + } message; void *data; struct pa_sample_spec ss; size_t length; @@ -37,11 +46,17 @@ static struct pa_mainloop_api *mainloop_api = NULL; static int failed = 0; static pa_volume_t volume = PA_VOLUME_NORM; static size_t written = 0; -static pa_usec_t latency; static int do_trigger; +static struct pa_sample_spec sample_spec; + +static void *memdup(void *p, size_t l) { + void *r = malloc(l); + memcpy(r, p, l); + return r; +} static void finish_request(int success) { - failed = 1; + failed = success; pthread_mutex_lock(&request_mutex); @@ -69,18 +84,18 @@ static void subscribe_callback(struct pa_context *c, enum pa_subscription_event_ if (!stream || index != pa_stream_get_index(stream) || t != (PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE)) return; - pa_operation_unref(pa_context_get_sink_input_info(c, index, info_callback, NULL); + pa_operation_unref(pa_context_get_sink_input_info(c, index, info_callback, NULL)); } static void stream_state_callback(struct pa_stream *s, void *userdata) { assert(stream == s); - switch(pa_stream_get_state(c)) { + switch(pa_stream_get_state(s)) { case PA_STREAM_CREATING: break; case PA_STREAM_READY: - assert(current_request && current_request->type == MESSAGE_OPEN); - pa_operation_unref(pa_context_get_sink_input_info(context, pa_stream_get_index(s), info_callback, NULL); + assert(current_request && current_request->message == MESSAGE_OPEN); + pa_operation_unref(pa_context_get_sink_input_info(context, pa_stream_get_index(s), info_callback, NULL)); finish_request(1); break; default: @@ -100,12 +115,12 @@ static void context_state_callback(struct pa_context *c, void *userdata) { case PA_CONTEXT_READY : assert(!stream && current_request); pa_context_set_subscribe_callback(context, subscribe_callback, NULL); - pa_operation_unref(pa_context_subscribe(context, PA_SUBSCRIPTION_MASK_SINK_INPUT, NULL, NULL); + pa_operation_unref(pa_context_subscribe(context, PA_SUBSCRIPTION_MASK_SINK_INPUT, NULL, NULL)); - stream = pa_stream_new(c, ¤t_request->ss); + stream = pa_stream_new(c, "xmms", ¤t_request->ss); assert(stream); - pa_stream_set_state(stream, stream_state_callback); + pa_stream_set_state_callback(stream, stream_state_callback, NULL); pa_stream_connect_playback(stream, NULL, NULL); break; @@ -131,13 +146,16 @@ static void context_success_callback(struct pa_context *c, int success, void *us static void latency_callback(struct pa_stream *s, pa_usec_t latency, void *userdata) { assert(s == stream && s); - assert(current_request && current_request>type == MESSAGE_LATENCY); + assert(current_request && current_request->message == MESSAGE_LATENCY); current_request->value = latency; finish_request(latency != (pa_usec_t) -1); } -static void request_func(struct pa_mainloop*api, struct pa_io_event *io, enum pa_io_event_flags f, void *userdata) { +static void request_func(struct pa_mainloop_api*api, struct pa_io_event *io, int fd, enum pa_io_event_flags f, void *userdata) { char x; + + fprintf(stderr, "REQUEST\n"); + assert(api && io && f == PA_IO_EVENT_INPUT); @@ -147,9 +165,9 @@ static void request_func(struct pa_mainloop*api, struct pa_io_event *io, enum pa if (current_request) { if (failed) { - fail(); + finish_request(0); } else { - switch (current_request->type) { + switch (current_request->message) { case MESSAGE_OPEN: assert(!context && !stream); context = pa_context_new(api, "xmms"); @@ -183,7 +201,7 @@ static void request_func(struct pa_mainloop*api, struct pa_io_event *io, enum pa case MESSAGE_PAUSE: case MESSAGE_UNPAUSE: assert(context && stream); - pa_operation_unref(pa_stream_cork(stream, current_request->type == MESSAGE_UNPAUSE, stream_success_callback, NULL)); + pa_operation_unref(pa_stream_cork(stream, current_request->message == MESSAGE_UNPAUSE, stream_success_callback, NULL)); break; case MESSAGE_LATENCY: @@ -238,7 +256,7 @@ static void* thread_func(void *t) { pa_mainloop_run(m, NULL); - api->io_free(io); + mainloop_api->io_free(io); pa_mainloop_free(m); mainloop_api = NULL; @@ -260,7 +278,6 @@ static void start_thread(void) { } static void stop_thread(void) { - struct request req; assert(thread_running); pthread_join(thread_id, NULL); @@ -273,26 +290,6 @@ static void stop_thread(void) { pipe_fds[0] = pipe_fds[1] = -1; } -static void polyp_get_volume(int *l, int *r) { - struct request r; - int v; - - r.message = MESSAGE_GET_VOLUME; - request_execute(&r); - - v = (r.volume*100)/PA_VOLUME_NORM; - - *r = *l = v > 100 ? 100 : v; -} - -void polyp_set_volume(int l, int r) { - struct request r; - - r.message = MESSAGE_SET_VOLUME; - r.volume = ((l+r)*PA_VOLUME_NORM)/200; - request_execute(&r); -} - static void request_execute(struct request *r) { char x = 'x'; assert(r); @@ -314,9 +311,34 @@ static void request_execute(struct request *r) { pthread_mutex_unlock(&request_mutex); } +static void polyp_get_volume(int *l, int *r) { + struct request req; + int v; + fprintf(stderr, "get_volume\n"); + + req.message = MESSAGE_GETVOLUME; + request_execute(&req); + + v = (req.volume*100)/PA_VOLUME_NORM; + + *r = *l = v > 100 ? 100 : v; +} + +void polyp_set_volume(int l, int r) { + struct request req; + fprintf(stderr, "set_volume\n"); + + req.message = MESSAGE_SETVOLUME; + req.volume = ((l+r)*PA_VOLUME_NORM)/200; + request_execute(&req); +} + + static void polyp_pause(short b) { struct request r; - + + fprintf(stderr, "pause: %s\n", b ? "yes" : "no"); + r.message = b ? MESSAGE_PAUSE : MESSAGE_UNPAUSE; request_execute(&r); } @@ -324,6 +346,9 @@ static void polyp_pause(short b) { static int polyp_free(void) { int ret; struct request r; + + fprintf(stderr, "free\n"); + r.message = MESSAGE_WRITABLE; request_execute(&r); @@ -340,6 +365,9 @@ static int polyp_free(void) { static int polyp_playing(void) { struct request r; + + fprintf(stderr, "playing\n"); + r.message = MESSAGE_LATENCY; request_execute(&r); @@ -347,12 +375,16 @@ static int polyp_playing(void) { } static int polyp_get_written_time(void) { + fprintf(stderr, "get_written_time\n"); + return ((written/pa_frame_size(&sample_spec))*1000)/sample_spec.rate; } static int polyp_get_output_time(void) { int t, ms; struct request r; + fprintf(stderr, "get_output_time\n"); + r.message = MESSAGE_LATENCY; request_execute(&r); @@ -367,6 +399,8 @@ static int polyp_get_output_time(void) { static void polyp_flush(int time) { struct request r; + fprintf(stderr, "flush\n"); + r.message = MESSAGE_FLUSH; request_execute(&r); @@ -375,8 +409,10 @@ static void polyp_flush(int time) { static void polyp_write(void* ptr, int length) { struct request r; + fprintf(stderr, "write\n"); + r.message = MESSAGE_WRITE; - r.data = ptr; + r.data = memdup(ptr, length); r.length = length; request_execute(&r); @@ -387,14 +423,15 @@ static void polyp_write(void* ptr, int length) { static int polyp_open(AFormat fmt, int rate, int nch) { struct request r; + fprintf(stderr, "open\n"); if (fmt == FMT_U8) r.ss.format = PA_SAMPLE_U8; else if (fmt == FMT_S16_LE) r.ss.format = PA_SAMPLE_S16LE; - else if (fmt == FM_S16_BE) + else if (fmt == FMT_S16_BE) r.ss.format = PA_SAMPLE_S16BE; - else if (fmt == FM_S16_NE) + else if (fmt == FMT_S16_NE) r.ss.format = PA_SAMPLE_S16NE; else return 0; @@ -405,23 +442,26 @@ static int polyp_open(AFormat fmt, int rate, int nch) { if (!pa_sample_spec_valid(&r.ss)) return 0; + sample_spec = r.ss; + start_thread(); r.message = MESSAGE_OPEN; request_execute(&r); - if (!r->success) { + if (!r.success) { stop_thread(); return 0; } - written = do_trigger = 0; + written = do_trigger = failed = 0; return 1; } static void polyp_close(void) { struct request r; + fprintf(stderr, "close\n"); assert(thread_running); @@ -433,27 +473,27 @@ static void polyp_close(void) { static void polyp_init(void) { + fprintf(stderr, "init\n"); } static OutputPlugin polyp_plugin = { NULL, NULL, "Polypaudio Output Plugin", /* Description */ - polyp_init, /* done */ + polyp_init, NULL, /* polyp_about, */ NULL, /* polyp_configure, */ polyp_get_volume, polyp_set_volume, - - polyp_open, /* done */ - polyp_write, /* done */ - polyp_close, /* done */ - polyp_flush, /* done */ - polyp_pause, /* done */ - polyp_free, /* done */ - polyp_playing, /* done */ - polyp_get_output_time, /* done */ - polyp_get_written_time, /* done */ + polyp_open, + polyp_write, + polyp_close, + polyp_flush, + polyp_pause, + polyp_free, + polyp_playing, + polyp_get_output_time, + polyp_get_written_time, }; OutputPlugin *get_oplugin_info(void) { -- cgit