Skip to content

Commit

Permalink
first contribs with mpg123 module
Browse files Browse the repository at this point in the history
This contribs is just an example how to create a new output module. It's
not stable.

output_mpg123.c is the real module
sound_alsa and sound_module manages the sound playback with alsa (a
version with tinyalsa may be contributed too in the future)
webclient allows to send GET request to the server and to receive the
audio file data.
  • Loading branch information
mchalain committed Jun 26, 2020
1 parent 5a75db4 commit 9de0a29
Show file tree
Hide file tree
Showing 9 changed files with 886 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SUBDIRS = src data
SUBDIRS = src data contribs

EXTRA_DIST = autogen.sh
22 changes: 22 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,27 @@ if test x$HAVE_LIBUPNP = xyes; then
fi
AC_SUBST(HAVE_LIBUPNP)

PKG_CHECK_MODULES(ALSA, alsa, HAVE_ALSA=yes, HAVE_ALSA=no)
if test x$HAVE_ALSA = xyes; then
AC_DEFINE(HAVE_ALSA, , [Use Alsa])
fi
AC_SUBST(HAVE_ALSA)
AM_CONDITIONAL(HAVE_ALSA, test x$HAVE_ALSA = xyes)

AC_ARG_WITH( mpg123,
AC_HELP_STRING([--without-mpg123],[compile without MPG123 support]),
try_mpg123=$withval, try_mpg123=yes )
HAVE_MPG123=no
if test x$try_gstreamer = xyes; then
dnl check for GStreamer
PKG_CHECK_MODULES(MPG123, libmpg123, HAVE_MPG123=yes, HAVE_MPG123=no)
fi
if test x$HAVE_MPG123 = xyes; then
AC_DEFINE(HAVE_MPG123, , [Use mpg123])
fi
AC_SUBST(HAVE_MPG123)
AM_CONDITIONAL(HAVE_MPG123, test x$HAVE_MPG123 = xyes)

# Checks for header files.
AC_HEADER_STDC

Expand All @@ -123,6 +144,7 @@ fi

AC_CONFIG_FILES([Makefile
src/Makefile
contribs/Makefile
data/Makefile])
AC_OUTPUT

22 changes: 22 additions & 0 deletions contribs/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if HAVE_MPG123
pkglib_LTLIBRARIES = gmrender_mpg123.la
endif

gmrender_mpg123_la_SOURCES = \
sound_module.c sound_module.h \
sound_alsa.c \
webclient.c \
output_mpg123.c

GMRENDER_MPG123_VERSION=0.0.1

MOD_MAJOR_VERSION=$(word 1,$(subst ., ,$(GMRENDER_MPG123_VERSION)))
MOD_MINOR_VERSION=$(word 2,$(subst ., ,$(GMRENDER_MPG123_VERSION)))
MOD_MICRO_VERSION=$(word 3,$(subst ., ,$(GMRENDER_MPG123_VERSION)))

gmrender_mpg123_la_CFLAGS = $(GLIB_CFLAGS) $(ALSA_CFLAGS) -I ../src
gmrender_mpg123_la_CFLAGS += -DMOD_MAJOR_VERSION=$(MOD_MAJOR_VERSION)
gmrender_mpg123_la_CFLAGS += -DMOD_MINOR_VERSION=$(MOD_MINOR_VERSION)
gmrender_mpg123_la_CFLAGS += -DMOD_MICRO_VERSION=$(MOD_MICRO_VERSION)
gmrender_mpg123_la_LIBADD = $(GLIB_LIBS) $(ALSA_LIBS) -lmpg123
gmrender_mpg123_la_LDFLAGS = -module -release $(GMRENDER_MPG123_VERSION)
Loading

0 comments on commit 9de0a29

Please sign in to comment.