Changeset 406:91700c05712e in roaraudio for libroarpulse


Ignore:
Timestamp:
08/10/08 01:22:56 (11 years ago)
Author:
phi
Branch:
default
Message:

added basic code of pa_simple_new()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/simple.c

    r405 r406  
    1515    int *error                          /**< A pointer where the error code is stored when the routine returns NULL. It is OK to pass NULL here. */ 
    1616    ) { 
    17  return NULL; 
     17 struct roarpulse_simple * s = malloc(sizeof(struct roarpulse_simple)); 
     18 int (*roarfunc)(int rate, int channels, int bits, int codec, char * server, char * name) = roar_simple_play; 
     19 int codec = -1; 
     20 
     21 if ( !s ) 
     22  return NULL; 
     23 
     24 if ( dir == PA_STREAM_PLAYBACK ) { 
     25  roarfunc = roar_simple_play; 
     26 } else if ( dir == PA_STREAM_RECORD ) { 
     27  roarfunc = roar_simple_record; 
     28 } else { 
     29  free(s); 
     30  return NULL; 
     31 } 
     32 
     33 s->data_fh = roarfunc(ss->rate, ss->channels, 16 /* does PulseAudio support something diffrent? */, 
     34                       codec, (char*)server, (char*)name); 
     35 
     36 return (pa_simple*) s; 
    1837} 
    1938 
Note: See TracChangeset for help on using the changeset viewer.