diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 98d27f0..8af0134 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -17,6 +17,13 @@ mainWindow::mainWindow(QWidget *parent) : { _prefixPocketC = {0xF0,0x00,0x20,0x20,0x14,0x00}; _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 QWidget *mainWidget = new QWidget(this); @@ -55,6 +62,8 @@ mainWindow::mainWindow(QWidget *parent) : _presetsList->addItem(defaultCelString); } + connect(_presetsList,SIGNAL(itemSelectionChanged()),this,SLOT(updateTable())); + QStringList settingsList; settingsList << "Channel" << "Description"<< "Type" << "Parameter"; _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(){ _midiIn->closePort(); _midiOut->closePort(); diff --git a/src/mainwindow.h b/src/mainwindow.h index 41d7a0b..bf7ba6a 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -58,6 +58,7 @@ public slots: void openSettingsWindow(); void updateDeviceConfig(); void updatePreset(QMidiMessage* message); + void updateTable(); private slots: void openMidiPorts();