LMMS
Loading...
Searching...
No Matches
include
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
37
namespace
lmms::gui
38
{
39
40
41
class
CPULoadWidget
:
public
QWidget
42
{
43
Q_OBJECT
44
Q_PROPERTY(
int
stepSize
MEMBER
m_stepSize
)
45
public
:
46
CPULoadWidget
( QWidget * _parent );
47
~CPULoadWidget
()
override
=
default
;
48
49
50
protected
:
51
void
paintEvent
( QPaintEvent * _ev )
override
;
52
53
54
protected
slots:
55
void
updateCpuLoad
();
56
57
58
private
:
59
int
stepSize
()
const
{
return
std::max(1,
m_stepSize
); }
60
61
int
m_currentLoad
;
62
63
QPixmap
m_temp
;
64
QPixmap
m_background
;
65
QPixmap
m_leds
;
66
67
bool
m_changed
;
68
69
QTimer
m_updateTimer
;
70
71
int
m_stepSize
= 1;
72
73
} ;
74
75
76
}
// namespace lmms::gui
77
78
#endif
// LMMS_GUI_CPU_LOAD_WIDGET_H
LmmsTypes.h
lmms::gui::CPULoadWidget::updateCpuLoad
void updateCpuLoad()
Definition
CPULoadWidget.cpp:91
lmms::gui::CPULoadWidget::m_currentLoad
int m_currentLoad
Definition
CPULoadWidget.h:61
lmms::gui::CPULoadWidget::m_updateTimer
QTimer m_updateTimer
Definition
CPULoadWidget.h:69
lmms::gui::CPULoadWidget::m_stepSize
int m_stepSize
Definition
CPULoadWidget.h:71
lmms::gui::CPULoadWidget::~CPULoadWidget
~CPULoadWidget() override=default
lmms::gui::CPULoadWidget::m_leds
QPixmap m_leds
Definition
CPULoadWidget.h:65
lmms::gui::CPULoadWidget::paintEvent
void paintEvent(QPaintEvent *_ev) override
Definition
CPULoadWidget.cpp:65
lmms::gui::CPULoadWidget::m_changed
bool m_changed
Definition
CPULoadWidget.h:67
lmms::gui::CPULoadWidget::m_background
QPixmap m_background
Definition
CPULoadWidget.h:64
lmms::gui::CPULoadWidget::stepSize
int stepSize
Definition
CPULoadWidget.h:44
lmms::gui::CPULoadWidget::stepSize
int stepSize() const
Definition
CPULoadWidget.h:59
lmms::gui::CPULoadWidget::m_temp
QPixmap m_temp
Definition
CPULoadWidget.h:63
lmms::gui::CPULoadWidget::CPULoadWidget
CPULoadWidget(QWidget *_parent)
Definition
CPULoadWidget.cpp:40
lmms::gui
Definition
AudioPortAudio.cpp:223
Generated on
for LMMS by
1.16.1