Changeset 5949:9528e85ba67c in roaraudio


Ignore:
Timestamp:
10/20/13 13:23:36 (6 years ago)
Author:
phi
Branch:
default
Message:

Marked roarcatvio as obsolete. Added all unique features to roarcatplay.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5945 r5949  
    22        * Updated checks on commandlion parameters 
    33          (Closes: DEB#716264, DEB#716251, DEB#716245, DEB#716240) 
     4        * Marked roarcatvio as obsolete. Added all unique features to roarcatplay. 
    45 
    56v. 1.0beta10 - Tue Oct 15 2013 12:03 CEST 
  • doc/man1/roarcatplay.1

    r5221 r5949  
    3333Show this help 
    3434 
     35.TP 
     36\fB--rate   RATE\fR 
     37Set sample rate 
     38 
     39.TP 
     40\fB--bits   BITS\fR 
     41Set bits per sample 
     42 
     43.TP 
     44\fB--chans  CHANNELS\fR 
     45Set number of channels 
     46 
     47.TP 
     48\fB--codec  CODEC\fR 
     49Set the codec 
     50 
     51.TP 
     52\fB--aiprofile PROFILE\fR 
     53Use a predefined audio profile. 
     54 
    3555.SH "REMOVED OPTIONS" 
    3656The following options has been removed: 
  • doc/man1/roarcatvio.1

    r3088 r5949  
    1212 
    1313.SH DESCRIPTION 
     14 
     15This tool is now marked as obsolete and will soon be removed. 
     16You should switch to \fBroarcatplay\fR(1). 
    1417 
    1518This tool sends files to roard using the RoarAudio VIO API. 
     
    4548.SH "SEE ALSO" 
    4649\fBroarcat\fR(1), 
     50\fBroarcatplay\fR(1), 
    4751\fBroartips\fR(7), 
    4852\fBlibroar\fR(7), 
  • include/libroar/debug.h

    r5823 r5949  
    6464 
    6565void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info); 
     66void roar_debug_option_obsolete(const char * progname, const char * option, const char * newopt, const char * info); 
    6667 
    6768// Error handle: 
  • libroar/debug.c

    r5823 r5949  
    7878 } else { 
    7979  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); 
     80 } 
     81} 
     82 
     83void roar_debug_option_obsolete(const char * progname, const char * option, const char * newopt, const char * info) { 
     84 if ( info == NULL ) 
     85  info = ""; 
     86 
     87 if ( newopt == NULL ) { 
     88  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); 
     89 } else { 
     90  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); 
    8091 } 
    8192} 
  • roarclients/roarcatplay.c

    r5823 r5949  
    3333 printf("\nOptions:\n\n"); 
    3434 
    35  printf("  --server SERVER    - Set server hostname\n" 
    36         "  --simple           - Use the simple interface (default)\n" 
    37         "  --verbose          - Use verbose output\n" 
    38         "  --help             - Show this help\n" 
     35 printf("  --server SERVER       - Set server hostname\n" 
     36        "  --simple              - Use the simple interface (default)\n" 
     37        "  --verbose             - Use verbose output\n" 
     38        "  --rate   -R RATE      - Set sample rate\n" 
     39        "  --bits   -B BITS      - Set bits per sample\n" 
     40        "  --chans  -C CHANNELS  - Set number of channels\n" 
     41        "  --codec  -E CODEC     - Set the codec\n" 
     42        "  --aiprofile PROFILE   - Set audio profile\n" 
     43        "  --help                - Show this help\n" 
    3944       ); 
    4045 
     
    4247 
    4348int main (int argc, char * argv[]) { 
     49 struct roar_audio_info info = {.rate = ROAR_RATE_DEFAULT, 
     50                                .bits = ROAR_BITS_DEFAULT, 
     51                                .channels = ROAR_CHANNELS_DEFAULT, 
     52                                .codec = ROAR_AUDIO_INFO_INVALID}; 
     53 int    auinfo_changed = 0; 
    4454 const char * server   = NULL; 
     55 const char * file     = NULL; 
    4556 const char * k; 
    4657 int    i; 
    47  const char * file    = NULL; 
    4858 int    verbose = 0; 
    4959 roar_vs_t * vss; 
     
    5969  } else if ( strcmp(k, "--verbose") == 0 || strcmp(k, "-v") == 0 ) { 
    6070   verbose++; 
     71  } else if ( strcmp(k, "-n") == 0 ) { 
     72   roar_debug_option_obsolete(argv[0], "-n", NULL, "Will ignore it for now."); 
     73  } else if ( !strcmp(k, "--rate") || !strcmp(k, "-R") ) { 
     74   info.rate = roar_str2rate(argv[++i]); 
     75   auinfo_changed = 1; 
     76  } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) { 
     77   info.bits = roar_str2bits(argv[++i]); 
     78   auinfo_changed = 1; 
     79  } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) { 
     80   info.channels = roar_str2channels(argv[++i]); 
     81   auinfo_changed = 1; 
     82  } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) { 
     83   info.codec = roar_str2codec(argv[++i]); 
     84   auinfo_changed = 1; 
     85  } else if ( !strcmp(k, "--aiprofile") ) { 
     86   if ( roar_profile2info(&info, argv[++i]) == -1 ) { 
     87    fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); 
     88    return 1; 
     89   } 
     90   auinfo_changed = 1; 
    6191  } else if ( strcmp(k, "--help") == 0 || strcmp(k, "-h") == 0 ) { 
    6292   usage(); 
     
    74104  file = "fh:stdin"; 
    75105 
    76  if ( (vss = roar_vs_new_from_file(server, "roarcatplay", file, &err)) == NULL ) { 
    77   ROAR_ERR("Can not start playback: %s", roar_error2str(err)); 
    78   return 1; 
     106 if ( info.codec == ROAR_AUDIO_INFO_INVALID ) 
     107  info.codec = ROAR_CODEC_DEFAULT; 
     108 
     109 if ( (vss = roar_vs_new(server, "roarcatplay", &err)) == NULL ) { 
     110  fprintf(stderr, "Error: can not connect to server: %s: %s\n", 
     111   server == NULL ? "(default)" : server, roar_error2str(err)); 
     112  return 10; 
    79113 } 
     114 
     115 if ( auinfo_changed ) { 
     116  if ( roar_vs_stream(vss, &info, ROAR_DIR_PLAY, &err) == -1 ) { 
     117   fprintf(stderr, "Error: can not create new stream: %s\n", roar_error2str(err)); 
     118   roar_vs_close(vss, ROAR_VS_TRUE, NULL); 
     119   return 10; 
     120  } 
     121 } 
     122 
     123 if ( roar_vs_file_simple(vss, file, &err) == -1 ) { 
     124  fprintf(stderr, "Error: can not open file: %s: %s\n", file, roar_error2str(err)); 
     125  roar_vs_close(vss, ROAR_VS_TRUE, NULL); 
     126  return 10; 
     127 } 
     128 
    80129 roar_vs_run(vss, NULL); 
    81130 roar_vs_sync(vss, ROAR_VS_WAIT, NULL); 
  • roarclients/roarcatvio.c

    r5823 r5949  
    5757 const char * filename = NULL; 
    5858 int err; 
     59 
     60 roar_debug_bin_obsolete(argv[0], "roarcatplay", NULL); 
    5961 
    6062 for (i = 1; i < argc; i++) { 
Note: See TracChangeset for help on using the changeset viewer.