diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 19 | ||||
-rw-r--r-- | src/plugin.c | 47 |
2 files changed, 61 insertions, 5 deletions
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 <limits.h> #include <gtk/gtk.h> -#include <plugin.h> -#include <xmmsctrl.h> + +#ifdef HAVE_XMMS + #include <plugin.h> + #include <xmmsctrl.h> +#endif + +#ifdef HAVE_BMP + #include <plugin.h> + #include <beepctrl.h> +#endif + #include <util.h> #include <pulse/pulseaudio.h> @@ -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), |