Fix DSP load sorting with inactive plugins
[ardour.git] / gtk2_ardour / led.h
1 /*
2  * Copyright (C) 2010-2011 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2011 David Robillard <d@drobilla.net>
4  * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef __gtk2_ardour_led_h__
22 #define __gtk2_ardour_led_h__
23
24 #include <stdint.h>
25
26 #include "gtkmm2ext/cairo_widget.h"
27
28 class LED : public CairoWidget
29 {
30 public:
31         LED ();
32         virtual ~LED ();
33
34         void set_diameter (float);
35
36 protected:
37         void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
38         void on_size_request (Gtk::Requisition* req);
39         void on_realize ();
40
41 private:
42         float _diameter;
43         float _red;
44         float _green;
45         float _blue;
46         bool  _fixed_diameter;
47
48         void set_colors_from_style ();
49 };
50
51 #endif /* __gtk2_ardour_led_h__ */