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

Method initialize

sources/context/interface/configsectionkeyboard.cpp:75–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void ConfigSectionKeyboard::initialize()
76{
77 // Name of the keys in the table
78 for (quint32 i = 0; i <= 12; i++)
79 ui->tableKeyboardMap->horizontalHeaderItem(static_cast<int>(i))->setText(
80 ContextManager::keyName()->getKeyName(i, true, false, false, true));
81
82 // Populate the table
83 int maxWidth = 50;
84 for (int j = 0; j < ui->tableKeyboardMap->columnCount(); j++)
85 {
86 for (int i = 0; i < ui->tableKeyboardMap->rowCount(); i++)
87 {
88 EditKey* key = dynamic_cast<EditKey*>(ui->tableKeyboardMap->cellWidget(i, j));
89 key->updateText();
90 maxWidth = qMax(maxWidth, key->sizeHint().width());
91 }
92 }
93 ui->tableKeyboardMap->horizontalHeader()->setDefaultSectionSize(maxWidth);
94
95 // Octave configuration
96 initializeFirstC();
97
98 // Reference pitch
99 ui->spinReferencePitch->blockSignals(true);
100 ui->spinReferencePitch->setValue(ContextManager::configuration()->getValue(ConfManager::SECTION_SOUND_ENGINE, "reference_pitch", 4400).toDouble() / 10.0);
101 ui->spinReferencePitch->blockSignals(false);
102
103 // Load the temperaments
104 updateTemperaments();
105}
106
107void ConfigSectionKeyboard::initializeFirstC()
108{

Callers

nothing calls this directly

Calls 8

setTextMethod · 0.80
getKeyNameMethod · 0.80
updateTextMethod · 0.80
columnCountMethod · 0.45
rowCountMethod · 0.45
sizeHintMethod · 0.45
setValueMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected