comparison core/RTAudioCommandLine.cpp @ 301:e4392164b458 prerelease

RENAMED BeagleRT to Bela AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, scripts probably not working
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 27 May 2016 14:34:41 +0100
parents c55c6f6c233c
children bfcbeb437869
comparison
equal deleted inserted replaced
300:dbeed520b014 301:e4392164b458
7 7
8 #include <iostream> 8 #include <iostream>
9 #include <cstdlib> 9 #include <cstdlib>
10 #include <cstring> 10 #include <cstring>
11 #include <getopt.h> 11 #include <getopt.h>
12 #include "../include/BeagleRT.h" 12 #include "../include/Bela.h"
13 13
14 #define OPT_PRU_FILE 1000 14 #define OPT_PRU_FILE 1000
15 #define OPT_PGA_GAIN_LEFT 1001 15 #define OPT_PGA_GAIN_LEFT 1001
16 #define OPT_PGA_GAIN_RIGHT 1002 16 #define OPT_PGA_GAIN_RIGHT 1002
17 #define OPT_PRU_NUMBER 1003 17 #define OPT_PRU_NUMBER 1003
44 {NULL, 0, NULL, 0} 44 {NULL, 0, NULL, 0}
45 }; 45 };
46 46
47 const char gDefaultShortOptions[] = "p:vN:M:C:D:A:H:G:B:R:T:S:"; 47 const char gDefaultShortOptions[] = "p:vN:M:C:D:A:H:G:B:R:T:S:";
48 48
49 // This function sets the default settings for the BeagleRTInitSettings structure 49 // This function sets the default settings for the BelaInitSettings structure
50 void BeagleRT_defaultSettings(BeagleRTInitSettings *settings) 50 void Bela_defaultSettings(BelaInitSettings *settings)
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;
85 // and handles the initialisation of the RTAudio settings using 85 // and handles the initialisation of the RTAudio settings using
86 // standard command-line arguments. System default arguments will 86 // standard command-line arguments. System default arguments will
87 // be stored in settings, otherwise arguments will be returned 87 // be stored in settings, otherwise arguments will be returned
88 // as getopt() normally does. 88 // as getopt() normally does.
89 89
90 int BeagleRT_getopt_long(int argc, char *argv[], const char *customShortOptions, const struct option *customLongOptions, BeagleRTInitSettings *settings) 90 int Bela_getopt_long(int argc, char *argv[], const char *customShortOptions, const struct option *customLongOptions, BelaInitSettings *settings)
91 { 91 {
92 static int firstRun = 1; 92 static int firstRun = 1;
93 static char totalShortOptions[256]; 93 static char totalShortOptions[256];
94 static struct option totalLongOptions[256]; 94 static struct option totalLongOptions[256];
95 95
242 } 242 }
243 } 243 }
244 244
245 // This function prints standard usage information for default arguments 245 // This function prints standard usage information for default arguments
246 // Call from within your own usage function 246 // Call from within your own usage function
247 void BeagleRT_usage() 247 void Bela_usage()
248 { 248 {
249 std::cerr << " --period [-p] period: Set the hardware period (buffer) size in analog samples\n"; 249 std::cerr << " --period [-p] period: Set the hardware period (buffer) size in analog samples\n";
250 std::cerr << " --dac-level [-D] dBs: Set the DAC output level (0dB max; -63.5dB min)\n"; 250 std::cerr << " --dac-level [-D] dBs: Set the DAC output level (0dB max; -63.5dB min)\n";
251 std::cerr << " --adc-level [-A] dBs: Set the ADC input level (0dB max; -12dB min)\n"; 251 std::cerr << " --adc-level [-A] dBs: Set the ADC input level (0dB max; -12dB min)\n";
252 std::cerr << " --pga-gain-left dBs: Set the Programmable Gain Amplifier for the left audio channel (0dBmin; 59.5dB max; default: 16dB)\n"; 252 std::cerr << " --pga-gain-left dBs: Set the Programmable Gain Amplifier for the left audio channel (0dBmin; 59.5dB max; default: 16dB)\n";