parent
4bbee5293f
commit
53b28ae6cb
|
|
@ -10,9 +10,9 @@ mainWindow::mainWindow(QWidget *parent) :
|
|||
_presetsTable(new QTableWidget),
|
||||
_presetSettingsTable(new QTableWidget),
|
||||
_menuBar(new QMenuBar),
|
||||
_midiIn(new QMidiIn),
|
||||
_midiOut(new QMidiOut),
|
||||
_midiMessage(new QMidiMessage)
|
||||
_midiMessage(new QMidiMessage),
|
||||
_midiIn(new QMidiIn(this)),
|
||||
_midiOut(new QMidiOut(this))
|
||||
{
|
||||
//_midiIn->openPort(NULL);
|
||||
//_midiOut->openPort(NULL);
|
||||
|
|
@ -74,6 +74,8 @@ mainWindow::~mainWindow()
|
|||
|
||||
}
|
||||
|
||||
// SLOTS
|
||||
|
||||
void mainWindow::onMidiMessageReceive(QMidiMessage *message)
|
||||
{
|
||||
std::vector<unsigned char> rawMessage = message->getRawMessage();
|
||||
|
|
@ -102,9 +104,24 @@ void mainWindow::onMidiMessageReceive(QMidiMessage *message)
|
|||
//qDebug() << "BYTE #7 : " << rawMessage.at(6) ; // DEBUG
|
||||
}
|
||||
|
||||
void mainWindow::openSettingsWindow(){
|
||||
void mainWindow::openSettingsWindow()
|
||||
{
|
||||
qDebug() << "Open settings window here" ;
|
||||
_settingsWindow->setWindowModality(Qt::ApplicationModal);
|
||||
_settingsWindow->show();
|
||||
|
||||
}
|
||||
|
||||
void mainWindow::openMidiOutPort(unsigned int port)
|
||||
{
|
||||
if(_midiOut->isPortOpen()) _midiOut->closePort();
|
||||
_midiOut->openPort(port);
|
||||
}
|
||||
|
||||
void mainWindow::openMidiInPort(unsigned int port)
|
||||
{
|
||||
if(_midiIn->isPortOpen()) _midiIn->closePort();
|
||||
|
||||
_midiIn->openPort(port);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ public slots:
|
|||
void openSettingsWindow();
|
||||
//void updateDeviceConfig(std::bitset<3> thru, int mastChn);
|
||||
//void updatePresetSettings(std::vector<unsigned int>* presetSettings);
|
||||
void openMidiOutPort(unsigned int port);
|
||||
void openMidiInPort(unsigned int port);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,22 @@
|
|||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QDebug>
|
||||
#include <QGroupBox>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QLabel>
|
||||
#include <bitset>
|
||||
settingsWindow::settingsWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
_midiIn(new QMidiIn),
|
||||
_midiOut(new QMidiOut),
|
||||
_midiMessage(new QMidiMessage),
|
||||
_inPortComboBox(new QComboBox(this)),
|
||||
_outPortComboBox(new QComboBox(this))
|
||||
_outPortComboBox(new QComboBox(this)),
|
||||
_channelThruCheckBox(new QCheckBox(this)),
|
||||
_sysexThruCheckBox(new QCheckBox(this)),
|
||||
_realtimeThruCheckBox(new QCheckBox(this)),
|
||||
_masterChannelSpinBox(new QSpinBox(this))
|
||||
{
|
||||
this->setWindowTitle("Configuration");
|
||||
|
||||
|
|
@ -24,17 +32,42 @@ settingsWindow::settingsWindow(QWidget *parent) :
|
|||
|
||||
|
||||
QPushButton *bouton = new QPushButton();
|
||||
bouton->setText("OK");
|
||||
bouton->setText("Apply");
|
||||
|
||||
// THRU MASTER CHANNEL
|
||||
QGroupBox *thruChnBox = new QGroupBox("Thru Settings");
|
||||
_channelThruCheckBox->setText("Channel Events Thru (BIT0)");
|
||||
_sysexThruCheckBox->setText("Sysex Events Thru (BIT1)");
|
||||
_realtimeThruCheckBox->setText("Realtim Events Thru (BIT2)");
|
||||
|
||||
_masterChannelSpinBox->setValue(1);
|
||||
|
||||
QPushButton *getConfigButton = new QPushButton;
|
||||
getConfigButton->setText("Get configuration");
|
||||
QPushButton *setConfigButton = new QPushButton;
|
||||
setConfigButton->setText("Set configuration");
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout;
|
||||
vbox->addWidget(_channelThruCheckBox);
|
||||
vbox->addWidget(_sysexThruCheckBox);
|
||||
vbox->addWidget(_realtimeThruCheckBox);
|
||||
vbox->addWidget(_masterChannelSpinBox);
|
||||
vbox->addWidget(getConfigButton);
|
||||
vbox->addWidget(setConfigButton);
|
||||
thruChnBox->setLayout(vbox);
|
||||
// END THRU MASTER CHANNEL
|
||||
|
||||
mainLayout->addWidget(new QLabel("Midi IN"));
|
||||
mainLayout->addWidget(_inPortComboBox);
|
||||
mainLayout->addWidget(new QLabel("Midi OUT"));
|
||||
mainLayout->addWidget(_outPortComboBox);
|
||||
mainLayout->addWidget(bouton);
|
||||
mainLayout->addWidget(thruChnBox);
|
||||
|
||||
mainWidget->setLayout(mainLayout);
|
||||
setCentralWidget(mainWidget);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
#include <QWidget>
|
||||
#include <QMainWindow>
|
||||
#include <QComboBox>
|
||||
#include <QGroupBox>;
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
|
||||
#include "qmidimessage.h"
|
||||
#include "qmidiin.h"
|
||||
|
|
@ -19,6 +22,12 @@ public:
|
|||
|
||||
QComboBox *_inPortComboBox;
|
||||
QComboBox *_outPortComboBox;
|
||||
|
||||
QCheckBox *_channelThruCheckBox;
|
||||
QCheckBox *_sysexThruCheckBox;
|
||||
QCheckBox *_realtimeThruCheckBox;
|
||||
QSpinBox *_masterChannelSpinBox;
|
||||
|
||||
private:
|
||||
QMidiIn *_midiIn;
|
||||
QMidiOut *_midiOut;
|
||||
|
|
|
|||
Loading…
Reference in New Issue