Changeset 2813:f677c459d89d in roaraudio for roarclients
- Timestamp:
- 09/29/09 18:00:18 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roarclients
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarmon.c
r2712 r2813 44 44 " --rdtcs - Output Radio Data and Transmitter Control System data\n" 45 45 " --thru - Output copy of other stream\n" 46 " --prethru - Sets prethru flag on stream\n" 46 47 " --rel-id ID - Set ID of relative stream\n" 47 48 " --help - Show this help\n" … … 60 61 char * k; 61 62 int i; 63 int prethru = 0; 62 64 struct roar_connection con; 63 65 struct roar_stream s; … … 112 114 rel_id = atoi(argv[++i]); 113 115 116 } else if ( !strcmp(k, "--prethru") ) { 117 prethru = 1; 118 114 119 } else if ( !strcmp(k, "--help") || !strcmp(k, "-h") ) { 115 120 usage(); … … 194 199 } 195 200 201 if ( prethru ) { 202 if ( roar_stream_set_flags(&con, &s, ROAR_FLAG_PRETHRU, 0) == -1 ) { 203 fprintf(stderr, "Error: can not set prethru flag on stream\n"); 204 roar_disconnect(&con); 205 return 14; 206 } 207 } 208 196 209 if ( roar_stream_exec(&con, &s) == -1 ) { 197 210 fprintf(stderr, "Error: can not exec stream\n"); -
roarclients/roarmonhttp.c
r2220 r2813 211 211 int channels = 2; 212 212 int codec = ROAR_CODEC_OGG_VORBIS; 213 int rel_id = -1; 214 int sflags = ROAR_FLAG_NONE; 213 215 // int codec = ROAR_CODEC_DEFAULT; 214 216 char * server = NULL; … … 220 222 int dir = ROAR_DIR_MONITOR; 221 223 int gopher = 0; 224 struct roar_connection con; 225 struct roar_stream s; 222 226 223 227 #ifdef ROAR_HAVE_ALARM … … 261 265 } else if ( !strcmp(k, "bits") ) { 262 266 bits = atoi(v); 267 } else if ( !strcmp(k, "rel-id") || !strcmp(k, "relid") ) { 268 rel_id = atoi(v); 269 } else if ( !strcmp(k, "set-flag") ) { 270 if ( !strcmp(v, "meta") ) { 271 sflags |= ROAR_FLAG_META; 272 } else if ( !strcmp(v, "cleanmeta") ) { 273 sflags |= ROAR_FLAG_CLEANMETA; 274 } else if ( !strcmp(v, "prethru") ) { 275 sflags |= ROAR_FLAG_PRETHRU; 276 } else { 277 return 1; 278 } 279 } else if ( !strcmp(k, "dir") ) { 280 if ( (dir = roar_str2dir(v)) == -1 ) 281 return 1; 263 282 } else { 264 283 return 1; … … 272 291 } 273 292 274 275 if ( (fh = roar_simple_stream(rate, channels, bits, codec, server, dir, "roarmonhttp")) == -1 ) { 276 // fprintf(stderr, "Error: can not start monitoring\n"); 293 if ( roar_simple_connect(&con, server, "roarmonhttp") == -1 ) { 294 return 10; 295 } 296 297 if ( roar_stream_new(&s, rate, channels, bits, codec) == -1 ) { 298 roar_disconnect(&con); 299 return 20; 300 } 301 302 if ( rel_id != -1 ) { 303 if ( roar_stream_set_rel_id(&s, rel_id) ) { 304 roar_disconnect(&con); 305 return 21; 306 } 307 } 308 309 if ( roar_stream_connect(&con, &s, dir) == -1 ) { 310 roar_disconnect(&con); 311 return 11; 312 } 313 314 if ( sflags != ROAR_FLAG_NONE ) { 315 if ( roar_stream_set_flags(&con, &s, sflags, 0) == -1 ) { 316 roar_disconnect(&con); 317 return 14; 318 } 319 } 320 321 if ( roar_stream_exec(&con, &s) == -1 ) { 322 roar_disconnect(&con); 323 return 12; 324 } 325 326 if ( (fh = roar_get_connection_fh(&con)) == -1 ) 277 327 return 1; 278 }279 328 280 329 if ( !gopher ) … … 292 341 break; 293 342 case ROAR_DIR_MONITOR: 343 case ROAR_DIR_THRU: 294 344 stream(ROAR_STDOUT, fh); 295 345 break;
Note: See TracChangeset
for help on using the changeset viewer.