lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
plugins
Eq
EqFader.h
Go to the documentation of this file.
1
/* eqfader.h - defination of EqFader class.
2
*
3
* Copyright (c) 2014 David French <dave/dot/french3/at/googlemail/dot/com>
4
*
5
* This file is part of LMMS - https://lmms.io
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public
18
* License along with this program (see COPYING); if not, write to the
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301 USA.
21
*
22
*/
23
24
#ifndef EQFADER_H
25
#define EQFADER_H
26
#include <QList>
27
#include <QWidget>
28
29
#include "
EffectControls.h
"
30
#include "
Fader.h
"
31
#include "
GuiApplication.h
"
32
#include "
MainWindow.h
"
33
#include "
TextFloat.h
"
34
35
namespace
lmms::gui
36
{
37
38
39
class
EqFader
:
public
Fader
40
{
41
42
public
:
43
Q_OBJECT
44
public
:
45
EqFader
(
FloatModel
*
model
,
const
QString & name, QWidget * parent,
float
* lPeak,
float
* rPeak ) :
46
Fader
(
model
, name, parent, false)
47
{
48
setMinimumSize( 23, 116 );
49
setMaximumSize( 23, 116 );
50
resize( 23, 116 );
51
m_lPeak
= lPeak;
52
m_rPeak
= rPeak;
53
connect(
getGUI
()->mainWindow(), SIGNAL( periodicUpdate() ),
this
, SLOT(
updateVuMeters
() ) );
54
m_model
=
model
;
55
setPeak_L
( 0 );
56
setPeak_R
( 0 );
57
}
58
59
60
61
~EqFader
()
override
=
default
;
62
63
64
private
slots:
65
66
void
updateVuMeters
()
67
{
68
const
float
opl =
getPeak_L
();
69
const
float
opr =
getPeak_R
();
70
const
float
fallOff = 1.07f;
71
if
( *
m_lPeak
> opl )
72
{
73
setPeak_L
( *
m_lPeak
);
74
*
m_lPeak
= 0;
75
}
76
else
77
{
78
setPeak_L
( opl/fallOff );
79
}
80
81
if
( *
m_rPeak
> opr )
82
{
83
setPeak_R
( *
m_rPeak
);
84
*
m_rPeak
= 0;
85
}
86
else
87
{
88
setPeak_R
( opr/fallOff );
89
}
90
update();
91
}
92
93
94
95
96
private
:
97
float
*
m_lPeak
;
98
float
*
m_rPeak
;
99
FloatModel
*
m_model
;
100
101
};
102
103
104
}
// namespace lmms::gui
105
106
#endif
// EQFADER_H
EffectControls.h
Fader.h
GuiApplication.h
MainWindow.h
TextFloat.h
lmms::FloatModel
Definition
AutomatableModel.h:468
lmms::gui::EqFader::m_rPeak
float * m_rPeak
Definition
EqFader.h:98
lmms::gui::EqFader::m_model
FloatModel * m_model
Definition
EqFader.h:99
lmms::gui::EqFader::EqFader
EqFader(FloatModel *model, const QString &name, QWidget *parent, float *lPeak, float *rPeak)
Definition
EqFader.h:45
lmms::gui::EqFader::updateVuMeters
void updateVuMeters()
Definition
EqFader.h:66
lmms::gui::EqFader::~EqFader
~EqFader() override=default
lmms::gui::EqFader::m_lPeak
float * m_lPeak
Definition
EqFader.h:97
lmms::gui::Fader::setPeak_R
void setPeak_R(float fPeak)
Definition
Fader.cpp:490
lmms::gui::Fader::Fader
Fader(FloatModel *model, const QString &name, QWidget *parent, bool modelIsLinear=true)
Definition
Fader.cpp:73
lmms::gui::Fader::getPeak_R
float getPeak_R()
Definition
Fader.h:85
lmms::gui::Fader::getPeak_L
float getPeak_L()
Definition
Fader.h:82
lmms::gui::Fader::setPeak_L
void setPeak_L(float fPeak)
Definition
Fader.cpp:483
lmms::gui::TypedModelView< FloatModel >::model
FloatModel * model()
Definition
AutomatableModelView.h:121
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms::gui::getGUI
GuiApplication * getGUI()
Definition
GuiApplication.cpp:69
Generated on
for lmms by
1.18.0