Changeset 2698:60d1738a6d5c in roaraudio


Ignore:
Timestamp:
09/13/09 13:45:32 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support to create new virtual stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r2634 r2698  
    8383        "  kick TYPE ID            - Kicks object of TYPE with id ID\n" 
    8484        "                            Types: client stream sample source\n" 
     85        "  newvirtual P D E R B C  - Adds a new virtual (child) stream\n" 
     86        "                            Parameters:\n" 
     87        "                             P: Parent stream ID, D: Direction,\n" 
     88        "                             E: codEc, R: sample Rate,\n" 
     89        "                             B: bits per sample, C: nummer of channels\n" 
    8590        "\n" 
    8691        "  metasave ID FILE        - Saves meta data of stream ID to file FILE\n" 
     
    512517} 
    513518 
     519 
     520int newvirtual (struct roar_connection * con, char *p_s, char *d_s, char *e_s, char *r_s, char *b_s, char *c_s) { 
     521 struct roar_stream s; 
     522 int dir    = roar_str2dir(d_s); 
     523 int parent = atoi(p_s); 
     524 
     525 if ( roar_stream_new(&s, atoi(r_s), atoi(c_s), atoi(b_s), roar_str2codec(e_s)) == -1 ) 
     526  return -1; 
     527 
     528 return roar_simple_connect_virtual(con, &s, parent, dir); 
     529} 
     530 
    514531int set_meta (struct roar_connection * con, int id, char * mode, char * type, char * val) { 
    515532 struct roar_meta   meta; 
     
    865882   } 
    866883 
     884  } else if ( !strcmp(k, "newvirtual") ) { 
     885   if ( newvirtual(&con, argv[++i], argv[++i], argv[++i], argv[++i], argv[++i], argv[++i]) == -1 ) { 
     886    fprintf(stderr, "Error: can not create new virtual stream\n"); 
     887   } else { 
     888    printf("virtual stream created\n"); 
     889   } 
     890 
    867891  } else if ( !strcmp(k, "volume") ) { 
    868892   if ( set_mixer(&con, &i, argc, argv) == -1 ) { 
Note: See TracChangeset for help on using the changeset viewer.