Skip to content

Commit

Permalink
Add command-line arg for FFT size
Browse files Browse the repository at this point in the history
  • Loading branch information
miek committed Jun 21, 2015
1 parent 789a57d commit 8b64973
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "inputsource.h"

#define FFT_SIZE 1024

class wxImagePanel : public wxScrolled<wxPanel>
{
private:
Expand Down Expand Up @@ -107,11 +105,18 @@ bool MyApp::OnInit()
if (argc < 2)
{
printf("Missing filename\n");
printf("Usage: %s <filename>\n", argv[0].mb_str().data());
printf("Usage: %s <filename> [fft size]\n", argv[0].mb_str().data());
return false;
}

InputSource *is = new InputSource(argv[1], FFT_SIZE);
int fft_size = 1024;
if (argc > 2) {
int size = atoi(argv[2]);
if (size > 0)
fft_size = size;
}

InputSource *is = new InputSource(argv[1], fft_size);

wxImagePanel *impanel = new wxImagePanel(frame, is);
sizer->Add(impanel, 1, wxALL | wxEXPAND, 0);
Expand Down

0 comments on commit 8b64973

Please sign in to comment.