comparison core/RTAudio.cpp @ 172:5f4408705eed

Cleanup
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 28 Dec 2015 04:00:12 +0100
parents e63563507edd
children 1e629f126322
comparison
equal deleted inserted replaced
171:e63563507edd 172:5f4408705eed
208 } 208 }
209 if(gAudioCodec->initCodec()) { 209 if(gAudioCodec->initCodec()) {
210 cout << "Error: unable to initialise audio codec\n"; 210 cout << "Error: unable to initialise audio codec\n";
211 return 1; 211 return 1;
212 } 212 }
213 cout << "Initialized codec\n"; 213
214 // Set default volume levels 214 // Set default volume levels
215 BeagleRT_setDACLevel(settings->dacLevel); 215 BeagleRT_setDACLevel(settings->dacLevel);
216 BeagleRT_setADCLevel(settings->adcLevel); 216 BeagleRT_setADCLevel(settings->adcLevel);
217 for(int n = 0; n < 2; n++){ 217 for(int n = 0; n < 2; n++){
218 if(settings->pgaGain[n] > 59.5){
219 std::cerr << "PGA gain out of range [0,59.5]\n";
220 exit(1);
221 }
218 BeagleRT_setPgaGain(settings->pgaGain[n], n); 222 BeagleRT_setPgaGain(settings->pgaGain[n], n);
219 } 223 }
220 BeagleRT_setHeadphoneLevel(settings->headphoneLevel); 224 BeagleRT_setHeadphoneLevel(settings->headphoneLevel);
221 225
222 // Call the user-defined initialisation function 226 // Call the user-defined initialisation function
458 // Set the level of the Programmable Gain Amplifier 462 // Set the level of the Programmable Gain Amplifier
459 // 59.5dB is maximum, 0dB is minimum; 0.5dB steps 463 // 59.5dB is maximum, 0dB is minimum; 0.5dB steps
460 int BeagleRT_setPgaGain(float decibels, int channel){ 464 int BeagleRT_setPgaGain(float decibels, int channel){
461 if(gAudioCodec == 0) 465 if(gAudioCodec == 0)
462 return -1; 466 return -1;
463 printf("calling\n");
464 return gAudioCodec->setPga(decibels, channel); 467 return gAudioCodec->setPga(decibels, channel);
465 } 468 }
466 469
467 // Set the level of the onboard headphone amplifier; affects headphone 470 // Set the level of the onboard headphone amplifier; affects headphone
468 // output only (not line out or speaker) 471 // output only (not line out or speaker)