Changeset 5949:9528e85ba67c in roaraudio
- Timestamp:
- 10/20/13 13:23:36 (10 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5945 r5949 2 2 * Updated checks on commandlion parameters 3 3 (Closes: DEB#716264, DEB#716251, DEB#716245, DEB#716240) 4 * Marked roarcatvio as obsolete. Added all unique features to roarcatplay. 4 5 5 6 v. 1.0beta10 - Tue Oct 15 2013 12:03 CEST -
doc/man1/roarcatplay.1
r5221 r5949 33 33 Show this help 34 34 35 .TP 36 \fB--rate RATE\fR 37 Set sample rate 38 39 .TP 40 \fB--bits BITS\fR 41 Set bits per sample 42 43 .TP 44 \fB--chans CHANNELS\fR 45 Set number of channels 46 47 .TP 48 \fB--codec CODEC\fR 49 Set the codec 50 51 .TP 52 \fB--aiprofile PROFILE\fR 53 Use a predefined audio profile. 54 35 55 .SH "REMOVED OPTIONS" 36 56 The following options has been removed: -
doc/man1/roarcatvio.1
r3088 r5949 12 12 13 13 .SH DESCRIPTION 14 15 This tool is now marked as obsolete and will soon be removed. 16 You should switch to \fBroarcatplay\fR(1). 14 17 15 18 This tool sends files to roard using the RoarAudio VIO API. … … 45 48 .SH "SEE ALSO" 46 49 \fBroarcat\fR(1), 50 \fBroarcatplay\fR(1), 47 51 \fBroartips\fR(7), 48 52 \fBlibroar\fR(7), -
include/libroar/debug.h
r5823 r5949 64 64 65 65 void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info); 66 void roar_debug_option_obsolete(const char * progname, const char * option, const char * newopt, const char * info); 66 67 67 68 // Error handle: -
libroar/debug.c
r5823 r5949 78 78 } else { 79 79 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 83 void 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); 80 91 } 81 92 } -
roarclients/roarcatplay.c
r5823 r5949 33 33 printf("\nOptions:\n\n"); 34 34 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" 39 44 ); 40 45 … … 42 47 43 48 int 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; 44 54 const char * server = NULL; 55 const char * file = NULL; 45 56 const char * k; 46 57 int i; 47 const char * file = NULL;48 58 int verbose = 0; 49 59 roar_vs_t * vss; … … 59 69 } else if ( strcmp(k, "--verbose") == 0 || strcmp(k, "-v") == 0 ) { 60 70 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; 61 91 } else if ( strcmp(k, "--help") == 0 || strcmp(k, "-h") == 0 ) { 62 92 usage(); … … 74 104 file = "fh:stdin"; 75 105 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; 79 113 } 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 80 129 roar_vs_run(vss, NULL); 81 130 roar_vs_sync(vss, ROAR_VS_WAIT, NULL); -
roarclients/roarcatvio.c
r5823 r5949 57 57 const char * filename = NULL; 58 58 int err; 59 60 roar_debug_bin_obsolete(argv[0], "roarcatplay", NULL); 59 61 60 62 for (i = 1; i < argc; i++) {
Note: See TracChangeset
for help on using the changeset viewer.