Added function/slot updateTable to parse the value of a selected preset into the table
parent
3496d85e22
commit
11d03d826e
|
|
@ -17,6 +17,13 @@ mainWindow::mainWindow(QWidget *parent) :
|
||||||
{
|
{
|
||||||
_prefixPocketC = {0xF0,0x00,0x20,0x20,0x14,0x00};
|
_prefixPocketC = {0xF0,0x00,0x20,0x20,0x14,0x00};
|
||||||
_midiIn->setIgnoreTypes(false, false, false);
|
_midiIn->setIgnoreTypes(false, false, false);
|
||||||
|
|
||||||
|
for(int i=0; i<128; i++){
|
||||||
|
for(int j=0; j<48; j++){
|
||||||
|
_preset[i][j] = i+j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Layout
|
// Layout
|
||||||
|
|
||||||
QWidget *mainWidget = new QWidget(this);
|
QWidget *mainWidget = new QWidget(this);
|
||||||
|
|
@ -55,6 +62,8 @@ mainWindow::mainWindow(QWidget *parent) :
|
||||||
_presetsList->addItem(defaultCelString);
|
_presetsList->addItem(defaultCelString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(_presetsList,SIGNAL(itemSelectionChanged()),this,SLOT(updateTable()));
|
||||||
|
|
||||||
QStringList settingsList;
|
QStringList settingsList;
|
||||||
settingsList << "Channel" << "Description"<< "Type" << "Parameter";
|
settingsList << "Channel" << "Description"<< "Type" << "Parameter";
|
||||||
_presetSettingsTable->setRowCount(16);
|
_presetSettingsTable->setRowCount(16);
|
||||||
|
|
@ -145,6 +154,18 @@ void mainWindow::updatePreset(QMidiMessage *message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainWindow::updateTable()
|
||||||
|
{
|
||||||
|
// ROWS
|
||||||
|
for(int i=0; i<16; i++){
|
||||||
|
//COLS
|
||||||
|
for(int j=0; j<3; j++){
|
||||||
|
QString value = QString::number(_preset[_presetsList->currentRow()][i+16*j]);
|
||||||
|
_presetSettingsTable->setItem(i,j,new QTableWidgetItem(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void mainWindow::openMidiPorts(){
|
void mainWindow::openMidiPorts(){
|
||||||
_midiIn->closePort();
|
_midiIn->closePort();
|
||||||
_midiOut->closePort();
|
_midiOut->closePort();
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ public slots:
|
||||||
void openSettingsWindow();
|
void openSettingsWindow();
|
||||||
void updateDeviceConfig();
|
void updateDeviceConfig();
|
||||||
void updatePreset(QMidiMessage* message);
|
void updatePreset(QMidiMessage* message);
|
||||||
|
void updateTable();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void openMidiPorts();
|
void openMidiPorts();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue