From 029f719b3b4eb1f0c71be4c786570db22fad5958 Mon Sep 17 00:00:00 2001 From: Yohann Dedy Date: Mon, 5 Sep 2016 23:53:01 +0200 Subject: [PATCH] added "Thru/Masterchn - Dump" function --- src/mainwindow.cpp | 17 +++++++++++++++++ src/mainwindow.h | 2 +- src/settingswindow.cpp | 6 +----- src/settingswindow.h | 1 - 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c61e4cf..ec13c51 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -110,6 +110,23 @@ void mainWindow::openSettingsWindow() _settingsWindow->show(); } +void mainWindow::updateDeviceConfig(){ + if(!_midiOut->isPortOpen()) return; + + std::bitset<3> *thru = _settingsWindow->_thruBitset; + int mastChn = _settingsWindow->_masterChannelSpinBox->value() - 1; + + std::vector rawRequest; + rawRequest = _prefixPocketC; + rawRequest.push_back(0x50); + rawRequest.push_back(thru->to_ulong()); + rawRequest.push_back(mastChn); + rawRequest.push_back(0xF7); + + _midiOut->sendRawMessage(rawRequest); + +} + void mainWindow::openMidiPorts(){ _midiIn->closePort(); _midiOut->closePort(); diff --git a/src/mainwindow.h b/src/mainwindow.h index 9a504ed..442012b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -58,7 +58,7 @@ signals: public slots: void onMidiMessageReceive(QMidiMessage* message); void openSettingsWindow(); - //void updateDeviceConfig(std::bitset<3> thru, int mastChn); + void updateDeviceConfig(); //void updatePresetSettings(std::vector* presetSettings); private slots: void openMidiPorts(); diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index b8191fd..65395e1 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -58,6 +58,7 @@ settingsWindow::settingsWindow(QWidget *parent) : setConfigButton->setText("Set configuration"); connect(getConfigButton, SIGNAL(clicked(bool)),parent,SLOT(sendThruMasterChnRequest())); + connect(setConfigButton, SIGNAL(clicked(bool)),parent, SLOT(updateDeviceConfig())); QVBoxLayout *vbox = new QVBoxLayout; vbox->addWidget(_channelThruCheckBox); @@ -105,8 +106,3 @@ void settingsWindow::updateConfig(QMidiMessage* message){ _sysexThruCheckBox->setChecked(thruVal.test(1)); _realtimeThruCheckBox->setChecked(thruVal.test(2)); } - -void settingsWindow::onSetConfig(){ - - -} diff --git a/src/settingswindow.h b/src/settingswindow.h index aa14228..c2ab570 100644 --- a/src/settingswindow.h +++ b/src/settingswindow.h @@ -41,7 +41,6 @@ signals: public slots: void onThruCheckboxChange(); void updateConfig(QMidiMessage* message); - void onSetConfig(); }; #endif // SETTINGSWINDOW_H