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

Method initializeMidi

sources/context/interface/configsectiongeneral.cpp:151–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void ConfigSectionGeneral::initializeMidi()
152{
153 // Update the possible midi inputs
154 ui->comboMidiInput->blockSignals(true);
155 ui->comboMidiInput->clear();
156 QMap<QString, QString> listMidi = ContextManager::midi()->getMidiList();
157 ui->comboMidiInput->addItem("-", "-1#-1");
158 foreach (QString key, listMidi.keys())
159 ui->comboMidiInput->addItem(listMidi[key], key);
160
161 // Select the current one
162 QString indexPort = ContextManager::configuration()->getValue(ConfManager::SECTION_MIDI, "index_port", "-1#-1").toString();
163 for (int i = 0; i < ui->comboMidiInput->count(); i++)
164 {
165 if (ui->comboMidiInput->itemData(i).toString() == indexPort)
166 {
167 ui->comboMidiInput->setCurrentIndex(i);
168 break;
169 }
170 }
171 ui->comboMidiInput->blockSignals(false);
172}
173
174void ConfigSectionGeneral::on_comboMidiInput_currentIndexChanged(int index)
175{

Callers 1

initializeMethod · 0.95

Calls 6

getMidiListMethod · 0.80
addItemMethod · 0.80
clearMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected