Added Parameter window
parent
a59715dcee
commit
9c2174c9b0
|
|
@ -181,7 +181,15 @@ void mainWindow::presetCellClicked(int row, int column)
|
||||||
|
|
||||||
if(column == 2)
|
if(column == 2)
|
||||||
{
|
{
|
||||||
// TODO : CREATE A PARAM WINDOW
|
int presetNum = _presetsList->currentRow();
|
||||||
|
int paramVal = _preset[presetNum][2][row];
|
||||||
|
|
||||||
|
int r = paramVal / 16;
|
||||||
|
int c = paramVal % 16;
|
||||||
|
|
||||||
|
QModelIndex currentParam = _paramWindow->_paramNumsTable->model()->index(r,c);
|
||||||
|
_paramWindow->_paramNumsTable->setCurrentIndex(currentParam);
|
||||||
|
_paramWindow->_paramNumsTable->setFocus();
|
||||||
_paramWindow->show();
|
_paramWindow->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -247,6 +255,18 @@ void mainWindow::updateEventCell(int r, int c)
|
||||||
_eventWindow->close();
|
_eventWindow->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainWindow::updateParamCell(int r, int c)
|
||||||
|
{
|
||||||
|
//qDebug() << "r : " << r << "c : " << c;
|
||||||
|
int paramVal;
|
||||||
|
paramVal = 16*r + c;
|
||||||
|
// qDebug() << "paramVal : " << paramVal;
|
||||||
|
_preset[_presetsList->currentRow()][2][_presetSettingsTable->currentRow()] = paramVal;
|
||||||
|
_presetSettingsTable->setItem(_presetSettingsTable->currentRow(),2,new QTableWidgetItem(QString::number(paramVal)));
|
||||||
|
_paramWindow->close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void mainWindow::updateSelectedPreset()
|
void mainWindow::updateSelectedPreset()
|
||||||
{
|
{
|
||||||
std::bitset<8> presetNum;
|
std::bitset<8> presetNum;
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public slots:
|
||||||
void updatePreset(QMidiMessage* message);
|
void updatePreset(QMidiMessage* message);
|
||||||
void updateTable();
|
void updateTable();
|
||||||
void updateEventCell(int row, int col);
|
void updateEventCell(int row, int col);
|
||||||
|
void updateParamCell(int row, int col);
|
||||||
void updateSelectedPreset();
|
void updateSelectedPreset();
|
||||||
void updateSliders();
|
void updateSliders();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,40 @@
|
||||||
#include "paramwindow.h"
|
#include "paramwindow.h"
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
paramWindow::paramWindow(QWidget *parent) : QMainWindow(parent)
|
paramWindow::paramWindow(QWidget *parent) :
|
||||||
|
QMainWindow(parent),
|
||||||
|
_paramNumsTable(new QTableWidget)
|
||||||
{
|
{
|
||||||
|
QWidget *mainWidget = new QWidget(this);
|
||||||
|
QHBoxLayout *mainLayout = new QHBoxLayout(mainWidget);
|
||||||
|
|
||||||
|
_paramNumsTable->setRowCount(8);
|
||||||
|
_paramNumsTable->setColumnCount(16);
|
||||||
|
_paramNumsTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
|
_paramNumsTable->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
|
_paramNumsTable->horizontalHeader()->setHidden(true);
|
||||||
|
_paramNumsTable->horizontalHeader()->setDefaultSectionSize(40);
|
||||||
|
_paramNumsTable->verticalHeader()->setHidden(true);
|
||||||
|
_paramNumsTable->verticalHeader()->setDefaultSectionSize(30);
|
||||||
|
|
||||||
|
int i=0;
|
||||||
|
for(int r=0; r<_paramNumsTable->rowCount(); r++){
|
||||||
|
for(int c=0; c<_paramNumsTable->columnCount(); c++){
|
||||||
|
QString val = QString::number(i);
|
||||||
|
_paramNumsTable->setItem(r,c,new QTableWidgetItem(val));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mainLayout->addWidget(_paramNumsTable);
|
||||||
|
mainWidget->setFixedSize(670,270);
|
||||||
|
mainWidget->setLayout(mainLayout);
|
||||||
|
this->setCentralWidget(mainWidget);
|
||||||
|
|
||||||
|
connect(_paramNumsTable,SIGNAL(cellDoubleClicked(int,int)),parent,SLOT(updateParamCell(int,int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paramWindow::~paramWindow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,16 @@
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
#include <QTableWidget>
|
||||||
|
|
||||||
class paramWindow : public QMainWindow
|
class paramWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit paramWindow(QWidget *parent = 0);
|
explicit paramWindow(QWidget *parent = 0);
|
||||||
|
~paramWindow();
|
||||||
|
|
||||||
|
QTableWidget* _paramNumsTable;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue