Changeset 770:3f3103b894a1 in roaraudio


Ignore:
Timestamp:
09/07/08 04:31:18 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added --background, true background playback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarcatplay.c

    r765 r770  
    3535        "  --simple           - Use the simple interface (default)\n" 
    3636        "  --passive          - Use passiv playback (experimental, works only localy)\n" 
     37        "  --background       - Use background playback, impleys passive mode\n" 
    3738        "  --help             - Show this help\n" 
    3839       ); 
     
    4950 char * file = NULL; 
    5051 int    mode = MODE_SIMPLE; 
     52 int    bg   = 0; 
    5153 struct roar_connection con[1]; 
     54 struct roar_stream     stream[1]; 
    5255 
    5356 for (i = 1; i < argc; i++) { 
     
    6063  } else if ( strcmp(k, "--passive") == 0 ) { 
    6164   mode = MODE_PASSIVE; 
     65  } else if ( strcmp(k, "--background") == 0 ) { 
     66   bg = 1; 
    6267  } else if ( strcmp(k, "--help") == 0 ) { 
    6368   usage(); 
     
    7277 } 
    7378 
     79 if ( bg ) 
     80  mode = MODE_PASSIVE; 
    7481 
    7582 if ( file == NULL ) 
     
    8289  } 
    8390 
    84   if ( roar_file_play_full(con, file, 0, 1, NULL) == -1 ) { 
     91  if ( roar_file_play_full(con, file, 0, 1, stream) == -1 ) { 
    8592   ROAR_ERR("Can not start playback"); 
    8693   return 1; 
    8794  } 
    8895 
    89   sleep(10); 
     96  if ( bg ) { 
     97   if ( roar_stream_attach_simple(con, stream, 0) == -1 ) { 
     98    ROAR_ERR("Can not attach stream to server"); 
     99   } 
     100  } else { 
     101   sleep(10); 
     102  } 
    90103 
    91104  roar_disconnect(con); 
Note: See TracChangeset for help on using the changeset viewer.