Changeset 908:fdfe33d17972 in roaraudio


Ignore:
Timestamp:
12/06/08 17:46:23 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to set stream meta data and updated help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarshout.c

    r907 r908  
    3131 
    3232void usage (void) { 
    33  printf("roarmon [OPTIONS]...\n"); 
    34  
    35  printf("\nOptions:\n\n"); 
    36  
    37  printf("  --server SERVER    - Set server hostname\n" 
    38         "  --rate   RATE      - Set sample rate\n" 
    39         "  --bits   BITS      - Set bits per sample\n" 
    40         "  --chans  CHANNELS  - Set number of channels\n" 
    41         "  --codec  CODEC     - Set the codec\n" 
    42         "  --help             - Show this help\n" 
     33 printf("roarmon [OPTIONS]... [address [port [password [mountpoint]]]\n"); 
     34 
     35 printf("\nRoarAudio Options:\n\n"); 
     36 
     37 printf("    --server SERVER    - Set server hostname\n" 
     38        "    --rate   RATE      - Set sample rate\n" 
     39        "    --bits   BITS      - Set bits per sample\n" 
     40        "    --chans  CHANNELS  - Set number of channels\n" 
     41        "    --codec  CODEC     - Set the codec\n" 
     42        " -h --help             - Show this help\n" 
     43       ); 
     44 
     45 printf("\nlibshout Options:\n\n"); 
     46 
     47 printf(" -p --public           - Allow listing in stream directory\n" 
     48        " -d          DESC      - Set stream description\n" 
     49        " -g          GENRE     - Set stream genre\n" 
     50        " -n          NAME      - Set stream name\n" 
     51        " -u          URL       - Set stream URL/homepage\n" 
    4352       ); 
    4453 
     
    5665 char * s_pw     = NULL; 
    5766 int    s_port   = -1; 
     67 char * s_desc   = NULL; 
     68 char * s_genre  = NULL; 
     69 char * s_name   = NULL; 
     70 char * s_url    = NULL; 
     71 int    s_public = 0; 
    5872 int    fh; 
    5973 int    i; 
     
    7488  } else if ( strcmp(k, "--codec") == 0 ) { 
    7589   codec = roar_str2codec(argv[++i]); 
    76   } else if ( strcmp(k, "--help") == 0 ) { 
     90  } else if ( strcmp(k, "-p") == 0 || strcmp(k, "--public") == 0 ) { 
     91   s_public = 1; 
     92  } else if ( strcmp(k, "-d") == 0 ) { 
     93   s_desc   = argv[++i]; 
     94  } else if ( strcmp(k, "-g") == 0 ) { 
     95   s_genre  = argv[++i]; 
     96  } else if ( strcmp(k, "-n") == 0 ) { 
     97   s_name   = argv[++i]; 
     98  } else if ( strcmp(k, "-u") == 0 ) { 
     99   s_url    = argv[++i]; 
     100  } else if ( strcmp(k, "-h") == 0 || strcmp(k, "--help") == 0 ) { 
    77101   usage(); 
    78102   return 0; 
     
    146170 } 
    147171 
     172 shout_set_public(shout, s_public); 
     173 
     174 if (s_desc  != NULL) 
     175  shout_set_description(shout, s_desc); 
     176 
     177 if (s_genre != NULL) 
     178  shout_set_genre(shout, s_genre); 
     179 
     180 if (s_name  != NULL) 
     181  shout_set_name(shout, s_name); 
     182 
     183 if (s_url   != NULL) 
     184  shout_set_url(shout, s_url); 
     185 
    148186 if ( (fh = roar_simple_monitor(rate, channels, bits, codec, server, "roarshout")) == -1 ) { 
    149187  fprintf(stderr, "Error: can not start monetoring\n"); 
     
    157195 
    158196 while((i = read(fh, buf, BUFSIZE))) 
    159   if (shout_send(shout, buf, i) != SHOUTERR_SUCCESS) 
     197  if (shout_send(shout, (unsigned char*)buf, i) != SHOUTERR_SUCCESS) 
    160198   break; 
    161199 
Note: See TracChangeset for help on using the changeset viewer.