[xiph-cvs] cvs commit: ao/src/plugins/arts Makefile.am ao_arts.c
Michael Smith
msmith at xiph.org
Fri Dec 29 21:03:26 PST 2000
msmith 00/12/29 21:03:25
Modified: . configure.in
include/ao ao.h
src/plugins Makefile.am
Added: src/plugins/arts Makefile.am ao_arts.c
Log:
Add arts (KDE) plugin. C++ include fix for ao.h
Revision Changes Path
1.13 +15 -1 ao/configure.in
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/ao/configure.in,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- configure.in 2000/12/17 20:28:33 1.12
+++ configure.in 2000/12/30 05:03:24 1.13
@@ -133,6 +133,20 @@
fi
AC_SUBST(ALSA_LIBS)
+dnl Check for aRts
+
+AC_PATH_PROG(ARTSC_CONFIG, artsc-config)
+AM_CONDITIONAL(HAVE_ARTS,test "x$ac_cv_path_ARTSC_CONFIG" != x)
+
+if test "x$ac_cv_path_ARTSC_CONFIG" != x
+then
+ ARTS_CFLAGS=`$ac_cv_path_ARTSC_CONFIG --cflags`
+ ARTS_LIBS=`$ac_cv_path_ARTSC_CONFIG --libs`
+fi
+
+AC_SUBST(ARTS_CFLAGS)
+AC_SUBST(ARTS_LIBS)
+
dnl Check for IRIX
case $host in
@@ -146,4 +160,4 @@
CFLAGS="$CFLAGS -DAO_PLUGIN_PATH=\\\"$plugindir\\\""
-AC_OUTPUT(Makefile src/Makefile doc/Makefile include/Makefile include/ao/Makefile include/ao/os_types.h src/plugins/Makefile src/plugins/esd/Makefile src/plugins/oss/Makefile src/plugins/alsa/Makefile debian/Makefile)
+AC_OUTPUT(Makefile src/Makefile doc/Makefile include/Makefile include/ao/Makefile include/ao/os_types.h src/plugins/Makefile src/plugins/esd/Makefile src/plugins/oss/Makefile src/plugins/alsa/Makefile src/plugins/arts/Makefile debian/Makefile)
1.8 +9 -0 ao/include/ao/ao.h
Index: ao.h
===================================================================
RCS file: /usr/local/cvsroot/ao/include/ao/ao.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ao.h 2000/12/17 20:28:34 1.7
+++ ao.h 2000/12/30 05:03:24 1.8
@@ -27,6 +27,11 @@
#ifndef __AO_H__
#define __AO_H__
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
#include <stdlib.h>
#include "os_types.h"
@@ -91,5 +96,9 @@
/* misc functions */
int ao_is_big_endian(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
#endif /* __AO_H__ */
1.2 +1 -1 ao/src/plugins/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ao/src/plugins/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.am 2000/10/30 00:46:41 1.1
+++ Makefile.am 2000/12/30 05:03:25 1.2
@@ -1,4 +1,4 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = oss esd alsa # solaris irix
+SUBDIRS = oss esd alsa arts # solaris irix
1.1 ao/src/plugins/arts/Makefile.am
Index: Makefile.am
===================================================================
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
if HAVE_ARTS
artsltlibs = libarts.la
artsldflags = -export-dynamic -avoid-version
artssources = ao_arts.c
else
artsltlibs =
artsldflags =
artssources =
endif
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/include
libdir = $(plugindir)
lib_LTLIBRARIES = $(artsltlibs)
libarts_la_LDFLAGS = $(artsldflags)
CFLAGS = @ARTS_CFLAGS@
libarts_la_LIBADD = @ARTS_LIBS@
libarts_la_SOURCES = $(artssources)
EXTRA_DIST = ao_arts.c
1.1 ao/src/plugins/arts/ao_arts.c
Index: ao_arts.c
===================================================================
/*
*
* ao_arts.c
*
* Copyright (C) Rik Hemsley (rikkus) <rik at kde.org 2000
*
* This file is part of libao, a cross-platform library. See
* README for a history of this source code.
*
* libao 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, or (at your option)
* any later version.
*
* libao 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 GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <stdio.h>
#include <errno.h>
#include <artsc.h>
#include <ao/ao.h>
typedef struct ao_arts_internal_s
{
arts_stream_t stream;
} ao_arts_internal_t;
ao_info_t ao_arts_info =
{
"aRts output",
"arts",
"Rik Hemsley (rikkus) <rik at kde.org>",
"Outputs to the aRts soundserver."
};
ao_internal_t *
plugin_open
(
uint_32 bits,
uint_32 rate,
uint_32 channels,
ao_option_t * options
)
{
ao_arts_internal_t * state;
int errorcode;
state = malloc(sizeof(ao_arts_internal_t));
if (NULL == state)
{
fprintf(stderr, "libao: Can't initialise aRts driver. Out of memory.\n");
return NULL;
}
errorcode = arts_init();
if (0 != errorcode)
{
fprintf(stderr, "libao: Can't initialise aRts driver.\n");
fprintf(stderr, "libao: Error: %s\n", arts_error_text(errorcode));
free(state);
return NULL;
}
state->stream = arts_play_stream(rate, bits, channels, "ao stream");
return state;
}
void
plugin_close(ao_internal_t * state)
{
arts_close_stream(((ao_arts_internal_t *)state)->stream);
arts_free();
}
void
plugin_play
(
ao_internal_t * state,
void * buf,
uint_32 count
)
{
int bytes_written;
bytes_written = arts_write(((ao_arts_internal_t *)state)->stream, buf, count);
if (bytes_written != count)
{
fprintf(stderr, "libao: aRts driver would not write all data !\n");
}
}
ao_info_t *
plugin_get_driver_info(void)
{
return &ao_arts_info;
}
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list