2015-08-09 23:00:51 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GLPanel.h"
|
2015-10-27 12:18:26 -04:00
|
|
|
#include <atomic>
|
2015-08-09 23:00:51 -04:00
|
|
|
|
|
|
|
class WaterfallPanel : public GLPanel {
|
|
|
|
public:
|
|
|
|
WaterfallPanel();
|
|
|
|
void setup(int fft_size_in, int num_waterfall_lines_in);
|
|
|
|
void refreshTheme();
|
|
|
|
void setPoints(std::vector<float> &points);
|
|
|
|
void step();
|
2015-10-18 13:44:31 -04:00
|
|
|
void update();
|
|
|
|
|
2015-08-10 00:33:31 -04:00
|
|
|
protected:
|
|
|
|
void drawPanelContents();
|
|
|
|
|
2015-08-09 23:00:51 -04:00
|
|
|
private:
|
2015-08-10 18:45:46 -04:00
|
|
|
std::vector<float> points;
|
|
|
|
|
2015-08-09 23:00:51 -04:00
|
|
|
GLuint waterfall[2];
|
|
|
|
int waterfall_ofs[2];
|
|
|
|
int fft_size;
|
|
|
|
int waterfall_lines;
|
|
|
|
unsigned char *waterfall_slice;
|
2015-10-18 13:44:31 -04:00
|
|
|
std::vector<unsigned char> lineBuffer[2];
|
|
|
|
std::vector<unsigned char> rLineBuffer[2];
|
2015-10-22 18:21:47 -04:00
|
|
|
std::atomic_int lines_buffered;
|
|
|
|
std::atomic_bool texInitialized, bufferInitialized;
|
2015-08-09 23:00:51 -04:00
|
|
|
|
|
|
|
ColorTheme *activeTheme;
|
2015-08-10 18:45:46 -04:00
|
|
|
};
|