hydrogen 1.2.3
Fader.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23
24#ifndef FADER_H
25#define FADER_H
26
27
28#include <QtGui>
29#include <QtWidgets>
30#include <QSvgRenderer>
31
32#include "WidgetWithInput.h"
33
34#include <core/Object.h>
35
43class Fader : public WidgetWithInput, public H2Core::Object<Fader>
44{
46
47public:
48 enum class Type {
49 Normal,
52 Master
53 };
54
55 Fader( QWidget *pParent, Type type, QString sBaseTooltip, bool bUseIntSteps = false, bool bWithoutKnob = false, float fMin = 0.0, float fMax = 1.0, bool bModifyOnChange = true );
56 ~Fader();
57
58 void setMaxPeak( float fMax );
59 void setMinPeak( float fMin );
60
61 void setPeak_L( float peak );
62 float getPeak_L() const { return m_fPeakValue_L; }
63
64 void setPeak_R( float peak );
65 float getPeak_R() const { return m_fPeakValue_R; }
66
67public slots:
69
70private:
73 QSvgRenderer* m_pBackground;
74 QSvgRenderer* m_pKnob;
75
80
81 virtual void mouseMoveEvent(QMouseEvent *ev) override;
82 virtual void mousePressEvent(QMouseEvent *ev) override;
83 virtual void paintEvent(QPaintEvent *ev) override;
84};
85#endif
#define H2_OBJECT(name)
Definition Object.h:224
Custom fader widget.
Definition Fader.h:44
Type m_type
Definition Fader.h:72
virtual void mouseMoveEvent(QMouseEvent *ev) override
Definition Fader.cpp:121
QSvgRenderer * m_pBackground
Definition Fader.h:73
~Fader()
Definition Fader.cpp:111
Type
Definition Fader.h:48
@ Vertical
Only used for the playback track in the SongEditorPanel.
virtual void mousePressEvent(QMouseEvent *ev) override
Definition Fader.cpp:146
Fader(QWidget *pParent, Type type, QString sBaseTooltip, bool bUseIntSteps=false, bool bWithoutKnob=false, float fMin=0.0, float fMax=1.0, bool bModifyOnChange=true)
Definition Fader.cpp:37
float getPeak_L() const
Definition Fader.h:62
float getPeak_R() const
Definition Fader.h:65
void onPreferencesChanged(H2Core::Preferences::Changes changes)
Definition Fader.cpp:114
bool m_bWithoutKnob
Definition Fader.h:71
QSvgRenderer * m_pKnob
Definition Fader.h:74
void setPeak_R(float peak)
Definition Fader.cpp:338
float m_fMinPeak
Definition Fader.h:78
float m_fPeakValue_R
Definition Fader.h:77
void setMaxPeak(float fMax)
Definition Fader.cpp:363
void setMinPeak(float fMin)
Definition Fader.cpp:395
float m_fMaxPeak
Definition Fader.h:79
virtual void paintEvent(QPaintEvent *ev) override
Definition Fader.cpp:172
float m_fPeakValue_L
Definition Fader.h:76
void setPeak_L(float peak)
Definition Fader.cpp:313
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
Base class for active user input widget, which are not based on a high-level Qt widget.