[go: up one dir, main page]

Menu

[r39]: / Source / GuiAttachment.h  Maximize  Restore  History

Download this file

78 lines (66 with data), 2.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**************************************************************************
Copyright (C) 2019 Arnaud Champenois arthelion@free.fr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
#pragma once
#include "../JuceLibraryCode/JuceHeader.h"
#include <vector>
class MolossI;
/*!
* Class embedded in each GUI component to manage attachment of parameters with each control
*
*/
class GuiAttachment {
public:
/*!
* Constructor of the attachment
* \param processor The processor the parameters belong to
*/
GuiAttachment(MolossI &processor);
/*!
* Destructor of the attachment
* Calls clearAttachment
*/
~GuiAttachment();
/*!
* Attaches a button to an AudioParameter and stores the attachement in "this"
*
* \param param The audio parameter to attach
* \param button The button to attach
*/
void attachButton(RangedAudioParameter*param, Button&button);
/*!
* Attaches a slider to an AudioParameter and stores the attachement in "this"
*
* \param param The audio parameter to attach
* \param slider The button to attach
*/
void attachSlider(RangedAudioParameter*param, Slider&slider);
/*!
* Attaches a combobox to an AudioParameter and stores the attachement in "this"
*
* \param param The audio parameter to attach
* \param combobox The button to attach
*/
void attachCombobox(AudioParameterChoice*param, ComboBox&combo);
/*!
* Clears all the attachements to Gui controllers stored in this parameter
*
*/
void clearAttachements();
void deleteComboAttachement(ComboBox&combo);
private:
std::vector<std::unique_ptr<AudioProcessorValueTreeState::ComboBoxAttachment>> mComboBoxArray;
std::vector<std::unique_ptr<AudioProcessorValueTreeState::SliderAttachment>> mSliderArray;
std::vector<std::unique_ptr<AudioProcessorValueTreeState::ButtonAttachment>> mButtonArray;
MolossI &mProcessor;
};