Changeset 2420:6a4d707ebb74 in roaraudio
- Timestamp:
- 08/18/09 04:56:49 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roarclients
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarcat.c
r2407 r2420 48 48 49 49 int main (int argc, char * argv[]) { 50 int rate = ROAR_RATE_DEFAULT;51 int bits = ROAR_BITS_DEFAULT;52 int channels = ROAR_CHANNELS_DEFAULT;53 int codec = ROAR_CODEC_DEFAULT;50 int rate = -1; 51 int bits = -1; 52 int channels = -1; 53 int codec = -1; 54 54 int dir = ROAR_DIR_PLAY; 55 55 int rel_id = -1; … … 97 97 } else if ( !strcmp(k, "--midi") ) { 98 98 dir = ROAR_DIR_MIDI_IN; 99 bits = ROAR_MIDI_BITS;100 channels = ROAR_MIDI_CHANNELS_DEFAULT;101 if ( codec == ROAR_CODEC_DEFAULT )102 codec = ROAR_CODEC_MIDI;103 99 } else if ( !strcmp(k, "--light") ) { 104 100 dir = ROAR_DIR_LIGHT_IN; 105 if ( codec == ROAR_CODEC_DEFAULT )106 codec = ROAR_CODEC_DMX512;107 101 } else if ( !strcmp(k, "--raw") ) { 108 102 dir = ROAR_DIR_RAW_IN; … … 125 119 return 1; 126 120 } 121 } 122 123 switch (dir) { 124 case ROAR_DIR_PLAY: 125 if ( rate == -1 ) rate = ROAR_RATE_DEFAULT; 126 if ( bits == -1 ) bits = ROAR_BITS_DEFAULT; 127 if ( channels == -1 ) channels = ROAR_CHANNELS_DEFAULT; 128 if ( codec == -1 ) codec = ROAR_CODEC_DEFAULT; 129 break; 130 case ROAR_DIR_MIDI_IN: 131 if ( rate == -1 ) rate = 0; 132 if ( bits == -1 ) bits = ROAR_MIDI_BITS; 133 if ( channels == -1 ) channels = ROAR_MIDI_CHANNELS_DEFAULT; 134 if ( codec == -1 ) codec = ROAR_CODEC_MIDI; 135 break; 136 case ROAR_DIR_LIGHT_IN: 137 if ( rate == -1 ) rate = 0; 138 if ( bits == -1 ) bits = ROAR_LIGHT_BITS; 139 if ( channels == -1 ) channels = 0; 140 if ( codec == -1 ) codec = ROAR_CODEC_DMX512; 141 break; 142 case ROAR_DIR_RAW_IN: 143 default: 144 if ( rate == -1 ) rate = 0; 145 if ( bits == -1 ) bits = 0; 146 if ( channels == -1 ) channels = 0; 147 if ( codec == -1 ) codec = ROAR_CODEC_DEFAULT; 148 break; 127 149 } 128 150 -
roarclients/roarmon.c
r2407 r2420 49 49 50 50 int main (int argc, char * argv[]) { 51 int rate = ROAR_RATE_DEFAULT;52 int bits = ROAR_BITS_DEFAULT;53 int channels = ROAR_CHANNELS_DEFAULT;54 int codec = ROAR_CODEC_DEFAULT;51 int rate = -1; 52 int bits = -1; 53 int channels = -1; 54 int codec = -1; 55 55 int dir = ROAR_DIR_MONITOR; 56 56 int rel_id = -1; … … 97 97 } else if ( !strcmp(k, "--midi") ) { 98 98 dir = ROAR_DIR_MIDI_OUT; 99 bits = ROAR_MIDI_BITS;100 channels = ROAR_MIDI_CHANNELS_DEFAULT;101 if ( codec == ROAR_CODEC_DEFAULT )102 codec = ROAR_CODEC_MIDI;103 99 } else if ( !strcmp(k, "--light") ) { 104 100 dir = ROAR_DIR_LIGHT_OUT; 105 if ( codec == ROAR_CODEC_DEFAULT )106 codec = ROAR_CODEC_DMX512;107 101 } else if ( !strcmp(k, "--raw") ) { 108 102 dir = ROAR_DIR_RAW_OUT; … … 128 122 } 129 123 124 switch (dir) { 125 case ROAR_DIR_MONITOR: 126 if ( rate == -1 ) rate = ROAR_RATE_DEFAULT; 127 if ( bits == -1 ) bits = ROAR_BITS_DEFAULT; 128 if ( channels == -1 ) channels = ROAR_CHANNELS_DEFAULT; 129 if ( codec == -1 ) codec = ROAR_CODEC_DEFAULT; 130 break; 131 case ROAR_DIR_MIDI_OUT: 132 if ( rate == -1 ) rate = 0; 133 if ( bits == -1 ) bits = ROAR_MIDI_BITS; 134 if ( channels == -1 ) channels = ROAR_MIDI_CHANNELS_DEFAULT; 135 if ( codec == -1 ) codec = ROAR_CODEC_MIDI; 136 break; 137 case ROAR_DIR_LIGHT_OUT: 138 if ( rate == -1 ) rate = 0; 139 if ( bits == -1 ) bits = ROAR_LIGHT_BITS; 140 if ( channels == -1 ) channels = 0; 141 if ( codec == -1 ) codec = ROAR_CODEC_DMX512; 142 break; 143 case ROAR_DIR_RAW_OUT: 144 case ROAR_DIR_THRU: 145 default: 146 if ( rate == -1 ) rate = 0; 147 if ( bits == -1 ) bits = 0; 148 if ( channels == -1 ) channels = 0; 149 if ( codec == -1 ) codec = ROAR_CODEC_DEFAULT; 150 break; 151 } 152 130 153 if ( roar_simple_connect(&con, server, "roarmon") == -1 ) { 131 154 fprintf(stderr, "Error: can not connect to server\n");
Note: See TracChangeset
for help on using the changeset viewer.