Changeset 3407:44e4037cb096 in roaraudio for libroarpulse


Ignore:
Timestamp:
02/11/10 16:49:44 (10 years ago)
Author:
phi
Branch:
default
Message:

most of the work for pa_context_get_server_info() is done, we need some aux functions to continue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/introspect.c

    r3404 r3407  
    5858 
    5959/** Get some information about the server */ 
    60 pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata); 
     60pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata) { 
     61 struct roar_stream stream; 
     62 struct roar_client client; 
     63 pa_server_info painfo; 
     64 
     65 if ( c == NULL ) 
     66  return roar_pa_op_new_done(); 
     67 
     68 if ( roar_server_oinfo(roar_pa_context_get_con(c), &stream) == -1 ) 
     69  return roar_pa_op_new_done(); 
     70 
     71 if ( roar_get_client(roar_pa_context_get_con(c), &client, 0) == -1 ) 
     72  return roar_pa_op_new_done(); 
     73 
     74 memset(&painfo, 0, sizeof(painfo)); 
     75 
     76 painfo.user_name           = "(none)"; 
     77 painfo.host_name           = pa_context_get_server(c); 
     78 painfo.server_version      = pa_get_library_version(); 
     79 painfo.server_name         = "pulseaudio"; 
     80 painfo.default_sink_name   = NULL; 
     81 painfo.default_source_name = NULL; 
     82 painfo.cookie              = 0x524F4152; 
     83 painfo.cookie             ^= (client.pid & 0xFF) | (client.uid & 0xFF) << 8 | (client.gid & 0xFF) << 16; 
     84 
     85 if ( cb != NULL ) { 
     86  cb(c, &painfo, userdata); 
     87 } 
     88 
     89 return roar_pa_op_new_done(); 
     90} 
    6191 
    6292/** Get some information about a module by its index */ 
Note: See TracChangeset for help on using the changeset viewer.