lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Microtuner.h
Go to the documentation of this file.
1
/*
2
* Microtuner.h - manage tuning and scale information of an instrument
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_MICROTUNER_H
26
#define LMMS_MICROTUNER_H
27
28
#include "
AutomatableModel.h
"
29
#include "
ComboBoxModel.h
"
30
#include "
JournallingObject.h
"
31
32
namespace
lmms
33
{
34
35
class
LMMS_EXPORT
Microtuner
:
public
Model
,
public
JournallingObject
36
{
37
Q_OBJECT
38
public
:
39
explicit
Microtuner
();
40
41
bool
enabled
()
const
{
return
m_enabledModel
.value();}
42
bool
keyRangeImport
()
const
{
return
enabled
() &&
m_keyRangeImportModel
.value();}
43
int
currentScale
()
const
{
return
m_scaleModel
.value();}
44
int
currentKeymap
()
const
{
return
m_keymapModel
.value();}
45
46
BoolModel
*
enabledModel
() {
return
&
m_enabledModel
;}
47
ComboBoxModel
*
scaleModel
() {
return
&
m_scaleModel
;}
48
ComboBoxModel
*
keymapModel
() {
return
&
m_keymapModel
;}
49
BoolModel
*
keyRangeImportModel
() {
return
&
m_keyRangeImportModel
;}
50
51
int
firstKey
()
const
;
52
int
lastKey
()
const
;
53
int
baseKey
()
const
;
54
float
baseFreq
()
const
;
55
60
float
keyToFreq
(
int
key,
int
userBaseNote)
const
;
61
62
int
octaveSize
()
const
;
63
64
QString
nodeName
()
const override
{
return
"microtuner"
;}
65
void
saveSettings(QDomDocument & document, QDomElement &element)
override
;
66
void
loadSettings(
const
QDomElement &element)
override
;
67
68
protected
slots:
71
void
updateScaleList(
int
index);
72
75
void
updateKeymapList(
int
index);
76
77
private
:
78
BoolModel
m_enabledModel
;
79
ComboBoxModel
m_scaleModel
;
80
ComboBoxModel
m_keymapModel
;
81
BoolModel
m_keyRangeImportModel
;
82
83
};
84
85
}
// namespace lmms
86
87
#endif
// LMMS_MICROTUNER_H
AutomatableModel.h
ComboBoxModel.h
JournallingObject.h
lmms::BoolModel
Definition
AutomatableModel.h:502
lmms::ComboBoxModel
Definition
ComboBoxModel.h:39
lmms::JournallingObject::JournallingObject
JournallingObject()
Definition
JournallingObject.cpp:36
lmms::Microtuner::currentKeymap
int currentKeymap() const
Definition
Microtuner.h:44
lmms::Microtuner::baseFreq
float baseFreq() const
lmms::Microtuner::octaveSize
int octaveSize() const
Definition
Microtuner.cpp:107
lmms::Microtuner::enabled
bool enabled() const
Definition
Microtuner.h:41
lmms::Microtuner::keyRangeImport
bool keyRangeImport() const
Definition
Microtuner.h:42
lmms::Microtuner::scaleModel
ComboBoxModel * scaleModel()
Definition
Microtuner.h:47
lmms::Microtuner::keyRangeImportModel
BoolModel * keyRangeImportModel()
Definition
Microtuner.h:49
lmms::Microtuner::firstKey
int firstKey() const
lmms::Microtuner::nodeName
QString nodeName() const override
Definition
Microtuner.h:64
lmms::Microtuner::lastKey
int lastKey() const
lmms::Microtuner::keyToFreq
float keyToFreq(int key, int userBaseNote) const
Return frequency for a given MIDI key, using the active mapping and scale.
Definition
Microtuner.cpp:61
lmms::Microtuner::baseKey
int baseKey() const
lmms::Microtuner::currentScale
int currentScale() const
Definition
Microtuner.h:43
lmms::Microtuner::m_keyRangeImportModel
BoolModel m_keyRangeImportModel
Definition
Microtuner.h:81
lmms::Microtuner::m_scaleModel
ComboBoxModel m_scaleModel
Definition
Microtuner.h:79
lmms::Microtuner::enabledModel
BoolModel * enabledModel()
Definition
Microtuner.h:46
lmms::Microtuner::keymapModel
ComboBoxModel * keymapModel()
Definition
Microtuner.h:48
lmms::Microtuner::m_enabledModel
BoolModel m_enabledModel
Enable microtuner (otherwise using 12-TET @440 Hz).
Definition
Microtuner.h:78
lmms::Microtuner::m_keymapModel
ComboBoxModel m_keymapModel
Definition
Microtuner.h:80
lmms::Microtuner::Microtuner
Microtuner()
Definition
Microtuner.cpp:40
lmms::Model::Model
Model(Model *parent, QString displayName=QString(), bool defaultConstructed=false)
Definition
Model.cpp:30
lmms
Definition
RemotePluginBase.cpp:34
Generated on
for lmms by
1.18.0