2017-01-02 21:07:43 -05:00
|
|
|
// Copyright (c) Charles J. Cliffe
|
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
|
2015-08-09 23:00:51 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GLPanel.h"
|
|
|
|
|
|
|
|
class SpectrumPanel : public GLPanel {
|
2015-08-10 00:33:31 -04:00
|
|
|
public:
|
|
|
|
SpectrumPanel();
|
2015-08-09 23:00:51 -04:00
|
|
|
|
2021-04-04 22:17:30 -04:00
|
|
|
void setPoints(std::vector<float> &points_in);
|
|
|
|
void setPeakPoints(std::vector<float> &points_in);
|
2015-08-10 00:33:31 -04:00
|
|
|
|
2021-04-04 22:17:30 -04:00
|
|
|
float getFloorValue() const;
|
|
|
|
void setFloorValue(float floorValue_in);
|
2015-08-10 00:33:31 -04:00
|
|
|
|
2021-04-04 22:17:30 -04:00
|
|
|
float getCeilValue() const;
|
|
|
|
void setCeilValue(float ceilValue_in);
|
2015-08-10 00:33:31 -04:00
|
|
|
|
2021-04-04 22:17:30 -04:00
|
|
|
void setFreq(long long freq_in);
|
|
|
|
long long getFreq() const;
|
2015-08-10 00:33:31 -04:00
|
|
|
|
2021-04-04 22:17:30 -04:00
|
|
|
void setBandwidth(long long bandwidth_in);
|
|
|
|
long long getBandwidth() const;
|
2015-08-24 01:31:37 -04:00
|
|
|
|
|
|
|
void setFFTSize(int fftSize_in);
|
2021-04-04 22:17:30 -04:00
|
|
|
int getFFTSize() const;
|
2015-08-24 01:31:37 -04:00
|
|
|
|
2021-04-04 22:17:30 -04:00
|
|
|
void setShowDb(bool showDb_in);
|
|
|
|
bool getShowDb() const;
|
2016-10-20 21:44:33 -04:00
|
|
|
|
|
|
|
void setUseDBOffset(bool useOfs);
|
2021-04-04 22:17:30 -04:00
|
|
|
bool getUseDBOffset() const;
|
2016-10-20 21:44:33 -04:00
|
|
|
|
2015-08-10 00:33:31 -04:00
|
|
|
protected:
|
2021-04-04 22:17:30 -04:00
|
|
|
void drawPanelContents() override;
|
2015-08-10 00:33:31 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
float floorValue, ceilValue;
|
2015-08-24 01:31:37 -04:00
|
|
|
int fftSize;
|
2015-08-10 00:33:31 -04:00
|
|
|
long long freq;
|
|
|
|
long long bandwidth;
|
|
|
|
std::vector<float> points;
|
2015-12-31 20:44:39 -05:00
|
|
|
std::vector<float> peak_points;
|
2015-08-17 21:52:38 -04:00
|
|
|
|
|
|
|
GLTextPanel dbPanelCeil;
|
|
|
|
GLTextPanel dbPanelFloor;
|
2016-10-20 21:44:33 -04:00
|
|
|
bool showDb, useDbOfs;
|
|
|
|
};
|