LMMS
Loading...
Searching...
No Matches
MicrotunerConfig.h
Go to the documentation of this file.
1/*
2 * MicrotunerConfig.h - configuration widget for scales and keymaps
3 *
4 * Copyright (c) 2020 Martin Pavelek <he29.HS/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_GUI_MICROTUNER_CONFIG_H
26#define LMMS_GUI_MICROTUNER_CONFIG_H
27
28#include <QWidget>
29
30#include "AutomatableModel.h"
31#include "ComboBoxModel.h"
32#include "SerializingObject.h"
33
34class QLineEdit;
35class QPlainTextEdit;
36
37namespace lmms::gui
38{
39
40
41class LMMS_EXPORT MicrotunerConfig : public QWidget, public SerializingObject
42{
43 Q_OBJECT
44public:
46
47 void saveSettings(QDomDocument &document, QDomElement &element) override;
48 void loadSettings(const QDomElement &element) override;
49
50 inline QString nodeName() const override
51 {
52 return "MicrotunerConfig";
53 }
54 QSize sizeHint() const override {return QSize(300, 400);}
55
56public slots:
57 void updateScaleList(int index);
58 void updateKeymapList(int index);
59 void updateScaleForm();
60 void updateKeymapForm();
61
62private slots:
63 bool loadScaleFromFile();
64 bool loadKeymapFromFile();
65 bool saveScaleToFile();
66 bool saveKeymapToFile();
67
68private:
69 bool validateScaleForm();
70 bool validateKeymapForm();
71
72 bool applyScale();
73 bool applyKeymap();
74
77
78 QLineEdit *m_scaleNameEdit;
79 QLineEdit *m_keymapNameEdit;
80
81 QPlainTextEdit *m_scaleTextEdit;
82 QPlainTextEdit *m_keymapTextEdit;
83
87
90};
91
92
93} // namespace lmms::gui
94
95#endif // LMMS_GUI_MICROTUNER_CONFIG_H
Definition ComboBoxModel.h:39
Definition AutomatableModel.h:463
Definition AutomatableModel.h:481
SerializingObject()
Definition SerializingObject.cpp:32
QLineEdit * m_keymapNameEdit
edit field for the keymap name or description
Definition MicrotunerConfig.h:79
IntModel m_lastKeyModel
model for spinbox of currently edited last key
Definition MicrotunerConfig.h:85
QPlainTextEdit * m_keymapTextEdit
text editor field for key mappings
Definition MicrotunerConfig.h:82
void loadSettings(const QDomElement &element) override
Definition MicrotunerConfig.cpp:648
QSize sizeHint() const override
Definition MicrotunerConfig.h:54
QPlainTextEdit * m_scaleTextEdit
text editor field for interval definitions
Definition MicrotunerConfig.h:81
ComboBoxModel m_scaleComboModel
ID of scale currently selected for editing.
Definition MicrotunerConfig.h:75
QString nodeName() const override
Definition MicrotunerConfig.h:50
IntModel m_middleKeyModel
model for spinbox of currently edited middle key
Definition MicrotunerConfig.h:86
void saveSettings(QDomDocument &document, QDomElement &element) override
Definition MicrotunerConfig.cpp:642
QLineEdit * m_scaleNameEdit
edit field for the scale name or description
Definition MicrotunerConfig.h:78
MicrotunerConfig()
Definition MicrotunerConfig.cpp:57
ComboBoxModel m_keymapComboModel
ID of keymap currently selected for editing.
Definition MicrotunerConfig.h:76
FloatModel m_baseFreqModel
model for spinbox of currently edited base note frequency
Definition MicrotunerConfig.h:89
IntModel m_firstKeyModel
model for spinbox of currently edited first key
Definition MicrotunerConfig.h:84
IntModel m_baseKeyModel
model for spinbox of currently edited base key
Definition MicrotunerConfig.h:88
Definition AudioPortAudio.cpp:223