From f1acb118e98a68fef1135ba7eff3c7caa8f66c74 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 3 Sep 2006 22:52:01 +0000 Subject: beep media player support (patch from Mario Izquierdo) git-svn-id: file:///home/lennart/svn/public/xmms-pulse/trunk@55 ef929aba-56e2-0310-84e0-b7573d389508 --- configure.ac | 75 +++++++++++++++++++++++++++++++++++++++++++++++++----- doc/README.html.in | 2 +- src/Makefile.am | 19 ++++++++++++-- src/plugin.c | 47 +++++++++++++++++++++++++++++++--- 4 files changed, 130 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 6d67ebd..948dc90 100644 --- a/configure.ac +++ b/configure.ac @@ -56,20 +56,81 @@ fi AC_SUBST(PULSE_LIBS) AC_SUBST(PULSE_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 ***]) +# XMMS plugin # + +AC_ARG_ENABLE([xmms], + AS_HELP_STRING([--disable-xmms],[Disable optional XMMS pluggin support]), + [ + case "${enableval}" in + yes) xmms=true ;; + no) xmms=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-xmms) ;; + esac + ], + [xmms=true]) + +if test "x${xmms}" != xfalse ; then + 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` + +else + echo "*** XMMS disabled ***" + XMMS_CFLAGS= + XMMS_LIBS= + XMMS_OUTPUTPLUGINDIR= 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) +AM_CONDITIONAL(BUILD_XMMS, test "x$xmms" = xtrue) + + +# end of xmms # + + +# BMP plugin # + +AC_ARG_ENABLE([bmp], + AS_HELP_STRING([--enable-bmp],[Enable optional Beep-Media-Player pluggin support]), + [ + case "${enableval}" in + yes) bmp=true ;; + no) bmp=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-bmp) ;; + esac + ], + [bmp=false]) + +if test "x${bmp}" != xfalse ; then + PKG_CHECK_MODULES(BMP, [ bmp >= 0.9.7 ]) + + BMP_CFLAGS="$BMP_CFLAGS -I/usr/include/bmp" + BMP_OUTPUTPLUGINDIR=`pkg-config bmp --variable=output_plugin_dir` + +else + echo "*** BMP disabled ***" + BMP_CFLAGS= + BMP_LIBS= + BMP_OUTPUTPLUGINDIR= +fi + +AC_SUBST(BMP_CFLAGS) +AC_SUBST(BMP_LIBS) +AC_SUBST(BMP_OUTPUTPLUGINDIR) + +AM_CONDITIONAL(BUILD_BMP, test "x$bmp" = xtrue) + +# end of bmp # + + # If using GCC specifiy some additional parameters if test "x$GCC" = "xyes" ; then CFLAGS="$CFLAGS -pipe -Wall -W -Wno-unused-parameter" diff --git a/doc/README.html.in b/doc/README.html.in index 3146494..88593b9 100644 --- a/doc/README.html.in +++ b/doc/README.html.in @@ -108,7 +108,7 @@ before configuring the source code.

Acknowledgements

-

None so far.

+

Mario Izquierdo for Beep Media Player support.

Download

diff --git a/src/Makefile.am b/src/Makefile.am index 896e682..6622878 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,11 +20,26 @@ AM_CFLAGS=$(PTHREAD_CFLAGS) AM_LIBADD=$(PTHREAD_LIBS) -xmmsplugindir=$(XMMS_OUTPUTPLUGINDIR) -xmmsplugin_LTLIBRARIES=libxmms-pulse.la +if BUILD_XMMS +xmmsplugindir=$(XMMS_OUTPUTPLUGINDIR) +xmmsplugin_LTLIBRARIES=libxmms-pulse.la libxmms_pulse_la_SOURCES=plugin.c libxmms_pulse_la_LDFLAGS=-module -avoid-version libxmms_pulse_la_LIBADD=$(AM_LIBADD) $(PULSE_LIBS) $(XMMS_LIBS) libxmms_pulse_la_CFLAGS=$(AM_CFLAGS) $(PULSE_CFLAGS) $(XMMS_CFLAGS) +XMMS_CFLAGS+= -DHAVE_XMMS=1 +endif + + +if BUILD_BMP +bmpplugindir=$(BMP_OUTPUTPLUGINDIR) +bmpplugin_LTLIBRARIES=libbmp-pulse.la +libbmp_pulse_la_SOURCES=plugin.c +libbmp_pulse_la_LDFLAGS=-module -avoid-version +libbmp_pulse_la_LIBADD=$(AM_LIBADD) $(PULSE_LIBS) $(BMP_LIBS) +libbmp_pulse_la_CFLAGS=$(AM_CFLAGS) $(PULSE_CFLAGS) $(BMP_CFLAGS) +BMP_CFLAGS+= -DHAVE_BMP=1 +endif + diff --git a/src/plugin.c b/src/plugin.c index a489a84..c54163a 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -32,8 +32,17 @@ #include #include -#include -#include + +#ifdef HAVE_XMMS + #include + #include +#endif + +#ifdef HAVE_BMP + #include + #include +#endif + #include #include @@ -587,8 +596,14 @@ static int pulse_open(AFormat fmt, int rate, int nch) { } pa_threaded_mainloop_lock(mainloop); - + +#ifdef HAVE_XMMS if (!(context = pa_context_new(pa_threaded_mainloop_get_api(mainloop), "XMMS"))) { +#endif + +#if HAVE_BMP + if (!(context = pa_context_new(pa_threaded_mainloop_get_api(mainloop), "Beep-Media-Player"))) { +#endif g_warning("Failed to allocate context"); goto unlock_and_fail; } @@ -705,6 +720,7 @@ static void pulse_about(void) { if (dialog != NULL) return; +#ifdef HAVE_XMMS dialog = xmms_show_message( "About XMMS PulseAudio Output Plugin", "XMMS PulseAudio Output Plugin\n\n " @@ -726,6 +742,31 @@ static void pulse_about(void) { FALSE, NULL, NULL); +#endif + +#ifdef HAVE_BMP + dialog = xmms_show_message( + "About Beep_media-Player PulseAudio Output Plugin", + "Beep-Media-Player PulseAudio Output Plugin\n\n " + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,\n" + "USA.", + "OK", + FALSE, + NULL, + NULL); +#endif gtk_signal_connect( GTK_OBJECT(dialog), -- cgit