Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3712)
+++ ChangeLog	(revision 3725)
@@ -21,4 +21,5 @@
 	* Added libroarrsound, client side RSound Emulation
 	* Added ALSA driver
+	* Added RSound driver
 
 v. 0.3beta4 - Sat Feb 06 2010 26:02 CET
Index: roard/Makefile
===================================================================
--- roard/Makefile	(revision 3693)
+++ roard/Makefile	(revision 3725)
@@ -3,5 +3,5 @@
 OBJ=roard.o driver.o mixer.o output.o signals.o loop.o clients.o streams.o network.o commands.o req.o sources.o sample.o meta.o codecfilter.o lib.o ssynth.o container_framework.o plugins.o
 SUBSYS=midi.o light.o raw.o rdtcs.o waveform.o beep.o
-DRV=driver_esd.o driver_ao.o driver_roar.o driver_raw.o driver_oss.o driver_shout.o driver_sndio.o driver_dmx.o driver_pwmled.o driver_sysclock.o driver_wmm.o driver_dstr.o driver_alsa.o
+DRV=driver_esd.o driver_ao.o driver_roar.o driver_raw.o driver_oss.o driver_shout.o driver_sndio.o driver_dmx.o driver_pwmled.o driver_sysclock.o driver_wmm.o driver_dstr.o driver_alsa.o driver_rsound.o
 CF_CODEC=codecfilter_cmd.o codecfilter_vorbis.o codecfilter_celt.o codecfilter_speex.o codecfilter_alaw.o codecfilter_mulaw.o codecfilter_sndfile.o codecfilter_fishsound.o
 CF_CONTAINER=codecfilter_wave.o codecfilter_raum.o
@@ -18,5 +18,5 @@
 CFLAGS   += -g -Wall -O2 $(DEFINES) $(INCLUDE) $(INCPATH)
 LDFLAGS   = -g -rdynamic -L../lib/ $(LDPATH)
-DRVLIBS   = $(lib_esd) $(lib_ossaudio) $(lib_ao) $(lib_shout) $(lib_sndio) $(lib_asound) $(lib_winmm)
+DRVLIBS   = $(lib_esd) $(lib_ossaudio) $(lib_ao) $(lib_shout) $(lib_sndio) $(lib_rsound) $(lib_asound) $(lib_winmm)
 CODECLIBS = $(lib_vorbisfile) $(lib_vorbisenc) $(lib_vorbis) $(lib_celt) $(lib_fishsound) $(lib_speex) $(lib_speexdsp)
 CONTLIBS  = $(lib_oggz) $(lib_sndfile) $(lib_ogg) $(lib_raum)
Index: roard/driver.c
===================================================================
--- roard/driver.c	(revision 3693)
+++ roard/driver.c	(revision 3725)
@@ -64,4 +64,8 @@
  {"sndio", "OpenBSD sndio", "/dev/audio, /tmp/aucat-<uid>/default", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM|ROAR_SUBSYS_MIDI,
   NULL, NULL, driver_sndio_open},
+#endif
+#ifdef ROAR_HAVE_LIBRSOUND
+ {"rsound", "RSound", "servername", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+  NULL, NULL, driver_rsound_open},
 #endif
 #ifdef ROAR_HAVE_LIBASOUND
Index: roard/driver_rsound.c
===================================================================
--- roard/driver_rsound.c	(revision 3725)
+++ roard/driver_rsound.c	(revision 3725)
@@ -0,0 +1,151 @@
+//driver_rsound.c:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010
+ *
+ *  This file is part of roard a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  RoarAudio 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 this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ */
+
+#define _DRV_NEED_RSOUND_H
+#include "roard.h"
+
+int     driver_rsound_open         (struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream) {
+ rsound_t * self;
+ int tmp, tmp2;
+
+ if ( fh != -1 )
+  return -1;
+
+ if ( rsd_init(&self) == -1 )
+  return -1;
+
+ if ( device != NULL ) {
+  if ( rsd_set_param(self, RSD_HOST, device) == -1 ) {
+   rsd_free(self);
+   return -1;
+  }
+ }
+
+ tmp = info->channels;
+ if ( rsd_set_param(self, RSD_CHANNELS, &tmp) == -1 ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ if ( tmp != info->channels ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ tmp = info->rate;
+ if ( rsd_set_param(self, RSD_SAMPLERATE, &tmp) == -1 ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ if ( tmp != info->rate ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ tmp = -1; // unknown by RSound
+
+ switch (info->codec) {
+  case ROAR_CODEC_PCM_S_LE:
+    switch (info->bits) {
+     case  8: tmp = RSD_S8;     break;
+     case 16: tmp = RSD_S16_LE; break;
+    }
+   break;
+  case ROAR_CODEC_PCM_S_BE:
+    switch (info->bits) {
+     case  8: tmp = RSD_S8;     break;
+     case 16: tmp = RSD_S16_BE; break;
+    }
+   break;
+  case ROAR_CODEC_PCM_U_LE:
+    switch (info->bits) {
+     case  8: tmp = RSD_S8;     break;
+     case 16: tmp = RSD_U16_LE; break;
+    }
+   break;
+  case ROAR_CODEC_PCM_U_BE:
+    switch (info->bits) {
+     case  8: tmp = RSD_S8;     break;
+     case 16: tmp = RSD_U16_BE; break;
+    }
+   break;
+ }
+
+ if ( tmp == -1 ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ tmp2 = tmp;
+
+ if ( rsd_set_param(self, RSD_FORMAT, &tmp) == -1 ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ if ( tmp != tmp2 ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ if ( rsd_start(self) == -1 ) {
+  rsd_free(self);
+  return -1;
+ }
+
+ memset(inst, 0, sizeof(struct roar_vio_calls));
+
+ inst->inst  = self;
+ inst->close = driver_rsound_close;
+ inst->write = driver_rsound_write;
+
+ return 0;
+}
+
+int     driver_rsound_close        (struct roar_vio_calls * vio) {
+ int r = 0;
+
+ if ( rsd_stop(vio->inst) == -1 )
+  r = -1;
+
+ if ( rsd_free(vio->inst) == -1 )
+  r = -1;
+
+ return r;
+}
+
+ssize_t driver_rsound_write        (struct roar_vio_calls * vio, void *buf, size_t count) {
+ size_t ret;
+
+ ret = rsd_write(vio->inst, buf, count);
+
+ if ( ret == 0 )
+  return -1;
+
+ return ret;
+}
+
+//ll
Index: roard/include/driver.h
===================================================================
--- roard/include/driver.h	(revision 3692)
+++ roard/include/driver.h	(revision 3725)
@@ -99,4 +99,11 @@
 #endif
 
+#ifdef ROAR_HAVE_LIBRSOUND
+#ifdef _DRV_NEED_RSOUND_H
+#include <rsound.h>
+#endif
+#include "driver_rsound.h"
+#endif
+
 #ifdef ROAR_HAVE_LIBASOUND
 #include <alsa/asoundlib.h>
Index: roard/include/driver_rsound.h
===================================================================
--- roard/include/driver_rsound.h	(revision 3725)
+++ roard/include/driver_rsound.h	(revision 3725)
@@ -0,0 +1,36 @@
+//driver_rsound.h:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2009-2010
+ *
+ *  This file is part of roard a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  RoarAudio 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 this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef _DRIVER_RSOUND_H_
+#define _DRIVER_RSOUND_H_
+
+int     driver_rsound_open         (struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
+int     driver_rsound_close        (struct roar_vio_calls * vio);
+ssize_t driver_rsound_write        (struct roar_vio_calls * vio, void *buf, size_t count);
+
+
+#endif
+
+//ll
