From dacb8d820d721dbc18a441c69ee6c399951dc77e Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 26 Jun 2022 12:49:50 -0700 Subject: [PATCH] Cleanup --- src/test.cpp | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/test.cpp b/src/test.cpp index 24a38c9..b9dbfe8 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -44,7 +44,25 @@ const size_t height = 150; int main(int argc, char *argv[]) { - uint8_t hid_buf[20]; + // buffer size for waveform: + // (44100 / fps * 10), make 10 bigger for slower scrolling + // + // Double both buffer sizes if stereo + + // FFT generator + FFT_Visualizer fft = FFT_Visualizer( + width, height, + 100, 10000 + ); + + // Audio buffer + Buffer buf = Buffer( + "/tmp/mpd.fifo", + 44100 / 2, // Keep 500ms of data in buffer + fft.compute_buffer_output_size() + ); + + // HID interface wrapper Ergodox Dox = Ergodox::init( 0x3297, 0x4976, @@ -52,22 +70,8 @@ int main(int argc, char *argv[]) { 0xFF60 ); - // buffer size for waveform: - // (44100 / fps * 10), make 10 bigger for slower scrolling - // - // Double both buffer sizes if stereo - - FFT_Visualizer fft = FFT_Visualizer( - width, height, - 100, 10000 - ); - - Buffer buf = Buffer( - "/tmp/mpd.fifo", - //"/home/mark/Workbench/sospi/pulse.fifo", - 44100 / 2, // Keep 500ms of data in buffer - fft.compute_buffer_output_size() - ); + // Data buffer + uint8_t hid_buf[12]; while (1) { @@ -85,5 +89,6 @@ int main(int argc, char *argv[]) { Dox.write(hid_buf, 12); } + return 0; } \ No newline at end of file