MCPcopy Create free account
hub / github.com/davy7125/polyphone / addTuningProgram

Method addTuningProgram

sources/context/tuningprogrammanager.cpp:108–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108bool TuningProgramManager::addTuningProgram(int index, QString name, const double deviations[12])
109{
110 if (index < 0 || index > 16383)
111 return false;
112
113 if (_defaultPrograms)
114 {
115 _tuningPrograms.clear();
116 _defaultPrograms = false;
117 _settingToRestore = ContextManager::configuration()->getValue(ConfManager::SECTION_SOUND_ENGINE, "temperament", "").toString();
118 }
119 _updated = true;
120
121 _tuningPrograms[index]._name = name.isEmpty() ? QObject::tr("Tuning program %1:%2").arg(index / 128).arg(index % 128) : name;
122 for (int i = 0; i < 12; i++)
123 _tuningPrograms[index]._deviations[i] = static_cast<float>(deviations[i]);
124
125 return true;
126}
127
128TuningProgram * TuningProgramManager::getTuningProgram(int index)
129{

Callers

nothing calls this directly

Calls 3

clearMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected