CubicSDR/src/panel/MeterPanel.h

41 lines
1.1 KiB
C
Raw Normal View History

// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
2016-07-03 20:59:49 -04:00
#pragma once
#include "GLPanel.h"
class MeterPanel : public GLPanel {
public:
MeterPanel(const std::string& name, float low, float high, float current);
~MeterPanel() override;
2016-07-06 23:16:25 -04:00
void setName(std::string name_in);
2016-07-07 22:37:57 -04:00
std::string getName();
void setRange(float low_in, float high_in);
float getLow() const;
float getHigh() const;
2016-07-06 23:16:25 -04:00
void setValue(float value);
void setHighlight(float value);
2016-07-07 22:37:57 -04:00
void setHighlightVisible(bool vis);
float getValue() const;
2016-07-06 23:16:25 -04:00
bool isMeterHit(CubicVR::vec2 mousePoint);
float getMeterHitValue(CubicVR::vec2 mousePoint);
void setChanged(bool changed_in);
bool getChanged() const;
2016-07-03 20:59:49 -04:00
protected:
void drawPanelContents() override;
2016-07-06 23:16:25 -04:00
void setValueLabel(std::string label);
void setPanelLevel(float setValue, GLPanel &panel) const;
2016-07-03 20:59:49 -04:00
private:
std::string name;
float low, high, current;
2017-11-19 19:33:18 -05:00
bool changed = false;
2016-07-03 20:59:49 -04:00
GLPanel bgPanel;
GLPanel levelPanel;
GLPanel highlightPanel;
GLTextPanel labelPanel;
GLTextPanel valuePanel;
};