According to rik@kde.org (sometime around Wed, Dec 27, 2000 at 08:58:47PM
+0000):> Hi,
>
> I've written an ao plugin for aRts, the soundserver that comes with
KDE.
>
> Any chance of including this in the ao distribution ? Pretty please ? :)
>
> Sources and patches attached. This is a very simple plugin because it
> uses the easy-to-use 'artsc' C wrapper that aRts installs.
>
> configure.in.diff is for ao/configure.in
> Makefile.am.diff is for ao/src/plugins/Makefile.am
> Makefile.am and ao_arts.c go in src/plugins/arts/
>
> Also attached is a patch (ao.h.diff) to allow C++ programs to include
> ao.h without doing the extern "C" wrapping themselves.
>
> Cheers,
> Rik
Thank you very much. I'm in the middle of partitioning a big new drive
(fun in a geeky sort of way), but I guess I can commit those. I've
only looked over it briefly but it looks ok, especially the ao.h.diff
which should have been there in the beginning.
> +SUBDIRS = oss esd alsa arts # solaris irix
To everybody else also:
I DON'T LIKE THAT. Evil. SUBDIRS should be only what you can build on
your system, as autodetected (I think we've been through this
before). For example, I cannot build the ao_alsa plugin on my system
correctly because I have the CVS alsa driver which has a new API. When
alsa 0.6 is released I'm sure this will be resolved, but until then I
must manually modify the subdirs line NOT to include alsa. I also
refuse to download the esd headers for whatever stupid reason, so I
commented that out too. In my midnight apt-get's I've probably
installed them anyway, but I don't want an esd plugin so that doesn't
matter. Jack?
> +#ifdef __cplusplus
> +extern "C"
> +{
> +#endif /* __cplusplus */
:)
> /*
> *
> * ao_arts.c
[...]
> if (NULL == state)
You have weird coding conventions. On the other hand, I know why you
do this. gcc gives a warning in either case.
> {
> fprintf(stderr, "libao: Can't initialise aRts driver. Out of
memory.\n");
> return NULL;
> }
>
> errorcode = arts_init();
>
> if (0 != errorcode)
ditto. My personal preference is to put that all on one line, e.g.
if (0 != (errorcode = arts_init()))
> {
> 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");
So aRts has a stream name capability? Perhaps libao could use a stream
name parameter; could be useful.
> 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;
> }
>
> --- ao/configure.in Sun Dec 17 20:28:33 2000
> +++ ao_patched/configure.in Wed Dec 27 20:17:11 2000
> @@ -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
There is where I'd add the subdirs definition.
> +
> +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)
--
Kenneth Arnold <ken@arnoldnet.net> / kcarnold / Linux user #180115
http://arnoldnet.net/~kcarnold/
<HR NOSHADE>
<UL>
<LI>application/pgp-signature attachment: stored
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/octet-stream
Size: 233 bytes
Desc: not available
Url :
http://lists.xiph.org/pipermail/vorbis/attachments/20001227/511286ce/part-0001.obj