Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5945)
+++ ChangeLog	(revision 5949)
@@ -2,4 +2,5 @@
 	* Updated checks on commandlion parameters
 	  (Closes: DEB#716264, DEB#716251, DEB#716245, DEB#716240)
+	* Marked roarcatvio as obsolete. Added all unique features to roarcatplay.
 
 v. 1.0beta10 - Tue Oct 15 2013 12:03 CEST
Index: doc/man1/roarcatplay.1
===================================================================
--- doc/man1/roarcatplay.1	(revision 5221)
+++ doc/man1/roarcatplay.1	(revision 5949)
@@ -33,4 +33,24 @@
 Show this help
 
+.TP
+\fB--rate   RATE\fR
+Set sample rate
+
+.TP
+\fB--bits   BITS\fR
+Set bits per sample
+
+.TP
+\fB--chans  CHANNELS\fR
+Set number of channels
+
+.TP
+\fB--codec  CODEC\fR
+Set the codec
+
+.TP
+\fB--aiprofile PROFILE\fR
+Use a predefined audio profile.
+
 .SH "REMOVED OPTIONS"
 The following options has been removed:
Index: doc/man1/roarcatvio.1
===================================================================
--- doc/man1/roarcatvio.1	(revision 3088)
+++ doc/man1/roarcatvio.1	(revision 5949)
@@ -12,4 +12,7 @@
 
 .SH DESCRIPTION
+
+This tool is now marked as obsolete and will soon be removed.
+You should switch to \fBroarcatplay\fR(1).
 
 This tool sends files to roard using the RoarAudio VIO API.
@@ -45,4 +48,5 @@
 .SH "SEE ALSO"
 \fBroarcat\fR(1),
+\fBroarcatplay\fR(1),
 \fBroartips\fR(7),
 \fBlibroar\fR(7),
Index: include/libroar/debug.h
===================================================================
--- include/libroar/debug.h	(revision 5823)
+++ include/libroar/debug.h	(revision 5949)
@@ -64,4 +64,5 @@
 
 void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info);
+void roar_debug_option_obsolete(const char * progname, const char * option, const char * newopt, const char * info);
 
 // Error handle:
Index: libroar/debug.c
===================================================================
--- libroar/debug.c	(revision 5823)
+++ libroar/debug.c	(revision 5949)
@@ -78,4 +78,15 @@
  } else {
   roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, 0, progname, ROAR_DBG_PREFIX, "This program is obsolete and will be removed soon. Please use %s. %s", newprog, info);
+ }
+}
+
+void roar_debug_option_obsolete(const char * progname, const char * option, const char * newopt, const char * info) {
+ if ( info == NULL )
+  info = "";
+
+ if ( newopt == NULL ) {
+  roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, 0, progname, ROAR_DBG_PREFIX, "The option \"%s\" is obsolete and will be removed soon. %s", option, info);
+ } else {
+  roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, 0, progname, ROAR_DBG_PREFIX, "The option \"%s\" is obsolete and will be removed soon. Please use \"%s\". %s", option, newopt, info);
  }
 }
Index: roarclients/roarcatplay.c
===================================================================
--- roarclients/roarcatplay.c	(revision 5823)
+++ roarclients/roarcatplay.c	(revision 5949)
@@ -33,8 +33,13 @@
  printf("\nOptions:\n\n");
 
- printf("  --server SERVER    - Set server hostname\n"
-        "  --simple           - Use the simple interface (default)\n"
-        "  --verbose          - Use verbose output\n"
-        "  --help             - Show this help\n"
+ printf("  --server SERVER       - Set server hostname\n"
+        "  --simple              - Use the simple interface (default)\n"
+        "  --verbose             - Use verbose output\n"
+        "  --rate   -R RATE      - Set sample rate\n"
+        "  --bits   -B BITS      - Set bits per sample\n"
+        "  --chans  -C CHANNELS  - Set number of channels\n"
+        "  --codec  -E CODEC     - Set the codec\n"
+        "  --aiprofile PROFILE   - Set audio profile\n"
+        "  --help                - Show this help\n"
        );
 
@@ -42,8 +47,13 @@
 
 int main (int argc, char * argv[]) {
+ struct roar_audio_info info = {.rate = ROAR_RATE_DEFAULT,
+                                .bits = ROAR_BITS_DEFAULT,
+                                .channels = ROAR_CHANNELS_DEFAULT,
+                                .codec = ROAR_AUDIO_INFO_INVALID};
+ int    auinfo_changed = 0;
  const char * server   = NULL;
+ const char * file     = NULL;
  const char * k;
  int    i;
- const char * file    = NULL;
  int    verbose = 0;
  roar_vs_t * vss;
@@ -59,4 +69,24 @@
   } else if ( strcmp(k, "--verbose") == 0 || strcmp(k, "-v") == 0 ) {
    verbose++;
+  } else if ( strcmp(k, "-n") == 0 ) {
+   roar_debug_option_obsolete(argv[0], "-n", NULL, "Will ignore it for now.");
+  } else if ( !strcmp(k, "--rate") || !strcmp(k, "-R") ) {
+   info.rate = roar_str2rate(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) {
+   info.bits = roar_str2bits(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) {
+   info.channels = roar_str2channels(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) {
+   info.codec = roar_str2codec(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--aiprofile") ) {
+   if ( roar_profile2info(&info, argv[++i]) == -1 ) {
+    fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error));
+    return 1;
+   }
+   auinfo_changed = 1;
   } else if ( strcmp(k, "--help") == 0 || strcmp(k, "-h") == 0 ) {
    usage();
@@ -74,8 +104,27 @@
   file = "fh:stdin";
 
- if ( (vss = roar_vs_new_from_file(server, "roarcatplay", file, &err)) == NULL ) {
-  ROAR_ERR("Can not start playback: %s", roar_error2str(err));
-  return 1;
+ if ( info.codec == ROAR_AUDIO_INFO_INVALID )
+  info.codec = ROAR_CODEC_DEFAULT;
+
+ if ( (vss = roar_vs_new(server, "roarcatplay", &err)) == NULL ) {
+  fprintf(stderr, "Error: can not connect to server: %s: %s\n",
+   server == NULL ? "(default)" : server, roar_error2str(err));
+  return 10;
  }
+
+ if ( auinfo_changed ) {
+  if ( roar_vs_stream(vss, &info, ROAR_DIR_PLAY, &err) == -1 ) {
+   fprintf(stderr, "Error: can not create new stream: %s\n", roar_error2str(err));
+   roar_vs_close(vss, ROAR_VS_TRUE, NULL);
+   return 10;
+  }
+ }
+
+ if ( roar_vs_file_simple(vss, file, &err) == -1 ) {
+  fprintf(stderr, "Error: can not open file: %s: %s\n", file, roar_error2str(err));
+  roar_vs_close(vss, ROAR_VS_TRUE, NULL);
+  return 10;
+ }
+
  roar_vs_run(vss, NULL);
  roar_vs_sync(vss, ROAR_VS_WAIT, NULL);
Index: roarclients/roarcatvio.c
===================================================================
--- roarclients/roarcatvio.c	(revision 5823)
+++ roarclients/roarcatvio.c	(revision 5949)
@@ -57,4 +57,6 @@
  const char * filename = NULL;
  int err;
+
+ roar_debug_bin_obsolete(argv[0], "roarcatplay", NULL);
 
  for (i = 1; i < argc; i++) {
