-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (40 loc) · 1.22 KB
/
main.cpp
File metadata and controls
45 lines (40 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (C) 2019 - 2026 Judd Niemann - All Rights Reserved.
* You may use, distribute and modify this code under the
* terms of the GNU Lesser General Public License, version 2.1
*
* You should have received a copy of GNU Lesser General Public License v2.1
* with this file. If not, please refer to: https://github.com/jniemann66/ReSampler
*/
#include "parameters.h"
#include "renderer.h"
#include "spectrogram.h"
#include "spectrum.h"
#include "tests.h"
#include "window.h"
#include <sndfile.hh>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
int main(int argc, char** argv)
{
Sndspec::Parameters parameters;
std::string msg(parameters.fromArgs({argv + 1, argv + argc}));
if (!msg.empty()) {
std::cout << msg << std::endl;
exit(0);
}
if (parameters.getPlotWindowFunction()) {
if (parameters.getWindowFunction().compare("all") == 0) {
Sndspec::Spectrum::plotAllWindows(parameters.plotTimeDomain(), parameters.hasWhiteBackground());
} else {
Sndspec::Spectrum::makeWindowFunctionPlot(parameters);
}
} else if (parameters.getSpectrumMode()) {
Sndspec::Spectrum::makeSpectrumFromFile(parameters);
} else {
Sndspec::Spectrogram::makeSpectrogramFromFile(parameters);
}
return 0;
}