Changeset 2227:802529aa529d in roaraudio
- Timestamp:
- 07/28/09 02:08:38 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roarclients
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/Makefile
r2216 r2227 49 49 $L 50 50 roarinterconnect: roarinterconnect.o 51 $L 51 $L $(lib_esd) 52 52 roarbidir: roarbidir.o 53 53 $L -
roarclients/roarinterconnect.c
r2226 r2227 25 25 #include <roaraudio.h> 26 26 27 #ifdef ROAR_HAVE_ESD 28 #include <esd.h> 29 #endif 30 31 #define MT_NULL 0x00 32 #define MT_MASK 0xF0 33 #define MT_ROAR 0x10 34 #define MT_ESD 0x20 35 36 #define ST_NONE 0x00 37 #define ST_MASK 0x0F 38 #define ST_BIDIR 0x01 39 #define ST_FILTER 0x02 40 27 41 void usage (void) { 28 42 printf("roarinterconnect [OPTIONS]...\n"); … … 49 63 int channels = 2; 50 64 int codec = ROAR_CODEC_DEFAULT; 65 int type = MT_ROAR|ST_BIDIR; 66 int tmp; 51 67 char * server = NULL; 52 68 char * remote = NULL; … … 80 96 } 81 97 82 rfh = roar_simple_stream(rate, channels, bits, codec, remote, ROAR_DIR_BIDIR, "roarinterconnect"); 98 switch (type & MT_MASK) { 99 case MT_ROAR: 100 switch (type & ST_MASK) { 101 case ST_BIDIR: 102 tmp = ROAR_DIR_BIDIR; 103 break; 104 case ST_FILTER: 105 tmp = ROAR_DIR_FILTER; 106 break; 107 default: 108 fprintf(stderr, "Error: unknown stream type\n"); 109 return 2; 110 } 111 rfh = roar_simple_stream(rate, channels, bits, codec, remote, tmp, "roarinterconnect"); 112 break; 113 #ifdef ROAR_HAVE_ESD 114 case MT_ESD: 115 if ( (type & ST_MASK) != ST_FILTER ) { 116 fprintf(stderr, "Error: server type only supports stream type filter\n"); 117 return 2; 118 } 119 120 tmp = ESD_STREAM|ESD_PLAY; 121 122 switch (bits) { 123 case 8: tmp |= ESD_BITS8; break; 124 case 16: tmp |= ESD_BITS16; break; 125 default: 126 fprintf(stderr, "Error: EsounD only supports 8 and 16 bit streams\n"); 127 return 2; 128 } 129 130 switch (channels) { 131 case 1: tmp |= ESD_MONO; break; 132 case 2: tmp |= ESD_STEREO; break; 133 default: 134 fprintf(stderr, "Error: EsounD only supports mono and stereo streams\n"); 135 return 2; 136 } 137 138 rfh = esd_filter_stream(tmp, rate, remote, "roarinterconnect"); 139 break; 140 #endif 141 default: 142 fprintf(stderr, "Error: unknown/not supported server type\n"); 143 return 2; 144 } 83 145 84 146 if ( rfh == -1 ) {
Note: See TracChangeset
for help on using the changeset viewer.