diff core/RTAudio.cpp @ 373:3bed6b09223c prerelease

Updated NE10 library to the latest version; needs a corresponding update to the /usr/include/ne10 header files on the SD image. Updated examples to compile against new version, and reordered D-Box channels to account for new PRU-based DAC channel reordering.
author andrewm
date Thu, 09 Jun 2016 20:03:09 +0100
parents ff5f346a293e
children a0698d523a6a
line wrap: on
line diff
--- a/core/RTAudio.cpp	Thu Jun 09 18:16:05 2016 +0100
+++ b/core/RTAudio.cpp	Thu Jun 09 20:03:09 2016 +0100
@@ -152,12 +152,12 @@
 	}
 
 	// Limit the analog channels to sane values
-	if(settings->numAnalogChannels >= 8)
-		settings->numAnalogChannels = 8;
-	else if(settings->numAnalogChannels >= 4)
-		settings->numAnalogChannels = 4;
-	else
-		settings->numAnalogChannels = 2;
+	if(settings->numAnalogChannels != 2 
+		&& settings->numAnalogChannels != 4
+		&& settings->numAnalogChannels != 8) {
+			cout << "Invalid number of analog channels: " << settings->numAnalogChannels << ". Valid values are 2, 4, 8.\n";
+			return -1;
+	}
 
 	// Initialise the rendering environment: sample rates, frame counts, numbers of channels
 	gContext.audioSampleRate = 44100.0;