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