diff core/RTAudioCommandLine.cpp @ 19:c98863e63174 matrix_gpio

Renamed matrixGpio to digital and matrix to analog
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 30 Apr 2015 16:58:41 +0100
parents 670be80463a3
children 182ae9367104
line wrap: on
line diff
--- a/core/RTAudioCommandLine.cpp	Thu Apr 30 16:02:47 2015 +0100
+++ b/core/RTAudioCommandLine.cpp	Thu Apr 30 16:58:41 2015 +0100
@@ -16,10 +16,10 @@
 {
 	{"period", 1, NULL, 'p'},
 	{"verbose", 0, NULL, 'v'},
-	{"use-matrix", 1, NULL, 'm'},
-	{"use-matrix-gpio", 1, NULL, 'g'},
-	{"matrix-channels", 1, NULL, 'C'},
-	{"matrix-gpio-channels", 1, NULL, 'G'},
+	{"use-analog", 1, NULL, 'm'},
+	{"use-analog-gpio", 1, NULL, 'g'},
+	{"analog-channels", 1, NULL, 'C'},
+	{"analog-gpio-channels", 1, NULL, 'G'},
 	{"mute-speaker", 1, NULL, 'M'},
 	{"dac-level", 1, NULL, 'D'},
 	{"adc-level", 1, NULL, 'A'},
@@ -39,10 +39,10 @@
 	settings->dacLevel = DEFAULT_DAC_LEVEL;
 	settings->adcLevel = DEFAULT_ADC_LEVEL;
 	settings->headphoneLevel = DEFAULT_HP_LEVEL;
-	settings->useMatrix = 1;
-	settings->useMatrixGpio = 1;
-	settings->numMatrixChannels = 8;
-	settings->numMatrixGpioChannels = 16;
+	settings->useAnalog = 1;
+	settings->useDigital = 1;
+	settings->numAnalogChannels = 8;
+	settings->numDigitalChannels = 16;
 	settings->verbose = 0;
 	settings->pruFilename[0]='\0';
 	settings->codecI2CAddress = CODEC_I2C_ADDRESS;
@@ -128,29 +128,29 @@
 			settings->verbose = 1;
 			break;
 		case 'm':
-			settings->useMatrix = atoi(optarg);
+			settings->useAnalog = atoi(optarg);
 			break;
 		case 'g':
-			settings->useMatrixGpio = atoi(optarg);
-			settings->numMatrixGpioChannels = 0;
+			settings->useDigital = atoi(optarg);
+			settings->numDigitalChannels = 0;
 			break;
 		case 'C':
-			settings->numMatrixChannels = atoi(optarg);
-			if(settings->numMatrixChannels >= 8)
-				settings->numMatrixChannels = 8;
-			else if(settings->numMatrixChannels >= 4)
-				settings->numMatrixChannels = 4;
+			settings->numAnalogChannels = atoi(optarg);
+			if(settings->numAnalogChannels >= 8)
+				settings->numAnalogChannels = 8;
+			else if(settings->numAnalogChannels >= 4)
+				settings->numAnalogChannels = 4;
 			else
-				settings->numMatrixChannels = 2;
+				settings->numAnalogChannels = 2;
 			break;
 		case 'G':
-			settings->numMatrixGpioChannels = atoi(optarg);
-			if(settings->numMatrixGpioChannels >= 16)
-				settings->numMatrixGpioChannels = 16;
-			else if (settings->numMatrixGpioChannels < 1){
-				settings->numMatrixGpioChannels = 0;
-				settings->useMatrixGpio = 0; //TODO: this actually works only if -G 0 is specified after -g 1.
-											 //No worries, though: disabling numMatrixGpio will only prevent the pins from being exported.
+			settings->numDigitalChannels = atoi(optarg);
+			if(settings->numDigitalChannels >= 16)
+				settings->numDigitalChannels = 16;
+			else if (settings->numDigitalChannels < 1){
+				settings->numDigitalChannels = 0;
+				settings->useDigital = 0; //TODO: this actually works only if -G 0 is specified after -g 1.
+											 //No worries, though: disabling numDigital will only prevent the pins from being exported.
 			}
 			break;
 		case 'M':
@@ -182,15 +182,15 @@
 // Call from within your own usage function
 void BeagleRT_usage()
 {
-	std::cerr << "   --period [-p] period:            Set the hardware period (buffer) size in matrix samples\n";
+	std::cerr << "   --period [-p] period:            Set the hardware period (buffer) size in analog samples\n";
 	std::cerr << "   --dac-level [-D] dBs:            Set the DAC output level (0dB max; -63.5dB min)\n";
 	std::cerr << "   --adc-level [-A] dBs:            Set the ADC input level (0dB max; -12dB min)\n";
 	std::cerr << "   --hp-level [-H] dBs:             Set the headphone output level (0dB max; -63.5dB min)\n";
 	std::cerr << "   --mute-speaker [-M] val:         Set whether to mute the speaker initially (default: no)\n";
-	std::cerr << "   --use-matrix [-m] val:           Set whether to use ADC/DAC matrix (default: yes)\n";
-	std::cerr << "   --use-gpio-matrix [-g] val:      Set whether to use GPIO matrix (default: yes)\n";
-	std::cerr << "   --matrix-channels [-C] val:      Set the number of ADC/DAC channels (default: 8)\n";
-	std::cerr << "   --matrix-gpio-channels [-G] val: Set the number of GPIO channels (default: 16)\n";
+	std::cerr << "   --use-analog [-m] val:           Set whether to use ADC/DAC analog (default: yes)\n";
+	std::cerr << "   --use-gpio-analog [-g] val:      Set whether to use GPIO analog (default: yes)\n";
+	std::cerr << "   --analog-channels [-C] val:      Set the number of ADC/DAC channels (default: 8)\n";
+	std::cerr << "   --analog-gpio-channels [-G] val: Set the number of GPIO channels (default: 16)\n";
 	std::cerr << "   --pru-file [-P] val:             Set an optional external file to use for the PRU binary code\n";
 	std::cerr << "   --verbose [-v]:                  Enable verbose logging information\n";
 }