Changeset 3420:a4ccb3b17562 in roaraudio


Ignore:
Timestamp:
02/11/10 20:13:41 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

started with channel mapping stuff

Location:
libroarpulse
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/channelmap.c

    r3419 r3420  
    4343 
    4444/** Initialize the specified channel map for monoaural audio and return a pointer to it */ 
    45 pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m); 
     45pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m) { 
     46 m->channels = 1; 
     47 m->map[0]   = PA_CHANNEL_POSITION_MONO; 
     48 
     49 return m; 
     50} 
    4651 
    4752/** Initialize the specified channel map for stereophonic audio and return a pointer to it */ 
    48 pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m); 
     53pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m) { 
     54 m->channels = 2; 
     55 m->map[0]   = PA_CHANNEL_POSITION_LEFT; 
     56 m->map[1]   = PA_CHANNEL_POSITION_RIGHT; 
     57 
     58 return m; 
     59} 
    4960 
    5061/** Initialize the specified channel map for the specified number 
    5162 * of channels using default labels and return a pointer to it. */ 
    52 pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def); 
     63pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def) { 
     64 if ( m == NULL || channels == 0 ) 
     65  return NULL; 
     66 
     67 switch (channels) { 
     68  case 1: return pa_channel_map_init_mono(m);   break; 
     69  case 2: return pa_channel_map_init_stereo(m); break; 
     70 } 
     71 
     72 switch (def) { 
     73  default: 
     74    return NULL; 
     75 } 
     76} 
    5377 
    5478/** Return a text label for the specified channel position */ 
  • libroarpulse/introspect.c

    r3412 r3420  
    5858  return roar_pa_op_new_done(); 
    5959 
    60 // pa_channel_map_init_auto(&(painfo.channel_map), stream.info.channels, PA_CHANNEL_MAP_DEFAULT); 
     60 pa_channel_map_init_auto(&(painfo.channel_map), stream.info.channels, PA_CHANNEL_MAP_DEFAULT); 
    6161// pa_cvolume_init(&(painfo.volume)); 
    6262 
Note: See TracChangeset for help on using the changeset viewer.