LMMS
Loading...
Searching...
No Matches
TempoSyncBarModelEditor.h
Go to the documentation of this file.
1/*
2 * TempoSyncBarModelEditor.h - adds bpm to ms conversion for the bar editor class
3 *
4 * Copyright (c) 2005-2008 Danny McRae <khjklujn/at/yahoo.com>
5 * Copyright (c) 2009-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 * Copyright (c) 2023 Michael Gregorius
7 *
8 * This file is part of LMMS - https://lmms.io
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public
21 * License along with this program (see COPYING); if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301 USA.
24 *
25 */
26
27#ifndef LMMS_GUI_TEMPO_SYNC_BAR_MODEL_EDITOR_H
28#define LMMS_GUI_TEMPO_SYNC_BAR_MODEL_EDITOR_H
29
30#include <QPixmap>
31#include <QPointer>
32
33#include "BarModelEditor.h"
34#include "TempoSyncKnobModel.h"
35
36namespace lmms::gui
37{
38
39class MeterDialog;
40
41class LMMS_EXPORT TempoSyncBarModelEditor : public BarModelEditor
42{
43 Q_OBJECT
44public:
45 TempoSyncBarModelEditor(QString text, FloatModel * floatModel, QWidget * parent = nullptr);
46 ~TempoSyncBarModelEditor() override;
47
48 const QString & syncDescription();
49 void setSyncDescription(const QString & new_description);
50
51 const QPixmap & syncIcon();
52 void setSyncIcon(const QPixmap & new_pix);
53
58
59 void modelChanged() override;
60
61
62signals:
63 void syncDescriptionChanged(const QString & new_description);
65
66
67protected:
68 void contextMenuEvent(QContextMenuEvent * me) override;
69
70
71protected slots:
72 void updateDescAndIcon();
73 void showCustom();
74
75
76private:
78 void updateIcon();
79
80
81private:
84
85 QPointer<MeterDialog> m_custom;
86};
87
88} // namespace lmms::gui
89
90#endif // LMMS_GUI_TEMPO_SYNC_BAR_MODEL_EDITOR_H
Definition AutomatableModel.h:463
Definition TempoSyncKnobModel.h:45
BarModelEditor(QString text, FloatModel *floatModel, QWidget *parent=nullptr)
Definition BarModelEditor.cpp:9
Definition MeterDialog.h:40
T * castModel()
Definition ModelView.h:54
void updateIcon()
Definition TempoSyncBarModelEditor.cpp:266
void updateTextDescription()
Definition TempoSyncBarModelEditor.cpp:222
TempoSyncBarModelEditor(QString text, FloatModel *floatModel, QWidget *parent=nullptr)
Definition TempoSyncBarModelEditor.cpp:44
TempoSyncKnobModel * model()
Definition TempoSyncBarModelEditor.h:54
void updateDescAndIcon()
Definition TempoSyncBarModelEditor.cpp:161
void contextMenuEvent(QContextMenuEvent *me) override
Definition TempoSyncBarModelEditor.cpp:84
QString m_tempoSyncDescription
Definition TempoSyncBarModelEditor.h:83
void showCustom()
Definition TempoSyncBarModelEditor.cpp:203
void syncDescriptionChanged(const QString &new_description)
const QPixmap & syncIcon()
Definition TempoSyncBarModelEditor.cpp:190
void setSyncDescription(const QString &new_description)
Definition TempoSyncBarModelEditor.cpp:183
QPointer< MeterDialog > m_custom
Definition TempoSyncBarModelEditor.h:85
QPixmap m_tempoSyncIcon
Definition TempoSyncBarModelEditor.h:82
const QString & syncDescription()
Definition TempoSyncBarModelEditor.cpp:177
void setSyncIcon(const QPixmap &new_pix)
Definition TempoSyncBarModelEditor.cpp:196
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223
const char * text
Definition swell-functions.h:167