lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
AutomatableButton.h
Go to the documentation of this file.
1
/*
2
* AutomatableButton.h - class AutomatableButton, the base for all buttons
3
*
4
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
*
6
* This file is part of LMMS - https://lmms.io
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public
19
* License along with this program (see COPYING); if not, write to the
20
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301 USA.
22
*
23
*/
24
25
#ifndef LMMS_GUI_AUTOMATABLE_BUTTON_H
26
#define LMMS_GUI_AUTOMATABLE_BUTTON_H
27
28
#include <QPushButton>
29
30
#include "
AutomatableModelView.h
"
31
32
namespace
lmms::gui
33
{
34
35
class
AutomatableButtonGroup
;
36
37
38
class
LMMS_EXPORT
AutomatableButton
:
public
QPushButton,
public
BoolModelView
39
{
40
Q_OBJECT
41
public
:
42
AutomatableButton
( QWidget * _parent,
const
QString & _name
43
= QString() );
44
~AutomatableButton
()
override
;
45
46
inline
void
setCheckable
(
bool
_on )
47
{
48
QPushButton::setCheckable( _on );
49
model
()->setJournalling( _on );
50
}
51
52
void
modelChanged()
override
;
53
54
55
public
slots:
56
virtual
void
update();
57
virtual
void
toggle();
58
virtual
void
setChecked
(
bool
_on )
59
{
60
// QPushButton::setChecked is called in update-slot
61
model
()->setValue( _on );
62
}
63
64
65
protected
:
66
void
contextMenuEvent( QContextMenuEvent * _me )
override
;
67
void
mousePressEvent( QMouseEvent * _me )
override
;
68
void
mouseReleaseEvent( QMouseEvent * _me )
override
;
69
70
71
private
:
72
AutomatableButtonGroup
*
m_group
;
73
74
75
friend
class
AutomatableButtonGroup
;
76
77
using
QPushButton::setChecked;
78
using
QPushButton::isChecked;
79
} ;
80
81
82
83
class
LMMS_EXPORT
AutomatableButtonGroup
:
public
QWidget,
public
IntModelView
84
{
85
Q_OBJECT
86
public
:
87
AutomatableButtonGroup
( QWidget * _parent,
const
QString & _name
88
= QString() );
89
~AutomatableButtonGroup
()
override
;
90
91
void
addButton
(
AutomatableButton
* _btn );
92
void
removeButton
(
AutomatableButton
* _btn );
93
94
void
activateButton
(
AutomatableButton
* _btn );
95
96
void
modelChanged
()
override
;
97
98
99
private
slots:
100
void
updateButtons
();
101
102
103
private
:
104
QList<AutomatableButton *>
m_buttons
;
105
106
} ;
107
108
109
}
// namespace lmms::gui
110
111
#endif
// LMMS_GUI_AUTOMATABLE_BUTTON_H
AutomatableModelView.h
lmms::gui::AutomatableButtonGroup
Definition
AutomatableButton.h:84
lmms::gui::AutomatableButtonGroup::updateButtons
void updateButtons()
Definition
AutomatableButton.cpp:266
lmms::gui::AutomatableButtonGroup::m_buttons
QList< AutomatableButton * > m_buttons
Definition
AutomatableButton.h:104
lmms::gui::AutomatableButtonGroup::modelChanged
void modelChanged() override
Definition
AutomatableButton.cpp:255
lmms::gui::AutomatableButtonGroup::addButton
void addButton(AutomatableButton *_btn)
Definition
AutomatableButton.cpp:213
lmms::gui::AutomatableButtonGroup::activateButton
void activateButton(AutomatableButton *_btn)
Definition
AutomatableButton.cpp:239
lmms::gui::AutomatableButtonGroup::removeButton
void removeButton(AutomatableButton *_btn)
Definition
AutomatableButton.cpp:230
lmms::gui::AutomatableButtonGroup::AutomatableButtonGroup
AutomatableButtonGroup(QWidget *_parent, const QString &_name=QString())
Definition
AutomatableButton.cpp:190
lmms::gui::AutomatableButton
Definition
AutomatableButton.h:39
lmms::gui::AutomatableButton::m_group
AutomatableButtonGroup * m_group
Definition
AutomatableButton.h:72
lmms::gui::AutomatableButton::AutomatableButtonGroup
friend class AutomatableButtonGroup
Definition
AutomatableButton.h:75
lmms::gui::AutomatableButton::setCheckable
void setCheckable(bool _on)
Definition
AutomatableButton.h:46
lmms::gui::AutomatableButton::setChecked
virtual void setChecked(bool _on)
Definition
AutomatableButton.h:58
lmms::gui::AutomatableButton::AutomatableButton
AutomatableButton(QWidget *_parent, const QString &_name=QString())
Definition
AutomatableButton.cpp:38
lmms::gui::TypedModelView< BoolModel >::model
BoolModel * model()
Definition
AutomatableModelView.h:121
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms::gui::BoolModelView
TypedModelView< BoolModel > BoolModelView
Definition
AutomatableModelView.h:133
lmms::gui::IntModelView
TypedModelView< IntModel > IntModelView
Definition
AutomatableModelView.h:132
Generated on
for lmms by
1.18.0