diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 635db2e..838fb28 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -116,7 +116,7 @@ if( WITH_OSS_SINK ) endif( WITH_OSS_SINK ) -##### check polyp support ####################### +##### check pulse support ####################### if( WITH_PULSE_SINK ) diff --git a/PACKAGING b/PACKAGING index da75139..8cbd9f1 100644 --- a/PACKAGING +++ b/PACKAGING @@ -7,9 +7,9 @@ Take especially note of the following: - If you wish to install plugins in a non-standard place, you can change the AKODE_SEARCHDIR definition in lib/pluginhandler.cpp. - You SHOULD not install sinks for backends you don't use. Thus jack_sink - should only be installed when jackd is available, polyp_sink only when - the polypaudio server is used and alsa_sink only when using a Linux kernel + should only be installed when jackd is available, pulse_sink only when + the PulseAudio server is used and alsa_sink only when using a Linux kernel with ALSA drivers. When using direct aKode playback sinks will be autodetected by loading and - probing plugins in this order: polyp, jack, alsa, oss + probing plugins in this order: pulse, jack, alsa, oss diff --git a/akode/PACKAGING b/akode/PACKAGING index da75139..8cbd9f1 100644 --- a/akode/PACKAGING +++ b/akode/PACKAGING @@ -7,9 +7,9 @@ Take especially note of the following: - If you wish to install plugins in a non-standard place, you can change the AKODE_SEARCHDIR definition in lib/pluginhandler.cpp. - You SHOULD not install sinks for backends you don't use. Thus jack_sink - should only be installed when jackd is available, polyp_sink only when - the polypaudio server is used and alsa_sink only when using a Linux kernel + should only be installed when jackd is available, pulse_sink only when + the PulseAudio server is used and alsa_sink only when using a Linux kernel with ALSA drivers. When using direct aKode playback sinks will be autodetected by loading and - probing plugins in this order: polyp, jack, alsa, oss + probing plugins in this order: pulse, jack, alsa, oss diff --git a/akode/configure.in.in b/akode/configure.in.in index 80338d5..80d0114 100644 --- a/akode/configure.in.in +++ b/akode/configure.in.in @@ -270,24 +270,24 @@ AC_SUBST(JACK_LIBADD) AC_SUBST(JACK_LDFLAGS) fi -AC_ARG_WITH(polypaudio,AC_HELP_STRING([--with-polypaudio],[Enable Polypaudio server support @<:@default=check@:>@]),[polypaudio_test="$withval"],[polypaudio_test="yes"]) - -if test "x$polypaudio_test" = "xyes" ; then -AC_MSG_CHECKING(for Polypaudio 0.7 or later) -if $PKG_CONFIG --atleast-version 0.7 polyplib-simple >/dev/null 2>&1 ; then - POLYP_CFLAGS="`$PKG_CONFIG --cflags polyplib-simple`" - POLYP_LIBADD="`$PKG_CONFIG --libs-only-l polyplib-simple`" - POLYP_LDFLAGS="`$PKG_CONFIG --libs-only-L polyplib-simple`" - have_polyp=yes +AC_ARG_WITH(pulseaudio,AC_HELP_STRING([--with-pulseaudio],[Enable PulseAudio server support @<:@default=check@:>@]),[pulseaudio_test="$withval"],[pulseaudio_test="yes"]) + +if test "x$pulseaudio_test" = "xyes" ; then +AC_MSG_CHECKING(for pulseaudio 0.9.2 or later) +if $PKG_CONFIG --atleast-version 0.9.2 libpulse-simple >/dev/null 2>&1 ; then + PULSE_CFLAGS="`$PKG_CONFIG --cflags libpulse-simple`" + PULSE_LIBADD="`$PKG_CONFIG --libs-only-l libpulse-simple`" + PULSE_LDFLAGS="`$PKG_CONFIG --libs-only-L libpulse-simple`" + have_pulse=yes AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LIBPOLYP, 1, - [Define if you have polyplib (required if you want Polypaudio server support)]) + AC_DEFINE(HAVE_LIBPULSE, 1, + [Define if you have libpulse (required if you want PulseAudio server support)]) else AC_MSG_RESULT(not installed) fi -AC_SUBST(POLYP_CFLAGS) -AC_SUBST(POLYP_LIBADD) -AC_SUBST(POLYP_LDFLAGS) +AC_SUBST(PULSE_CFLAGS) +AC_SUBST(PULSE_LIBADD) +AC_SUBST(PULSE_LDFLAGS) fi AC_ARG_WITH(ffmpeg,AC_HELP_STRING([--with-ffmpeg],[Enable experimental FFMPEG decoder support @<:@default=check@:>@]),[ffmpeg_test="$withval"],[ffmpeg_test="yes"]) @@ -482,7 +482,7 @@ AM_CONDITIONAL(include_alsa_sink, test x$have_alsa = xyes) AM_CONDITIONAL(include_oss_sink, test x$have_oss = xyes) AM_CONDITIONAL(include_sun_sink, test x$have_sun = xyes) AM_CONDITIONAL(include_jack_sink, test x$have_jack = xyes) -AM_CONDITIONAL(include_polyp_sink, test x$have_polyp = xyes) +AM_CONDITIONAL(include_pulse_sink, test x$have_pulse = xyes) AM_CONDITIONAL(include_ffmpeg_decoder, test x$have_ffmpeg = xyes) AC_MSG_CHECKING(for compilable aKode) diff --git a/akode/lib/auto_sink.cpp b/akode/lib/auto_sink.cpp index bcc1250..bee17b1 100644 --- a/akode/lib/auto_sink.cpp +++ b/akode/lib/auto_sink.cpp @@ -65,8 +65,8 @@ AutoSink::~AutoSink() bool AutoSink::open() { // Try Polypaudio - if (getenv("POLYP_SERVER")) - if (m_data->tryOpen("polyp")) return true; + if (getenv("PULSE_SERVER")) + if (m_data->tryOpen("pulse")) return true; // Try Jack if (m_data->tryOpen("jack")) return true; // Try ALSA diff --git a/akode/plugins/CMakeLists.txt b/akode/plugins/CMakeLists.txt index 6e11f1a..89bcfd1 100644 --- a/akode/plugins/CMakeLists.txt +++ b/akode/plugins/CMakeLists.txt @@ -15,7 +15,7 @@ tde_conditional_add_subdirectory( WITH_ALSA_SINK alsa_sink ) tde_conditional_add_subdirectory( WITH_JACK_SINK jack_sink ) tde_conditional_add_subdirectory( WITH_OSS_SINK oss_sink ) -tde_conditional_add_subdirectory( WITH_PULSE_SINK polyp_sink ) +tde_conditional_add_subdirectory( WITH_PULSE_SINK pulse_sink ) tde_conditional_add_subdirectory( WITH_SUN_SINK sun_sink ) tde_conditional_add_subdirectory( WITH_FFMPEG_DECODER ffmpeg_decoder ) diff --git a/akode/plugins/Makefile.am b/akode/plugins/Makefile.am index 74f27e5..4a13c85 100644 --- a/akode/plugins/Makefile.am +++ b/akode/plugins/Makefile.am @@ -32,12 +32,12 @@ if include_jack_sink AKODE_JACK_SINK=jack_sink endif -if include_polyp_sink -AKODE_POLYP_SINK=polyp_sink +if include_pulse_sink +AKODE_PULSE_SINK=pulse_sink endif SUBDIRS= $(AKODE_MPC_DECODER) $(AKODE_XIPH_DECODER) \ $(AKODE_MPEG_DECODER) $(AKODE_FFMPEG_DECODER) \ $(AKODE_ALSA_SINK) $(AKODE_OSS_SINK) $(AKODE_SUN_SINK) \ - $(AKODE_JACK_SINK) $(AKODE_POLYP_SINK) \ + $(AKODE_JACK_SINK) $(AKODE_PULSE_SINK) \ $(AKODE_SRC_RESAMPLER) diff --git a/akode/plugins/polyp_sink/Makefile.am b/akode/plugins/polyp_sink/Makefile.am deleted file mode 100644 index a58b04c..0000000 --- a/akode/plugins/polyp_sink/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(PULSE_CFLAGS) $(all_includes) - -lib_LTLIBRARIES = libakode_polyp_sink.la - -libakode_polyp_sink_la_SOURCES = polyp_sink.cpp -libakode_polyp_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(PULSE_LDFLAGS) -libakode_polyp_sink_la_LIBADD = ../../lib/libakode.la $(PULSE_LIBADD) diff --git a/akode/plugins/polyp_sink/CMakeLists.txt b/akode/plugins/pulse_sink/CMakeLists.txt similarity index 91% rename from akode/plugins/polyp_sink/CMakeLists.txt rename to akode/plugins/pulse_sink/CMakeLists.txt index 28a940e..04026d3 100644 --- a/akode/plugins/polyp_sink/CMakeLists.txt +++ b/akode/plugins/pulse_sink/CMakeLists.txt @@ -21,11 +21,11 @@ include_directories( ##### library ################################### -set( target libakode_polyp_sink ) +set( target libakode_pulse_sink ) tde_add_library( ${target} MODULE - SOURCES polyp_sink.cpp + SOURCES pulse_sink.cpp LINK akode-shared ${PULSE_LIBRARIES} DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/akode/plugins/pulse_sink/Makefile.am b/akode/plugins/pulse_sink/Makefile.am new file mode 100644 index 0000000..9f38245 --- /dev/null +++ b/akode/plugins/pulse_sink/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(PULSE_CFLAGS) $(all_includes) + +lib_LTLIBRARIES = libakode_pulse_sink.la + +libakode_pulse_sink_la_SOURCES = pulse_sink.cpp +libakode_pulse_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(PULSE_LDFLAGS) +libakode_pulse_sink_la_LIBADD = ../../lib/libakode.la $(PULSE_LIBADD) diff --git a/akode/plugins/polyp_sink/polyp_sink.cpp b/akode/plugins/pulse_sink/pulse_sink.cpp similarity index 88% rename from akode/plugins/polyp_sink/polyp_sink.cpp rename to akode/plugins/pulse_sink/pulse_sink.cpp index b48b63e..395bfb3 100644 --- a/akode/plugins/polyp_sink/polyp_sink.cpp +++ b/akode/plugins/pulse_sink/pulse_sink.cpp @@ -1,4 +1,4 @@ -/* aKode: Polyp-Sink +/* aKode: Pulse-Sink Copyright (C) 2004 Allan Sandfeld Jensen @@ -29,15 +29,15 @@ #include "audioframe.h" #include "audiobuffer.h" -#include "polyp_sink.h" +#include "pulse_sink.h" #include namespace aKode { -extern "C" { PolypSinkPlugin polyp_sink; }; +extern "C" { PulseSinkPlugin pulse_sink; }; -struct PolypSink::private_data +struct PulseSink::private_data { private_data() : server(0), error(false) {}; @@ -49,7 +49,7 @@ struct PolypSink::private_data AudioConfiguration config; }; -PolypSink::PolypSink() +PulseSink::PulseSink() { m_data = new private_data; m_data->sample_spec.rate = 44100; @@ -57,7 +57,7 @@ PolypSink::PolypSink() m_data->sample_spec.format = PA_SAMPLE_S16NE; } -bool PolypSink::open() { +bool PulseSink::open() { int error = 0; m_data->server = pa_simple_new(0, "akode-client", PA_STREAM_PLAYBACK, 0, "", &m_data->sample_spec, 0, 0, &error ); if (!m_data->server || error != 0) { @@ -71,20 +71,20 @@ bool PolypSink::open() { return true; } -void PolypSink::close() { +void PulseSink::close() { if (m_data->server) { pa_simple_free(m_data->server); m_data->server = 0; } } -PolypSink::~PolypSink() +PulseSink::~PulseSink() { close(); delete m_data; } -int PolypSink::setAudioConfiguration(const AudioConfiguration* config) +int PulseSink::setAudioConfiguration(const AudioConfiguration* config) { if (m_data->error) return -1; @@ -109,12 +109,12 @@ int PolypSink::setAudioConfiguration(const AudioConfiguration* config) return res; } -const AudioConfiguration* PolypSink::audioConfiguration() const +const AudioConfiguration* PulseSink::audioConfiguration() const { return &m_data->config; } -bool PolypSink::writeFrame(AudioFrame* frame) +bool PulseSink::writeFrame(AudioFrame* frame) { if ( m_data->error ) return false; diff --git a/akode/plugins/polyp_sink/polyp_sink.h b/akode/plugins/pulse_sink/pulse_sink.h similarity index 80% rename from akode/plugins/polyp_sink/polyp_sink.h rename to akode/plugins/pulse_sink/pulse_sink.h index e279ff6..e890e4a 100644 --- a/akode/plugins/polyp_sink/polyp_sink.h +++ b/akode/plugins/pulse_sink/pulse_sink.h @@ -1,4 +1,4 @@ -/* aKode: Polyp-Sink +/* aKode: Pulse-Sink Copyright (C) 2004 Allan Sandfeld Jensen @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef _AKODE_POLYP_SINK_H -#define _AKODE_POLYP_SINK_H +#ifndef _AKODE_PULSE_SINK_H +#define _AKODE_PULSE_SINK_H #include "sink.h" @@ -30,10 +30,10 @@ namespace aKode { class AudioConfiguration; class AudioFrame; -class PolypSink : public Sink { +class PulseSink : public Sink { public: - PolypSink(); - ~PolypSink(); + PulseSink(); + ~PulseSink(); bool open(); void close(); int setAudioConfiguration(const AudioConfiguration *config); @@ -46,14 +46,14 @@ private: private_data *m_data; }; -class PolypSinkPlugin : public SinkPlugin { +class PulseSinkPlugin : public SinkPlugin { public: - virtual PolypSink* openSink() { - return new PolypSink(); + virtual PulseSink* openSink() { + return new PulseSink(); } }; -extern "C" AKODE_EXPORT PolypSinkPlugin polyp_sink; +extern "C" AKODE_EXPORT PulseSinkPlugin pulse_sink; } // namespace