LMMS
Loading...
Searching...
No Matches
TempoSyncKnob.h
Go to the documentation of this file.
1/*
2 * TempoSyncKnob.h - adds bpm to ms conversion for knob 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 *
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_TEMPO_SYNC_KNOB_H
27#define LMMS_GUI_TEMPO_SYNC_KNOB_H
28
29#include <QPixmap>
30#include <QPointer>
31
32#include "Knob.h"
33#include "TempoSyncKnobModel.h"
34
35namespace lmms::gui
36{
37
38class MeterDialog;
39
40class LMMS_EXPORT TempoSyncKnob : public Knob
41{
42 Q_OBJECT
43public:
44 TempoSyncKnob( KnobType knobNum, QWidget* parent = nullptr, const QString& name = QString() );
45
55 TempoSyncKnob(KnobType knobNum, const QString& labelText, QWidget* parent = nullptr, LabelRendering labelRendering = LabelRendering::WidgetFont, const QString& name = QString());
56
66 TempoSyncKnob(KnobType knobNum, const QString& labelText, int labelPixelSize, QWidget* parent, const QString& name = QString());
67
68 ~TempoSyncKnob() override;
69
70 const QString & syncDescription();
71 void setSyncDescription( const QString & _new_description );
72
73 const QPixmap & syncIcon();
74 void setSyncIcon( const QPixmap & _new_pix );
75
80
81 void modelChanged() override;
82
83
84signals:
85 void syncDescriptionChanged( const QString & _new_description );
87
88
89protected:
90 void contextMenuEvent( QContextMenuEvent * _me ) override;
91
92
93protected slots:
94 void updateDescAndIcon();
95 void showCustom();
96
97
98private:
101
102 QPointer<MeterDialog> m_custom;
103
104} ;
105
106
107
108} // namespace lmms::gui
109
110#endif // LMMS_GUI_TEMPO_SYNC_KNOB_H
Definition TempoSyncKnobModel.h:45
Knob(KnobType _knob_num, QWidget *_parent=nullptr, const QString &_name=QString())
Construct a Knob with the given style and no label.
Definition Knob.cpp:40
LabelRendering
Determines how the label of the knob is rendered.
Definition Knob.h:83
@ WidgetFont
Renders the label using the font that is set for the widget.
Definition Knob.h:89
KnobType knobNum
Definition Knob.h:68
Definition MeterDialog.h:40
T * castModel()
Definition ModelView.h:54
void setSyncIcon(const QPixmap &_new_pix)
Definition TempoSyncKnob.cpp:304
TempoSyncKnob(KnobType knobNum, QWidget *parent=nullptr, const QString &name=QString())
Definition TempoSyncKnob.cpp:46
TempoSyncKnobModel * model()
Definition TempoSyncKnob.h:76
QPixmap m_tempoSyncIcon
Definition TempoSyncKnob.h:99
void contextMenuEvent(QContextMenuEvent *_me) override
Definition TempoSyncKnob.cpp:104
void updateDescAndIcon()
Definition TempoSyncKnob.cpp:182
void showCustom()
Definition TempoSyncKnob.cpp:313
void setSyncDescription(const QString &_new_description)
Definition TempoSyncKnob.cpp:287
const QPixmap & syncIcon()
Definition TempoSyncKnob.cpp:296
QPointer< MeterDialog > m_custom
Definition TempoSyncKnob.h:102
void syncDescriptionChanged(const QString &_new_description)
const QString & syncDescription()
Definition TempoSyncKnob.cpp:279
QString m_tempoSyncDescription
Definition TempoSyncKnob.h:100
static const char * name
Definition pugl.h:1582
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223
KnobType
Definition Knob.h:39