Mercurial > hg > beaglert
comparison core/RTAudioCommandLine.cpp @ 537:bfcbeb437869 API-update
Updated RTAudioSettings with in/out, ported some examples and libpd
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 24 Jun 2016 01:36:07 +0100 |
parents | e4392164b458 |
children |
comparison
equal
deleted
inserted
replaced
528:5c8f46fcd4d0 | 537:bfcbeb437869 |
---|---|
51 { | 51 { |
52 // Set default values for settings | 52 // Set default values for settings |
53 settings->periodSize = 16; | 53 settings->periodSize = 16; |
54 settings->useAnalog = 1; | 54 settings->useAnalog = 1; |
55 settings->useDigital = 1; | 55 settings->useDigital = 1; |
56 settings->numAnalogChannels = 8; | 56 settings->numAudioInChannels = 2; |
57 settings->numAudioOutChannels = 2; | |
58 | |
59 settings->numAnalogInChannels = 8; | |
60 settings->numAnalogOutChannels = 8; | |
57 settings->numDigitalChannels = 16; | 61 settings->numDigitalChannels = 16; |
58 | 62 |
59 settings->beginMuted = 0; | 63 settings->beginMuted = 0; |
60 settings->dacLevel = DEFAULT_DAC_LEVEL; | 64 settings->dacLevel = DEFAULT_DAC_LEVEL; |
61 settings->adcLevel = DEFAULT_ADC_LEVEL; | 65 settings->adcLevel = DEFAULT_ADC_LEVEL; |
166 settings->useDigital = atoi(optarg); | 170 settings->useDigital = atoi(optarg); |
167 if(settings->useDigital == 0){ | 171 if(settings->useDigital == 0){ |
168 settings->numDigitalChannels = 0; | 172 settings->numDigitalChannels = 0; |
169 } | 173 } |
170 break; | 174 break; |
171 case 'C': | 175 case 'C': { |
172 settings->numAnalogChannels = atoi(optarg); | 176 // TODO: a different number of channels for inputs and outputs is not yet supported |
173 if(settings->numAnalogChannels >= 8) { | 177 unsigned int numAnalogChannels = atoi(optarg); |
178 settings->numAnalogInChannels = numAnalogChannels; | |
179 settings->numAnalogOutChannels = numAnalogChannels; | |
180 if(numAnalogChannels >= 8) { | |
181 // TODO: a different number of channels for inputs and outputs is not yet supported | |
182 | |
174 // Use multiplexer capelet to run larger numbers of channels | 183 // Use multiplexer capelet to run larger numbers of channels |
175 if(settings->numAnalogChannels >= 64) | 184 if(settings->numAnalogInChannels >= 64) |
176 settings->numMuxChannels = 8; | 185 settings->numMuxChannels = 8; |
177 else if(settings->numAnalogChannels >= 32) | 186 else if(settings->numAnalogInChannels >= 32) |
178 settings->numMuxChannels = 4; | 187 settings->numMuxChannels = 4; |
179 else if(settings->numAnalogChannels >= 16) | 188 else if(settings->numAnalogInChannels >= 16) |
180 settings->numMuxChannels = 2; | 189 settings->numMuxChannels = 2; |
181 settings->numAnalogChannels = 8; | 190 settings->numAnalogInChannels = 8; |
182 } | 191 } |
183 else if(settings->numAnalogChannels >= 4) | 192 else if(numAnalogChannels >= 4){ |
184 settings->numAnalogChannels = 4; | 193 // TODO: a different number of channels for inputs and outputs is not yet supported |
185 else | 194 settings->numAnalogInChannels = 4; |
186 settings->numAnalogChannels = 2; | 195 settings->numAnalogOutChannels = 4; |
187 break; | 196 } |
197 else{ | |
198 // TODO: a different number of channels for inputs and outputs is not yet supported | |
199 settings->numAnalogInChannels = 2; | |
200 settings->numAnalogOutChannels = 2; | |
201 } | |
202 break; | |
203 } | |
188 case 'B': | 204 case 'B': |
189 settings->numDigitalChannels = atoi(optarg); | 205 settings->numDigitalChannels = atoi(optarg); |
190 if(settings->numDigitalChannels >= 16) | 206 if(settings->numDigitalChannels >= 16) |
191 settings->numDigitalChannels = 16; | 207 settings->numDigitalChannels = 16; |
192 else if (settings->numDigitalChannels < 1){ | 208 else if (settings->numDigitalChannels < 1){ |