Changeset 3388:0a02c6ba7c10 in roaraudio


Ignore:
Timestamp:
02/11/10 13:21:23 (10 years ago)
Author:
phi
Branch:
default
Message:

implement roar_pa_find_server(), function to search for PA server

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroarpulse/libroarpulse.h

    r3383 r3388  
    5353int roar_pa_sspec2auinfo (struct roar_audio_info * info, const pa_sample_spec * ss); 
    5454 
     55char * roar_pa_find_server (char * server); 
     56 
    5557#endif 
    5658 
  • libroarpulse/libroarpulse.c

    r3383 r3388  
    8383} 
    8484 
     85char * roar_pa_find_server (char * server) { 
     86 struct roar_x11_connection * x11con; 
     87 
     88 if ( server == NULL ) 
     89  server = getenv("PULSE_SERVER"); 
     90 
     91 if ( server == NULL ) { 
     92  if ( (x11con = roar_x11_connect(NULL)) != NULL ) { 
     93   server = roar_x11_get_prop(x11con, "PULSE_SERVER"); 
     94   roar_x11_disconnect(x11con); 
     95  } 
     96 } 
     97 
     98 return server; 
     99} 
     100 
    85101//ll 
Note: See TracChangeset for help on using the changeset viewer.