lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
LcdFloatSpinBox.h
Go to the documentation of this file.
1
/*
2
* LcdFloatSpinBox.h - class LcdFloatSpinBox (LcdSpinBox for floats)
3
*
4
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
* Copyright (c) 2020 Martin Pavelek <he29.HS/at/gmail.com>
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_LCD_FLOATSPINBOX_H
27
#define LMMS_GUI_LCD_FLOATSPINBOX_H
28
29
#include <QString>
30
31
#include "
LcdWidget.h
"
32
#include "
AutomatableModelView.h
"
33
34
namespace
lmms::gui
35
{
36
37
38
class
LMMS_EXPORT
LcdFloatSpinBox
:
public
QWidget,
public
FloatModelView
39
{
40
Q_OBJECT
41
public
:
42
LcdFloatSpinBox
(
int
numWhole,
int
numFrac,
const
QString& name = QString(), QWidget* parent =
nullptr
);
43
LcdFloatSpinBox
(
int
numWhole,
int
numFrac,
const
QString& style,
const
QString& name, QWidget* parent =
nullptr
);
44
45
void
modelChanged
()
override
46
{
47
ModelView::modelChanged
();
48
update
();
49
}
50
51
void
setLabel
(
const
QString &label) {
m_label
= label; }
52
53
void
setSeamless
(
bool
left,
bool
right)
54
{
55
m_wholeDisplay
.setSeamless(left,
true
);
56
m_fractionDisplay
.setSeamless(
true
, right);
57
}
58
59
public
slots:
60
virtual
void
update();
61
62
protected
:
63
void
contextMenuEvent(QContextMenuEvent *me)
override
;
64
void
mousePressEvent(QMouseEvent *me)
override
;
65
void
mouseMoveEvent(QMouseEvent *me)
override
;
66
void
mouseReleaseEvent(QMouseEvent *me)
override
;
67
void
wheelEvent(QWheelEvent *we)
override
;
68
void
mouseDoubleClickEvent(QMouseEvent *me)
override
;
69
void
paintEvent(QPaintEvent *pe)
override
;
70
71
private
:
72
void
layoutSetup(
const
QString &style = QString(
"19green"
));
73
void
enterValue();
74
float
getStep()
const
;
75
76
LcdWidget
m_wholeDisplay
;
77
LcdWidget
m_fractionDisplay
;
78
bool
m_mouseMoving
;
79
bool
m_intStep
;
80
QPoint
m_origMousePos
;
81
int
m_displayOffset
;
82
QString
m_label
;
83
84
signals:
85
void
manualChange
();
86
87
};
88
89
using
LcdFloatSpinBoxModel
=
FloatModel
;
90
91
}
// namespace lmms::gui
92
93
#endif
// LMMS_GUI_LCD_FLOATSPINBOX_H
AutomatableModelView.h
LcdWidget.h
lmms::FloatModel
Definition
AutomatableModel.h:468
lmms::gui::LcdFloatSpinBox::m_mouseMoving
bool m_mouseMoving
Definition
LcdFloatSpinBox.h:78
lmms::gui::LcdFloatSpinBox::update
virtual void update()
Definition
LcdFloatSpinBox.cpp:112
lmms::gui::LcdFloatSpinBox::m_wholeDisplay
LcdWidget m_wholeDisplay
Definition
LcdFloatSpinBox.h:76
lmms::gui::LcdFloatSpinBox::LcdFloatSpinBox
LcdFloatSpinBox(int numWhole, int numFrac, const QString &name=QString(), QWidget *parent=nullptr)
Definition
LcdFloatSpinBox.cpp:53
lmms::gui::LcdFloatSpinBox::manualChange
void manualChange()
lmms::gui::LcdFloatSpinBox::m_displayOffset
int m_displayOffset
Definition
LcdFloatSpinBox.h:81
lmms::gui::LcdFloatSpinBox::m_fractionDisplay
LcdWidget m_fractionDisplay
Definition
LcdFloatSpinBox.h:77
lmms::gui::LcdFloatSpinBox::m_intStep
bool m_intStep
Definition
LcdFloatSpinBox.h:79
lmms::gui::LcdFloatSpinBox::m_origMousePos
QPoint m_origMousePos
Definition
LcdFloatSpinBox.h:80
lmms::gui::LcdFloatSpinBox::m_label
QString m_label
Definition
LcdFloatSpinBox.h:82
lmms::gui::LcdFloatSpinBox::setSeamless
void setSeamless(bool left, bool right)
Definition
LcdFloatSpinBox.h:53
lmms::gui::LcdFloatSpinBox::setLabel
void setLabel(const QString &label)
Definition
LcdFloatSpinBox.h:51
lmms::gui::LcdFloatSpinBox::modelChanged
void modelChanged() override
Definition
LcdFloatSpinBox.h:45
lmms::gui::LcdWidget
Definition
LcdWidget.h:37
lmms::gui::ModelView::modelChanged
virtual void modelChanged()
Definition
ModelView.h:68
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms::gui::LcdFloatSpinBoxModel
FloatModel LcdFloatSpinBoxModel
Definition
LcdFloatSpinBox.h:89
lmms::gui::FloatModelView
TypedModelView< FloatModel > FloatModelView
Definition
AutomatableModelView.h:131
Generated on
for lmms by
1.18.0