diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index dd018f3..89257a1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -48,6 +48,8 @@ mainWindow::mainWindow(QWidget *parent) : QMenu* send = mainMenu->addMenu("Send"); QAction* sendSingle = send->addAction("Send this preset"); + connect(sendSingle,SIGNAL(triggered(bool)),this,SLOT(sendSingleDump())); + QAction* sendAll = send->addAction("Send all presets"); _menuBar->addMenu(mainMenu); @@ -209,3 +211,29 @@ void mainWindow::sendAllDumpRequest(){ } } + +void mainWindow::sendSingleDump(){ + std::vector rawRequest; + rawRequest = _prefixPocketC; + rawRequest.push_back(0x20); + rawRequest.push_back(_presetsList->currentRow()); + rawRequest.push_back(0x00); + + for(int i=0; i<3; i++){ + for(int j=0; j<16; j++){ + int value = _presetSettingsTable->item(j,i)->text().toInt(); + rawRequest.push_back(value); + } + } + + rawRequest.push_back(0xF7); + if(_midiOut->isPortOpen()) _midiOut->sendRawMessage(rawRequest); + + std::vector storeRequest; + storeRequest = _prefixPocketC; + storeRequest.push_back(0x30); + storeRequest.push_back(_presetsList->currentRow()); + storeRequest.push_back(0x00); + storeRequest.push_back(0xF7); + if(_midiOut->isPortOpen()) _midiOut->sendRawMessage(storeRequest); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index bf7ba6a..460d902 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -65,6 +65,7 @@ private slots: void sendThruMasterChnRequest(); void sendSingleDumpRequest(); void sendAllDumpRequest(); + void sendSingleDump(); };