comparison projects/audio_in_FFT/main.cpp @ 52:a6d223473ea2 newapi

Updated examples for new API. tank_wars not yet updated; audio_in_FFT and oscillator_bank not working properly yet.
author andrewm
date Sun, 31 May 2015 02:13:39 -0500
parents 901d205d1a3c
children 3c3a1357657d
comparison
equal deleted inserted replaced
51:4f8db16f17b5 52:a6d223473ea2
8 #include <iostream> 8 #include <iostream>
9 #include <cstdlib> 9 #include <cstdlib>
10 #include <libgen.h> 10 #include <libgen.h>
11 #include <signal.h> 11 #include <signal.h>
12 #include <getopt.h> 12 #include <getopt.h>
13 #include "../../include/RTAudio.h" 13 #include "../../include/BeagleRT.h"
14 14
15 using namespace std; 15 using namespace std;
16 16
17 // Handle Ctrl-C by requesting that the audio rendering stop 17 // Handle Ctrl-C by requesting that the audio rendering stop
18 void interrupt_handler(int var) 18 void interrupt_handler(int var)
31 cerr << " --help [-h]: Print this menu\n"; 31 cerr << " --help [-h]: Print this menu\n";
32 } 32 }
33 33
34 int main(int argc, char *argv[]) 34 int main(int argc, char *argv[])
35 { 35 {
36 RTAudioSettings settings; // Standard audio settings 36 BeagleRTInitSettings settings; // Standard audio settings
37 int fftSize = 64; // Size of the FFT, in samples 37 int fftSize = 64; // Size of the FFT, in samples
38 38
39 struct option customOptions[] = 39 struct option customOptions[] =
40 { 40 {
41 {"help", 0, NULL, 'h'}, 41 {"help", 0, NULL, 'h'},
44 }; 44 };
45 45
46 // Set default settings 46 // Set default settings
47 BeagleRT_defaultSettings(&settings); 47 BeagleRT_defaultSettings(&settings);
48 48
49 settings.useMatrix = 0; // No matrix usage by default 49 settings.useAnalog = 0; // No matrix usage by default
50 50
51 // Parse command-line arguments 51 // Parse command-line arguments
52 while (1) { 52 while (1) {
53 int c; 53 int c;
54 if ((c = BeagleRT_getopt_long(argc, argv, "hs:", customOptions, &settings)) < 0) 54 if ((c = BeagleRT_getopt_long(argc, argv, "hs:", customOptions, &settings)) < 0)