Added Thru/Masterchannel dump request
parent
9c6621f3b7
commit
172975be45
|
|
@ -14,9 +14,8 @@ mainWindow::mainWindow(QWidget *parent) :
|
|||
_midiIn(new QMidiIn(this)),
|
||||
_midiOut(new QMidiOut(this))
|
||||
{
|
||||
//_midiIn->openPort(NULL);
|
||||
//_midiOut->openPort(NULL);
|
||||
|
||||
_prefixPocketC = {0xF0,0x00,0x20,0x20,0x14,0x00};
|
||||
_midiIn->setIgnoreTypes(false, false, false);
|
||||
// Layout
|
||||
|
||||
QWidget *mainWidget = new QWidget(this);
|
||||
|
|
@ -87,6 +86,7 @@ void mainWindow::onMidiMessageReceive(QMidiMessage *message)
|
|||
{
|
||||
case THRU_MC_DUMP:
|
||||
{
|
||||
_settingsWindow->updateConfig(message);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,6 @@ void mainWindow::onMidiMessageReceive(QMidiMessage *message)
|
|||
|
||||
void mainWindow::openSettingsWindow()
|
||||
{
|
||||
qDebug() << "Open settings window here" ;
|
||||
_settingsWindow->setWindowModality(Qt::ApplicationModal);
|
||||
_settingsWindow->show();
|
||||
}
|
||||
|
|
@ -119,7 +118,17 @@ void mainWindow::openMidiPorts(){
|
|||
_midiIn->openPort(_settingsWindow->_inPortComboBox->currentIndex());
|
||||
}
|
||||
if(_settingsWindow->_outPortComboBox->currentText() != "None"){
|
||||
qDebug()<< "Selected MIDI OUT : " <<_settingsWindow->_inPortComboBox->currentText();
|
||||
qDebug()<< "Selected MIDI OUT : " <<_settingsWindow->_outPortComboBox->currentText();
|
||||
_midiOut->openPort(_settingsWindow->_outPortComboBox->currentIndex());
|
||||
}
|
||||
}
|
||||
|
||||
void mainWindow::sendThruMasterChnRequest(){
|
||||
std::vector<unsigned char> rawRequest;
|
||||
rawRequest = _prefixPocketC;
|
||||
rawRequest.push_back(0x56);
|
||||
rawRequest.push_back(0x00);
|
||||
rawRequest.push_back(0x00);
|
||||
rawRequest.push_back(0xF7);
|
||||
if(_midiOut->isPortOpen()) _midiOut->sendRawMessage(rawRequest);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ enum deviceCommandByte {
|
|||
VERSION_ANS = 0x00,
|
||||
};
|
||||
|
||||
|
||||
class mainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -38,6 +37,7 @@ public:
|
|||
|
||||
~mainWindow();
|
||||
|
||||
std::vector<unsigned char> _prefixPocketC;
|
||||
QMidiMessage* _midiMessage;
|
||||
deviceCommandByte _deviceCommandByte;
|
||||
|
||||
|
|
@ -60,8 +60,10 @@ public slots:
|
|||
void openSettingsWindow();
|
||||
//void updateDeviceConfig(std::bitset<3> thru, int mastChn);
|
||||
//void updatePresetSettings(std::vector<unsigned int>* presetSettings);
|
||||
void infoPopup();
|
||||
private slots:
|
||||
void openMidiPorts();
|
||||
void sendThruMasterChnRequest();
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <QGroupBox>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QMessageBox.h>
|
||||
#include <QLabel>
|
||||
#include <bitset>
|
||||
settingsWindow::settingsWindow(QWidget *parent) :
|
||||
|
|
@ -37,8 +38,10 @@ settingsWindow::settingsWindow(QWidget *parent) :
|
|||
emit _outPortComboBox->setCurrentIndex(_outPortComboBox->count()-1);
|
||||
|
||||
|
||||
QPushButton *bouton = new QPushButton();
|
||||
bouton->setText("Apply");
|
||||
QPushButton *applyBouton = new QPushButton();
|
||||
applyBouton->setText("Apply");
|
||||
connect(applyBouton, SIGNAL(clicked(bool)), parent, SLOT(openMidiPorts()));
|
||||
|
||||
|
||||
// THRU MASTER CHANNEL
|
||||
QGroupBox *thruChnBox = new QGroupBox("Thru Settings");
|
||||
|
|
@ -54,6 +57,8 @@ settingsWindow::settingsWindow(QWidget *parent) :
|
|||
QPushButton *setConfigButton = new QPushButton;
|
||||
setConfigButton->setText("Set configuration");
|
||||
|
||||
connect(getConfigButton, SIGNAL(clicked(bool)),parent,SLOT(sendThruMasterChnRequest()));
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout;
|
||||
vbox->addWidget(_channelThruCheckBox);
|
||||
vbox->addWidget(_sysexThruCheckBox);
|
||||
|
|
@ -68,7 +73,7 @@ settingsWindow::settingsWindow(QWidget *parent) :
|
|||
mainLayout->addWidget(_inPortComboBox);
|
||||
mainLayout->addWidget(new QLabel("Midi OUT"));
|
||||
mainLayout->addWidget(_outPortComboBox);
|
||||
mainLayout->addWidget(bouton);
|
||||
mainLayout->addWidget(applyBouton);
|
||||
mainLayout->addWidget(thruChnBox);
|
||||
|
||||
mainWidget->setLayout(mainLayout);
|
||||
|
|
@ -77,7 +82,8 @@ settingsWindow::settingsWindow(QWidget *parent) :
|
|||
connect(_channelThruCheckBox,SIGNAL(toggled(bool)),this,SLOT(onThruCheckboxChange()));
|
||||
connect(_sysexThruCheckBox,SIGNAL(toggled(bool)),this,SLOT(onThruCheckboxChange()));
|
||||
connect(_realtimeThruCheckBox,SIGNAL(toggled(bool)),this,SLOT(onThruCheckboxChange()));
|
||||
connect(bouton, SIGNAL(clicked(bool)),parent, SLOT(openMidiPorts()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
settingsWindow::~settingsWindow()
|
||||
|
|
@ -88,5 +94,19 @@ void settingsWindow::onThruCheckboxChange(){
|
|||
_thruBitset->set(0, _channelThruCheckBox->isChecked());
|
||||
_thruBitset->set(1, _sysexThruCheckBox->isChecked());
|
||||
_thruBitset->set(2,_realtimeThruCheckBox->isChecked());
|
||||
qDebug()<< "_thruBitset = " <<_thruBitset->to_ulong();
|
||||
}
|
||||
|
||||
void settingsWindow::updateConfig(QMidiMessage* message){
|
||||
int mc = message->getRawMessage().at(8)+1;
|
||||
_masterChannelSpinBox->setValue(mc);
|
||||
|
||||
std::bitset<3> thruVal (message->getRawMessage().at(7));
|
||||
_channelThruCheckBox->setChecked(thruVal.test(0));
|
||||
_sysexThruCheckBox->setChecked(thruVal.test(1));
|
||||
_realtimeThruCheckBox->setChecked(thruVal.test(2));
|
||||
}
|
||||
|
||||
void settingsWindow::onSetConfig(){
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ signals:
|
|||
|
||||
public slots:
|
||||
void onThruCheckboxChange();
|
||||
void updateConfig(QMidiMessage* message);
|
||||
void onSetConfig();
|
||||
};
|
||||
|
||||
#endif // SETTINGSWINDOW_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue