2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "ardour_ui.h"
20 #include "disk_io_indicator.h"
22 #include "ardour/audioengine.h"
28 DiskIoIndicator::DiskIoIndicator ()
29 : ArdourGauge ("00.0%")
35 DiskIoIndicator::set_disk_io (const double load)
37 if (load == _disk_io) {
43 snprintf (buf, sizeof (buf), "Dsk: %.1f%%", _disk_io);
44 update (std::string (buf));
48 DiskIoIndicator::level () const {
49 return (_disk_io / 100.f);
53 DiskIoIndicator::alert () const
59 DiskIoIndicator::indicator () const
62 return ArdourGauge::Level_CRIT;
63 } else if (_disk_io < 75) {
64 return ArdourGauge::Level_WARN;
66 return ArdourGauge::Level_OK;
71 DiskIoIndicator::tooltip_text ()
75 snprintf (buf, sizeof (buf), _("Disk I/O cache: %.1f"), _disk_io);