Changeset 3329:d939b3aedbc5 in roaraudio
- Timestamp:
- 02/04/10 02:58:20 (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroardsp/channels.h
r3328 r3329 60 60 #define ROARDSP_CHAN_LFE 12 61 61 62 #define ROARDSP_CHANMAP_IN 0 63 #define ROARDSP_CHANMAP_OUT 1 64 #define ROARDSP_CHANMAP_MAP 2 65 66 struct roardsp_chanmap { 67 char in [ROAR_MAX_CHANNELS]; 68 char out[ROAR_MAX_CHANNELS]; 69 char map[ROAR_MAX_CHANNELS]; 70 }; 62 71 63 72 char * roardsp_chan2str (int chan); 64 73 int roardsp_str2chan(char * str); 65 74 75 int roardsp_chanmap_calc(struct roardsp_chanmap * map, int what, int err_on_none); 76 66 77 #endif 67 78 -
libroardsp/channels.c
r3328 r3329 70 70 } 71 71 72 int roardsp_chanmap_calc(struct roardsp_chanmap * map, int what, int err_on_none) { 73 int a, b; 74 75 if ( map == NULL ) 76 return -1; 77 78 switch (what) { 79 case ROARDSP_CHANMAP_MAP: 80 memset(map->map, (char)-1, sizeof(map->map)); 81 82 for (a = 0; a < ROAR_MAX_CHANNELS; a++) { 83 if ( map->in[a] == ROARDSP_CHAN_NONE ) 84 continue; 85 86 for (b = 0; b < ROAR_MAX_CHANNELS; b++) { 87 if ( map->in[a] == map->out[b] ) { 88 map->map[a] = b; 89 break; 90 } 91 } 92 if ( b == ROAR_MAX_CHANNELS ) { // src not found in dest 93 if ( err_on_none ) 94 return -1; 95 96 map->map[a] = -1; 97 } 98 } 99 break; 100 case ROARDSP_CHANMAP_IN: 101 case ROARDSP_CHANMAP_OUT: 102 default: 103 return -1; 104 break; 105 } 106 107 return 0; 108 } 109 72 110 //ll
Note: See TracChangeset
for help on using the changeset viewer.