LMMS
Loading...
Searching...
No Matches
CPULoadWidget.h
Go to the documentation of this file.
1/*
2 * CPULoadWidget.h - widget for displaying CPU-load (partly based on
3 * Hydrogen's CPU-load-widget)
4 *
5 * Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 *
7 * This file is part of LMMS - https://lmms.io
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program (see COPYING); if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA.
23 *
24 */
25
26#ifndef LMMS_GUI_CPU_LOAD_WIDGET_H
27#define LMMS_GUI_CPU_LOAD_WIDGET_H
28
29#include <algorithm>
30#include <QTimer>
31#include <QPixmap>
32#include <QWidget>
33
34#include "LmmsTypes.h"
35
36
37namespace lmms::gui
38{
39
40
41class CPULoadWidget : public QWidget
42{
43 Q_OBJECT
44 Q_PROPERTY(int stepSize MEMBER m_stepSize)
45public:
46 CPULoadWidget( QWidget * _parent );
47 ~CPULoadWidget() override = default;
48
49
50protected:
51 void paintEvent( QPaintEvent * _ev ) override;
52
53
54protected slots:
55 void updateCpuLoad();
56
57
58private:
59 int stepSize() const { return std::max(1, m_stepSize); }
60
62
63 QPixmap m_temp;
64 QPixmap m_background;
65 QPixmap m_leds;
66
68
70
71 int m_stepSize = 1;
72
73} ;
74
75
76} // namespace lmms::gui
77
78#endif // LMMS_GUI_CPU_LOAD_WIDGET_H
void updateCpuLoad()
Definition CPULoadWidget.cpp:91
int m_currentLoad
Definition CPULoadWidget.h:61
QTimer m_updateTimer
Definition CPULoadWidget.h:69
int m_stepSize
Definition CPULoadWidget.h:71
~CPULoadWidget() override=default
QPixmap m_leds
Definition CPULoadWidget.h:65
void paintEvent(QPaintEvent *_ev) override
Definition CPULoadWidget.cpp:65
bool m_changed
Definition CPULoadWidget.h:67
QPixmap m_background
Definition CPULoadWidget.h:64
int stepSize
Definition CPULoadWidget.h:44
int stepSize() const
Definition CPULoadWidget.h:59
QPixmap m_temp
Definition CPULoadWidget.h:63
CPULoadWidget(QWidget *_parent)
Definition CPULoadWidget.cpp:40
Definition AudioPortAudio.cpp:223