diff 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
line wrap: on
line diff
--- a/core/RTAudioCommandLine.cpp	Thu Jun 23 18:17:35 2016 +0100
+++ b/core/RTAudioCommandLine.cpp	Fri Jun 24 01:36:07 2016 +0100
@@ -53,7 +53,11 @@
 	settings->periodSize = 16;
 	settings->useAnalog = 1;
 	settings->useDigital = 1;
-	settings->numAnalogChannels = 8;
+	settings->numAudioInChannels = 2;
+	settings->numAudioOutChannels = 2;
+
+	settings->numAnalogInChannels = 8;
+	settings->numAnalogOutChannels = 8;
 	settings->numDigitalChannels = 16;
 
 	settings->beginMuted = 0;
@@ -168,23 +172,35 @@
 				settings->numDigitalChannels = 0;
 			}
 			break;
-		case 'C':
-			settings->numAnalogChannels = atoi(optarg);
-			if(settings->numAnalogChannels >= 8) {
+		case 'C': {
+			// TODO: a different number of channels for inputs and outputs is not yet supported
+			unsigned int numAnalogChannels = atoi(optarg);
+			settings->numAnalogInChannels = numAnalogChannels;
+			settings->numAnalogOutChannels = numAnalogChannels;
+			if(numAnalogChannels >= 8) {
+				// TODO: a different number of channels for inputs and outputs is not yet supported
+
 				// Use multiplexer capelet to run larger numbers of channels
-				if(settings->numAnalogChannels >= 64)
+				if(settings->numAnalogInChannels >= 64)
 					settings->numMuxChannels = 8;
-				else if(settings->numAnalogChannels >= 32)
+				else if(settings->numAnalogInChannels >= 32)
 					settings->numMuxChannels = 4;
-				else if(settings->numAnalogChannels >= 16)
+				else if(settings->numAnalogInChannels >= 16)
 					settings->numMuxChannels = 2;
-				settings->numAnalogChannels = 8;
+				settings->numAnalogInChannels = 8;
 			}
-			else if(settings->numAnalogChannels >= 4)
-				settings->numAnalogChannels = 4;
-			else
-				settings->numAnalogChannels = 2;
+			else if(numAnalogChannels >= 4){
+				// TODO: a different number of channels for inputs and outputs is not yet supported
+				settings->numAnalogInChannels = 4;
+				settings->numAnalogOutChannels = 4;
+			}
+			else{
+				// TODO: a different number of channels for inputs and outputs is not yet supported
+				settings->numAnalogInChannels = 2;
+				settings->numAnalogOutChannels = 2;
+			}
 			break;
+		}
 		case 'B':
 			settings->numDigitalChannels = atoi(optarg);
 			if(settings->numDigitalChannels >= 16)