LMMS
Loading...
Searching...
No Matches
LfoController.h
Go to the documentation of this file.
1/*
2 * LfoController.h - A LFO-based controller and dialog
3 *
4 * Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (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 GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_LFO_CONTROLLER_H
26#define LMMS_LFO_CONTROLLER_H
27
28
29#include "AutomatableModel.h"
30#include "Controller.h"
31#include "ControllerDialog.h"
32#include "SampleBuffer.h"
33#include "TempoSyncKnobModel.h"
34
35namespace lmms
36{
37
38namespace gui
39{
40
42class PixmapButton;
43class Knob;
44class TempoSyncKnob;
45
47
48}
49
50
52{
53 Q_OBJECT
54public:
55 LfoController( Model * _parent );
56
57 ~LfoController() override;
58
59 void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
60 void loadSettings( const QDomElement & _this ) override;
61 QString nodeName() const override;
62
63
64public slots:
65 gui::ControllerDialog * createDialog( QWidget * _parent ) override;
66
67
68protected:
69 // The internal per-controller value updating function
70 void updateValueBuffer() override;
71
78
82
83 sample_t (*m_sampleFunction)( const float );
84
85private:
87 std::shared_ptr<const SampleBuffer> m_userDefSampleBuffer = SampleBuffer::emptyBuffer();
88
89protected slots:
90 void updatePhase();
92 void updateDuration();
93
95
96} ;
97
98namespace gui
99{
100
102{
103 Q_OBJECT
104public:
105 LfoControllerDialog( Controller * _controller, QWidget * _parent );
106 ~LfoControllerDialog() override;
107
108
109protected:
110 void contextMenuEvent( QContextMenuEvent * _me ) override;
111 void modelChanged() override;
112
114
122
123
124private:
126
127private slots:
128 void askUserDefWave();
129
130} ;
131
132
133} // namespace gui
134
135} // namespace lmms
136
137#endif // LMMS_LFO_CONTROLLER_H
Definition Controller.h:51
Controller(ControllerType _type, Model *_parent, const QString &_display_name)
Definition Controller.cpp:47
Definition AutomatableModel.h:463
Definition AutomatableModel.h:481
Definition LfoController.h:52
FloatModel m_baseModel
Definition LfoController.h:72
void loadSettings(const QDomElement &_this) override
Definition LfoController.cpp:231
TempoSyncKnobModel m_speedModel
Definition LfoController.h:73
QString nodeName() const override
Definition LfoController.cpp:256
FloatModel m_amountModel
Definition LfoController.h:74
void updateValueBuffer() override
Definition LfoController.cpp:88
float m_currentPhase
Definition LfoController.h:81
float m_heldSample
Definition LfoController.h:86
void updateSampleFunction()
Definition LfoController.cpp:177
float m_duration
Definition LfoController.h:79
void saveSettings(QDomDocument &_doc, QDomElement &_this) override
Definition LfoController.cpp:216
void updatePhase()
Definition LfoController.cpp:149
void updateDuration()
Definition LfoController.cpp:156
~LfoController() override
Definition LfoController.cpp:77
IntModel m_waveModel
Definition LfoController.h:76
FloatModel m_phaseModel
Definition LfoController.h:75
IntModel m_multiplierModel
Definition LfoController.h:77
std::shared_ptr< const SampleBuffer > m_userDefSampleBuffer
Definition LfoController.h:87
sample_t(* m_sampleFunction)(const float)
Definition LfoController.h:83
gui::ControllerDialog * createDialog(QWidget *_parent) override
Definition LfoController.cpp:263
float m_phaseOffset
Definition LfoController.h:80
LfoController(Model *_parent)
Definition LfoController.cpp:40
Definition Model.h:37
static auto emptyBuffer() -> std::shared_ptr< const SampleBuffer >
Definition SampleBuffer.cpp:67
Definition TempoSyncKnobModel.h:45
Definition AutomatableButton.h:84
Definition ControllerDialog.h:42
ControllerDialog(Controller *controller, QWidget *parent)
Definition ControllerDialog.cpp:33
Definition Knob.h:47
Definition LfoController.h:102
void askUserDefWave()
Definition LfoControllerDialog.cpp:209
TempoSyncKnob * m_speedKnob
Definition LfoController.h:116
PixmapButton * m_userLfoBtn
Definition LfoController.h:119
~LfoControllerDialog() override
Definition LfoControllerDialog.cpp:202
LfoControllerDialog(Controller *_controller, QWidget *_parent)
Definition LfoControllerDialog.cpp:55
AutomatableButtonGroup * m_multiplierBtnGrp
Definition LfoController.h:121
Knob * m_amountKnob
Definition LfoController.h:117
Knob * m_phaseKnob
Definition LfoController.h:118
AutomatableButtonGroup * m_waveBtnGrp
Definition LfoController.h:120
PixmapButton * m_userWaveBtn
Definition LfoController.h:125
void modelChanged() override
Definition LfoControllerDialog.cpp:248
LfoController * m_lfo
Definition LfoController.h:113
void contextMenuEvent(QContextMenuEvent *_me) override
Definition LfoControllerDialog.cpp:223
Knob * m_baseKnob
Definition LfoController.h:115
Definition PixmapButton.h:37
Definition TempoSyncKnob.h:41
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35
float sample_t
Definition LmmsTypes.h:39