Separate DSP load indicator into generic gauge widget

This commit is contained in:
Robin Gareus 2018-01-14 17:38:49 +01:00
parent ef1301759d
commit b0c5005cec
5 changed files with 225 additions and 100 deletions

View file

@ -21,25 +21,25 @@
#include <pangomm.h>
#include "gtkmm2ext/cairo_widget.h"
#include "ardour_gauge.h"
class DspLoadIndicator : public CairoWidget
class DspLoadIndicator : public ArdourGauge
{
public:
public:
DspLoadIndicator ();
~DspLoadIndicator ();
void set_xrun_count (const unsigned int xruns);
void set_dsp_load (const double load);
protected:
bool alert () const;
ArdourGauge::Status indicator () const;
float level () const;
std::string tooltip_text ();
private:
void on_size_request (Gtk::Requisition*);
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
bool on_button_release_event (GdkEventButton*);
void update_tooltip ();
Glib::RefPtr<Pango::Layout> _layout;
float _dsp_load;
unsigned int _xrun_count;
};