LMMS
Loading...
Searching...
No Matches
NineButtonSelector.h
Go to the documentation of this file.
1/*
2 * NineButtonSelector.h
3 *
4 * Copyright (c) 2006-2007 Danny McRae <khjklujn/at/yahoo/com>
5 * Copyright (c) 2009 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_NINE_BUTTON_SELECTOR_H
27#define LMMS_GUI_NINE_BUTTON_SELECTOR_H
28
29#include <array>
30#include <QWidget>
31
33
34namespace lmms
35{
36
37
38namespace gui
39{
40
41class PixmapButton;
42
43
44class NineButtonSelector : public QWidget, public IntModelView
45{
46 Q_OBJECT
47public:
48 NineButtonSelector(const std::array<QPixmap, 18>& onOffIcons, int defaultButton, int x, int y, QWidget* parent);
49 ~NineButtonSelector() override = default;
50
51protected:
52 void setSelected(int newButton);
53
54public slots:
55 void buttonClicked(int id);
56 void contextMenuEvent(QContextMenuEvent*) override;
57
58signals:
60
61private:
62 void modelChanged() override;
63 void updateButton(int);
64
65 std::array<PixmapButton*, 9> m_buttons;
67};
68
69
70} // namespace gui
71
73
74
75} // namespace lmms
76
77#endif // LMMS_GUI_NINE_BUTTON_SELECTOR_H
Definition AutomatableModel.h:481
PixmapButton * m_lastBtn
Definition NineButtonSelector.h:66
void buttonClicked(int id)
Definition NineButtonSelector.cpp:58
void modelChanged() override
Definition NineButtonSelector.cpp:63
void contextMenuEvent(QContextMenuEvent *) override
Definition NineButtonSelector.cpp:86
void setSelected(int newButton)
Definition NineButtonSelector.cpp:68
~NineButtonSelector() override=default
NineButtonSelector(const std::array< QPixmap, 18 > &onOffIcons, int defaultButton, int x, int y, QWidget *parent)
Definition NineButtonSelector.cpp:35
std::array< PixmapButton *, 9 > m_buttons
Definition NineButtonSelector.h:65
void updateButton(int)
Definition NineButtonSelector.cpp:74
Definition PixmapButton.h:37
int y
Definition inflate.c:1588
unsigned x[BMAX+1]
Definition inflate.c:1586
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223
TypedModelView< IntModel > IntModelView
Definition AutomatableModelView.h:132
Definition AudioAlsa.cpp:35
IntModel NineButtonSelectorModel
Definition NineButtonSelector.h:72