Index: roard/driver.c
===================================================================
--- roard/driver.c	(revision 4811)
+++ roard/driver.c	(revision 4812)
@@ -27,20 +27,20 @@
 
 struct roar_driver g_driver[] = {
- { "null", "null audio driver", "/dev/null", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ { "null", "null audio driver", NULL, STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
    NULL, NULL, NULL},
 #ifdef ROAR_HAVE_ESD
- { "esd", "EsounD audio driver", "localhost, remote.host.dom", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ { "esd", "EsounD audio driver", "localhost, remote.host.dom", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
    NULL, NULL, driver_esd_open_vio},
 #endif
- { "roar", "RoarAudio driver", "localhost, remote.host.dom", DRV_FLAG_NONE,
+ { "roar", "RoarAudio driver", "localhost, remote.host.dom", STREAM_DIR_OUT, DRV_FLAG_NONE,
    ROAR_SUBSYS_WAVEFORM|ROAR_SUBSYS_MIDI|ROAR_SUBSYS_LIGHT|ROAR_SUBSYS_COMPLEX,
    NULL, NULL, driver_roar_open_vio},
 #ifdef ROAR_HAVE_IO_POSIX
- { "raw",  "RAW driver", "/some/file", DRV_FLAG_FHSEC,
+ { "raw",  "RAW driver", "/some/file", STREAM_DIR_OUT, DRV_FLAG_FHSEC,
    ROAR_SUBSYS_WAVEFORM|ROAR_SUBSYS_MIDI|ROAR_SUBSYS_LIGHT|ROAR_SUBSYS_RAW|ROAR_SUBSYS_COMPLEX,
    NULL, NULL, driver_raw_open_vio},
 #endif
 #ifndef ROAR_WITHOUT_VIO_DSTR
- { "dstr", "VIO DSTR driver", "/some/file", DRV_FLAG_FHSEC,
+ { "dstr", "VIO DSTR driver", "/some/file", STREAM_DIR_OUT, DRV_FLAG_FHSEC,
    ROAR_SUBSYS_WAVEFORM|ROAR_SUBSYS_MIDI|ROAR_SUBSYS_LIGHT|ROAR_SUBSYS_RAW|ROAR_SUBSYS_COMPLEX,
    NULL, NULL, driver_dstr_open_vio},
@@ -50,51 +50,51 @@
 #define ROAR_DEFAULT_OSS_DEV "no default device"
 #endif
- { "oss", "Open Sound System", ROAR_DEFAULT_OSS_DEV, DRV_FLAG_FHSEC, ROAR_SUBSYS_WAVEFORM,
+ { "oss", "Open Sound System", ROAR_DEFAULT_OSS_DEV, STREAM_DIR_OUT, DRV_FLAG_FHSEC, ROAR_SUBSYS_WAVEFORM,
    NULL, NULL, driver_oss_open},
 #endif
 #ifdef ROAR_HAVE_LIBAO
- { "ao", "libao audio driver", "DRIVER", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ { "ao", "libao audio driver", "DRIVER", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
    NULL, NULL, driver_ao_open_vio},
 #endif
 #ifdef ROAR_HAVE_LIBSHOUT
- {"shout", "libshout streaming", "http://user:pw@host:port/mount.ogg", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"shout", "libshout streaming", "http://user:pw@host:port/mount.ogg", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_shout_open_vio},
 #endif
 #ifdef ROAR_HAVE_LIBSNDIO
- {"sndio", "OpenBSD sndio", "/dev/audio, /tmp/aucat-<uid>/default", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM|ROAR_SUBSYS_MIDI,
+ {"sndio", "OpenBSD sndio", "/dev/audio, /tmp/aucat-<uid>/default", STREAM_DIR_OUT, 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,
+ {"rsound", "RSound", "servername", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_rsound_open},
 #endif
 #ifdef _DRIVER_PORTAUDIO_CAN_OPERATE
- {"portaudio", "PortAudio", "(none)", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"portaudio", "PortAudio", NULL, STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_portaudio_open},
 #endif
 #ifdef ROAR_HAVE_LIBASOUND
- {"alsa", "ALSA", "???", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM, NULL, NULL, driver_alsa_open_vio},
+ {"alsa", "ALSA", "???", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM, NULL, NULL, driver_alsa_open_vio},
 #endif
 #ifdef ROAR_HAVE_LIBWINMM
- {"wmm", "Win32 MM", "???", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM, NULL, NULL, driver_wmm_open_vio},
+ {"wmm", "Win32 MM", "???", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM, NULL, NULL, driver_wmm_open_vio},
 #endif
 #ifndef ROAR_WITHOUT_DCOMP_DMX
- {"dmx", "DMX512 driver", "/dev/dmx", DRV_FLAG_FHSEC, ROAR_SUBSYS_LIGHT,
+ {"dmx", "DMX512 driver", "/dev/dmx", STREAM_DIR_OUT, DRV_FLAG_FHSEC, ROAR_SUBSYS_LIGHT,
   NULL, NULL, driver_dmx_open_vio},
 #endif
 #if !defined(ROAR_WITHOUT_DCOMP_PWMLED) && !defined(ROAR_WITHOUT_VIO_DSTR)
- {"pwmled", "PWM LED driver", "/dev/ttyS0", DRV_FLAG_FHSEC, ROAR_SUBSYS_LIGHT,
+ {"pwmled", "PWM LED driver", "/dev/ttyS0", STREAM_DIR_OUT, DRV_FLAG_FHSEC, ROAR_SUBSYS_LIGHT,
   NULL, NULL, driver_pwmled_open_vio},
 #endif
 #ifdef ROAR_HAVE_DRIVER_SYSCLOCK
- {"sysclock", "System Clock Clock Source", "(none)", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"sysclock", "System Clock Clock Source", NULL, STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_sysclock_open_vio},
 #endif
 #ifndef ROAR_WITHOUT_DCOMP_CDRIVER
- {"cdriver", "RoarAudio Client driver", "driver#device", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"cdriver", "RoarAudio Client driver", "driver#device", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_cdriver_open},
 #endif
 #ifdef ROAR_HAVE_LIBPULSE
- {"pulsesimple", "PulseAudio Simple", "server", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"pulsesimple", "PulseAudio Simple", "server", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_pulsesimple_open},
 #endif
@@ -102,13 +102,13 @@
 #if 0
  // this is currently just a driver stub.
- {"jack", "JACK", "???", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"jack", "JACK", "???", STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_jack_open_vio},
 #endif
 #endif
 #ifdef ROAR_HAVE_LIBARTSC
- {"artsc", "aRts plain C API", "(none)", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
+ {"artsc", "aRts plain C API", NULL, STREAM_DIR_OUT, DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM,
   NULL, NULL, driver_artsc_open_vio},
 #endif
- {NULL, NULL, NULL, DRV_FLAG_NONE, 0, NULL, NULL, NULL} // end of list
+ {NULL, NULL, NULL, STREAM_DIR_NONE, DRV_FLAG_NONE, 0, NULL, NULL, NULL} // end of list
                                 };
 
@@ -116,10 +116,17 @@
  int i;
  char subsys[7] = "      ";
-
- printf("  Driver      Flag Subsys - Description (devices)\n");
- printf("---------------------------------------------------------\n");
+ char mode[5]   = "    ";
+
+ printf("  Driver       Mode Flag Subsys - Description (devices)\n");
+ printf("---------------------------------------------------------------\n");
 
  for (i = 0; g_driver[i].name != NULL; i++) {
   strncpy(subsys, "      ", 6);
+  strncpy(mode,   "    ",   4);
+
+  if ( g_driver[i].mode & STREAM_DIR_IN )
+   mode[0] = 'r';
+  if ( g_driver[i].mode & STREAM_DIR_OUT )
+   mode[1] = 'w';
 
   if ( g_driver[i].subsystems & ROAR_SUBSYS_WAVEFORM )
@@ -136,10 +143,23 @@
    subsys[5] = 'X';
 
-  printf("  %-12s %c%c%c %6s - %s (devices: %s)\n", g_driver[i].name,
-                g_driver[i].flags & DRV_FLAG_FHSEC                                                         ? 's' : ' ',
-                g_driver[i].open     != NULL || (g_driver[i].open == NULL && g_driver[i].vio_init == NULL) ? 'S' : ' ',
-                g_driver[i].vio_init != NULL || (g_driver[i].open == NULL && g_driver[i].vio_init == NULL) ? 'V' : ' ',
-                subsys,
-                g_driver[i].desc, g_driver[i].devices);
+  if ( g_driver[i].devices != NULL ) {
+   printf("  %-12s %4s %c%c%c%c %6s - %s (devices: %s)\n", g_driver[i].name,
+                 mode,
+                 ' ', /* unused Flag */
+                 g_driver[i].flags & DRV_FLAG_FHSEC                                                         ? 's' : ' ',
+                 g_driver[i].open     != NULL || (g_driver[i].open == NULL && g_driver[i].vio_init == NULL) ? 'S' : ' ',
+                 g_driver[i].vio_init != NULL || (g_driver[i].open == NULL && g_driver[i].vio_init == NULL) ? 'V' : ' ',
+                 subsys,
+                 g_driver[i].desc, g_driver[i].devices);
+  } else {
+   printf("  %-12s %4s %c%c%c%c %6s - %s\n", g_driver[i].name,
+                 mode,
+                 ' ', /* unused Flag */
+                 g_driver[i].flags & DRV_FLAG_FHSEC                                                         ? 's' : ' ',
+                 g_driver[i].open     != NULL || (g_driver[i].open == NULL && g_driver[i].vio_init == NULL) ? 'S' : ' ',
+                 g_driver[i].vio_init != NULL || (g_driver[i].open == NULL && g_driver[i].vio_init == NULL) ? 'V' : ' ',
+                 subsys,
+                 g_driver[i].desc);
+  }
  }
 }
