fix drawing of zero-length notes
[ardour.git] / gtk2_ardour / idleometer.h
1 /*
2  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18
19 #ifndef __ardour_idle_o_meter_h__
20 #define __ardour_idle_o_meter_h__
21
22 #include <gtkmm/label.h>
23 #include "ardour_dialog.h"
24
25 class IdleOMeter : public ArdourDialog
26 {
27 public:
28         IdleOMeter ();
29         ~IdleOMeter ();
30
31 protected:
32         virtual void on_show ();
33         virtual void on_hide ();
34
35 private:
36         void reset ();
37         bool idle ();
38
39         Gtk::Label _label_cur;
40         Gtk::Label _label_min;
41         Gtk::Label _label_max;
42         Gtk::Label _label_avg;
43         Gtk::Label _label_dev;
44         Gtk::Label _label_acq;
45
46         int64_t _last_display;
47
48         int64_t _start;
49         int64_t _last;
50         int64_t _min;
51         int64_t _max;
52
53         int64_t _cnt;
54         double _total;
55         double _var_m, _var_s;
56         sigc::connection _idle_connection;
57 };
58 #endif
59