1 /***************************************************************************
2 **                                                                        **
3 **  Polyphone, a soundfont editor                                         **
4 **  Copyright (C) 2013-2020 Davy Triponney                                **
5 **                2014      Andrea Celani                                 **
6 **                                                                        **
7 **  This program is free software: you can redistribute it and/or modify  **
8 **  it under the terms of the GNU General Public License as published by  **
9 **  the Free Software Foundation, either version 3 of the License, or     **
10 **  (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          **
15 **  GNU General Public License for more details.                          **
16 **                                                                        **
17 **  You should have received a copy of the GNU General Public License     **
18 **  along with this program. If not, see http://www.gnu.org/licenses/.    **
19 **                                                                        **
20 ****************************************************************************
21 **           Author: Davy Triponney                                       **
22 **  Website/Contact: https://www.polyphone-soundfonts.com                 **
23 **             Date: 01.01.2013                                           **
24 ***************************************************************************/
25 
26 #ifndef MODULATORCOMBOCURVE_H
27 #define MODULATORCOMBOCURVE_H
28 
29 #include <QComboBox>
30 #include "basetypes.h"
31 
32 // Special combobox displaying a list of curves used for the modulators
33 class ModulatorComboCurve : public QComboBox
34 {
35     Q_OBJECT
36 
37 public:
38     explicit ModulatorComboCurve(QWidget* parent = nullptr);
39     ~ModulatorComboCurve();
40     bool eventFilter(QObject* object, QEvent* event);
41 
42     void initialize(EltID id, bool source1);
43     void initialize(SFModulator mod);
44     void loadValue();
45 
46     // Get information about the evolution
47     QString getEvolution();
isBipolar()48     bool isBipolar() { return _isBipolar; }
isDescending()49     bool isDescending() { return _isDescending; }
getType()50     quint8 getType() { return _type; }
51 
52 private:
53     void valueSelected(int row, int column);
54 
55     EltID _id;
56     bool _source1;
57     quint8 _type;
58     bool _isBipolar;
59     bool _isDescending;
60 
61     static const QString s_rightArrow;
62 };
63 
64 #endif // MODULATORCOMBOCURVE_H
65