Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4809)
+++ ChangeLog	(revision 4811)
@@ -5,4 +5,5 @@
 	  so codecs do not drop to (near) zero bitrate.
 	* Added aRts (artsc) driver to roard.
+	* Removed old -d and friends from roard (Closes: #122)
 
 v. 0.4beta4 - Sun Mar 20 2011 12:15 CET
Index: roard/driver.c
===================================================================
--- roard/driver.c	(revision 4809)
+++ roard/driver.c	(revision 4811)
@@ -145,5 +145,8 @@
 }
 
-int driver_open (DRIVER_USERDATA_T * inst, int * driver_id, char * driver, char * device, struct roar_audio_info * info) {
+int driver_openvio(struct roar_vio_calls * calls,
+                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
+                 char * device, struct roar_audio_info * info, int fh,
+                 struct roar_stream_server * sstream) {
  int i;
 
@@ -156,54 +159,9 @@
 #endif
 
+ ROAR_DBG("driver_openvio(*): searching for driver '%s'...", driver);
+
  for (i = 0; g_driver[i].name != NULL; i++) {
   if ( strcmp(g_driver[i].name, driver) == 0 ) {
-   ROAR_DBG("driver_open(*): found driver: id = %i", i);
-
-   *driver_id = i;
-
-   if ( g_driver[i].vio_init != NULL ) {
-    if ( (*inst = malloc(sizeof(struct roar_vio_calls))) == NULL )
-     return -1;
-
-    memset(*inst, 0, sizeof(struct roar_vio_calls));
-
-    if ( (i = g_driver[i].vio_init(*inst, device, info, -1, NULL)) == -1 ) {
-     free(*inst);
-     return -1;
-    }
-    return i;
-   }
-
-   if ( g_driver[i].open ) {
-    ROAR_WARN("driver_open(*): driver(%s) uses old non-vio interface!", driver);
-    return g_driver[i].open(inst, device, info);
-   }
-
-   return 0;
-  }
- }
-
- return -1;
-}
-
-int driver_openvio(struct roar_vio_calls * calls,
-                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
-                 char * device, struct roar_audio_info * info, int fh,
-                 struct roar_stream_server * sstream) {
- int i;
-
-#ifdef ROAR_DRIVER_DEFAULT
- if ( driver == NULL )
-  driver = ROAR_DRIVER_DEFAULT;
-#else
- if ( driver == NULL )
-  return -1;
-#endif
-
- ROAR_DBG("driver_openvio(*): searching for driver '%s'...", driver);
-
- for (i = 0; g_driver[i].name != NULL; i++) {
-  if ( strcmp(g_driver[i].name, driver) == 0 ) {
-   ROAR_DBG("driver_open(*): found driver: id = %i", i);
+   ROAR_DBG("driver_openvio(*): found driver: id = %i", i);
 
    *driver_id = i;
@@ -219,5 +177,5 @@
     }
 
-    ROAR_WARN("driver_open(*): driver(%s) uses old non-vio interface!", driver);
+    ROAR_WARN("driver_openvio(*): driver(%s) uses old non-vio interface!", driver);
     ROAR_ERR("driver_openvio(calls=%p, driver_id={%i}, driver='%s', device='%s', info=%p, fh=%i): not a VIO driver!",
         calls, i, driver, device, info, fh);
@@ -232,20 +190,4 @@
 }
 
-int driver_close(DRIVER_USERDATA_T   inst, int driver) {
- int ret = 0;
- ROAR_DBG("driver_close(inst=%p, driver=%i) = ?", inst, driver);
-
- if ( driver == -1 )
-  return -1;
-
- if ( g_driver[driver].close )
-  ret = g_driver[driver].close(inst);
-
- if ( g_driver[driver].vio_init != NULL )
-  free(inst);
-
- return ret;
-}
-
 int driver_closevio(struct roar_vio_calls * calls, int driver) {
  ROAR_DBG("driver_closevio(calls=%p, driver=%i) = ?", calls, driver);
@@ -259,24 +201,4 @@
  if ( calls->close != NULL )
   roar_vio_close(calls);
-
- return 0;
-}
-
-int driver_write(DRIVER_USERDATA_T   inst, int driver, char * buf, int len) {
- if ( driver == -1 )
-  return -1;
-
- if ( g_driver[driver].vio_init != NULL )
-  return roar_vio_write((struct roar_vio_calls *) inst, buf, len);
-
- return 0;
-}
-
-int driver_read (DRIVER_USERDATA_T   inst, int driver, char * buf, int len) {
- if ( driver == -1 )
-  return -1;
-
- if ( g_driver[driver].vio_init != NULL )
-  return roar_vio_read((struct roar_vio_calls *) inst, buf, len);
 
  return 0;
Index: roard/include/driver.h
===================================================================
--- roard/include/driver.h	(revision 4809)
+++ roard/include/driver.h	(revision 4811)
@@ -160,7 +160,4 @@
 void print_driverlist (void);
 
-int driver_open (DRIVER_USERDATA_T * inst,
-                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
-                 char * device, struct roar_audio_info * info);
 int driver_openvio(struct roar_vio_calls * calls,
                  int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
@@ -168,10 +165,5 @@
                  struct roar_stream_server * sstream);
 
-int driver_close(DRIVER_USERDATA_T   inst, int driver);
 int driver_closevio(struct roar_vio_calls * calls, int driver);
-int driver_pause(DRIVER_USERDATA_T   inst, int driver, int newstate);
-int driver_write(DRIVER_USERDATA_T   inst, int driver, char * buf, int len);
-int driver_read (DRIVER_USERDATA_T   inst, int driver, char * buf, int len);
-int driver_flush(DRIVER_USERDATA_T   inst, int driver);
 int driver_set_volume(int stream, struct roar_mixer_settings * mixer);
 
Index: roard/include/roard.h
===================================================================
--- roard/include/roard.h	(revision 4766)
+++ roard/include/roard.h	(revision 4811)
@@ -144,5 +144,5 @@
 #endif
 
-int main_loop (int driver, DRIVER_USERDATA_T driver_inst, struct roar_audio_info * sa, int sysclocksync);
+int main_loop (struct roar_audio_info * sa, int sysclocksync);
 void cleanup_listen_socket (int terminate);
 void clean_quit (void);
Index: roard/loop.c
===================================================================
--- roard/loop.c	(revision 4708)
+++ roard/loop.c	(revision 4811)
@@ -26,5 +26,5 @@
 #include "roard.h"
 
-int main_loop (int driver, DRIVER_USERDATA_T driver_inst, struct roar_audio_info * sa, int sysclocksync) {
+int main_loop (struct roar_audio_info * sa, int sysclocksync) {
  void ** streams_input = NULL;
  int     term = 0;
@@ -125,5 +125,4 @@
 #endif
    clients_send_filter(sa, g_pos);
-   output_buffer_flush(driver_inst, driver);
    clients_send_mon(sa, g_pos);
 #ifdef ROAR_HAVE_USLEEP
Index: roard/output.c
===================================================================
--- roard/output.c	(revision 4708)
+++ roard/output.c	(revision 4811)
@@ -79,9 +79,3 @@
 }
 
-int output_buffer_flush  (DRIVER_USERDATA_T inst, int driver) {
- ROAR_DBG("output_buffer_init(*): flushing output buffer");
-
- return driver_write(inst, driver, g_output_buffer, g_output_buffer_len);
-}
-
 //ll
Index: roard/roard.c
===================================================================
--- roard/roard.c	(revision 4810)
+++ roard/roard.c	(revision 4811)
@@ -1693,9 +1693,4 @@
  int    realtime     = 0;
  int    sysclocksync = 0;
- char * driver    = NULL;
- char * device    = NULL;
-#ifdef ROAR_HAVE_MAIN_ARGS
- char * opts      = NULL;
-#endif
 // char * server = ROAR_DEFAULT_SOCK_GLOBAL;
 #ifdef ROAR_SUPPORT_LISTEN
@@ -1706,5 +1701,4 @@
  struct roar_audio_info sock_info = {0, 0, 0, 0};
 #endif
- int               drvid;
 #ifndef ROAR_WITHOUT_DCOMP_SOURCES
  char * s_drv     = "cf";
@@ -1763,5 +1757,4 @@
  struct servent * serv = NULL;
 #endif
- DRIVER_USERDATA_T drvinst;
  struct roar_client * self = NULL;
 #ifdef ROAR_HAVE_LIBDNET
@@ -2068,18 +2061,4 @@
    }
 
-  } else if ( strcmp(k, "-d") == 0 || strcmp(k, "--driver") == 0 ) {
-   _CKHAVEARGS(1);
-   driver = argv[++i];
-   if ( strcmp(driver, "list") == 0 ) {
-    ROAR_WARN("The option is obsolete, use --list-driver!");
-    print_driverlist();
-    return 0;
-   }
-  } else if ( strcmp(k, "-D") == 0 || strcmp(k, "--device") == 0 ) {
-   _CKHAVEARGS(1);
-   device = argv[++i];
-  } else if ( strcmp(k, "-dO") == 0 ) {
-   _CKHAVEARGS(1);
-   opts = argv[++i];
   } else if ( strcmp(k, "--list-driver") == 0 ) {
    print_driverlist();
@@ -2669,16 +2648,4 @@
  }
 
- if ( driver == NULL ) {
-  driver = "null";
- } else {
-  ROAR_ERR("Usage of old driver interface. use -o not -d!");
-  ROAR_WARN("-d will be removed within the next releases");
- }
-
- if ( driver_open(&drvinst, &drvid, driver, device, &sa) == -1 ) {
-  ROAR_ERR("Can not open output driver!");
-  return 1;
- }
-
  if ( samples_init() == -1 ) {
   ROAR_ERR("Can not init samples!");
@@ -2885,10 +2852,9 @@
  // start main loop...
  ROAR_INFO("Entering main loop", ROAR_DBG_INFO_INFO);
- main_loop(drvid, drvinst, &sa, sysclocksync);
+ main_loop(&sa, sysclocksync);
  ROAR_INFO("Left main loop", ROAR_DBG_INFO_INFO);
 
  // clean up.
  clean_quit_prep();
- driver_close(drvinst, drvid);
  output_buffer_free();
 
@@ -2978,5 +2944,4 @@
 
  clean_quit_prep();
-// driver_close(drvinst, drvid);
 // output_buffer_free();
 
