Issue #731 - Conversion issues (Inputs) fixed
This commit is contained in:
@@ -29,9 +29,9 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
|
||||
exposLayout->addWidget(qbClear,2,2);
|
||||
exposLayout->addWidget(qbDown,2,3);
|
||||
|
||||
connect(ExposlistWidget, SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(expolistWidget_customContextMenuRequested(QPoint)));
|
||||
connect(ExposlistWidget, SIGNAL(doubleClicked(QModelIndex)),this,SLOT(expolistWidget_doubleClicked(QModelIndex)));
|
||||
connect(ExposlistWidget, SIGNAL(mimeDropped(int,const QMimeData*,Qt::DropAction)),this,SLOT(mimeExpoDropped(int,const QMimeData*,Qt::DropAction)));
|
||||
connect(ExposlistWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(expolistWidget_customContextMenuRequested(QPoint)));
|
||||
connect(ExposlistWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(expolistWidget_doubleClicked(QModelIndex)));
|
||||
connect(ExposlistWidget, SIGNAL(mimeDropped(int,const QMimeData*,Qt::DropAction)), this, SLOT(mimeExpoDropped(int, const QMimeData*, Qt::DropAction)));
|
||||
|
||||
connect(qbUp, SIGNAL(pressed()),SLOT(moveExpoUp()));
|
||||
connect(qbDown, SIGNAL(pressed()),SLOT(moveExpoDown()));
|
||||
@@ -58,7 +58,7 @@ void InputsPanel::update()
|
||||
ExposlistWidget->clear();
|
||||
int curDest = -1;
|
||||
|
||||
for(int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
ExpoData *md = &model.expoData[i];
|
||||
|
||||
if (md->mode==0) break;
|
||||
@@ -144,26 +144,24 @@ void InputsPanel::update()
|
||||
|
||||
bool InputsPanel::gm_insertExpo(int idx)
|
||||
{
|
||||
if (idx<0 || idx>=C9X_MAX_EXPOS || model.expoData[C9X_MAX_EXPOS-1].mode > 0) {
|
||||
QMessageBox::information(this, "companion", tr("Not enough available inputs!"));
|
||||
return false;
|
||||
}
|
||||
if (idx<0 || idx>=C9X_MAX_EXPOS || model.expoData[C9X_MAX_EXPOS-1].mode > 0) {
|
||||
QMessageBox::information(this, "Companion", tr("Not enough available inputs!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
int chn = model.expoData[idx].chn;
|
||||
memmove(&model.expoData[idx+1],&model.expoData[idx],
|
||||
(C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData) );
|
||||
memset(&model.expoData[idx],0,sizeof(ExpoData));
|
||||
model.expoData[idx].chn = chn;
|
||||
model.expoData[idx].weight = 100;
|
||||
model.expoData[idx].mode = 3 /* TODO enum */;
|
||||
return true;
|
||||
int chn = model.expoData[idx].chn;
|
||||
|
||||
ExpoData * newExpo = model.insertInput(idx);
|
||||
newExpo->chn = chn;
|
||||
newExpo->weight = 100;
|
||||
newExpo->mode = INPUT_MODE_BOTH;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InputsPanel::gm_deleteExpo(int index)
|
||||
{
|
||||
memmove(&model.expoData[index],&model.expoData[index+1],
|
||||
(C9X_MAX_EXPOS-(index+1))*sizeof(ExpoData));
|
||||
memset(&model.expoData[C9X_MAX_EXPOS-1],0,sizeof(ExpoData));
|
||||
model.removeInput(index);
|
||||
}
|
||||
|
||||
void InputsPanel::gm_openExpo(int index)
|
||||
|
||||
@@ -6,24 +6,19 @@
|
||||
class MixersList : public QListWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MixersList(QWidget *parent, bool expo);
|
||||
// QMimeData * mimeData ( const QList<QListWidgetItem *> items );
|
||||
|
||||
public:
|
||||
explicit MixersList(QWidget *parent, bool expo);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void mimeDropped(int index, const QMimeData *data, Qt::DropAction action);
|
||||
void keyWasPressed(QKeyEvent *event);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
public slots:
|
||||
public slots:
|
||||
bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
||||
|
||||
private:
|
||||
private:
|
||||
QPoint dragStartPosition;
|
||||
bool expo;
|
||||
|
||||
|
||||
@@ -53,15 +53,16 @@ void MixesPanel::update()
|
||||
int i;
|
||||
unsigned int outputs = GetEepromInterface()->getCapability(Outputs);
|
||||
int showNames = false; // TODO in a menu ui->showNames_Ckb->isChecked();
|
||||
for(i=0; i<GetEepromInterface()->getCapability(Mixes); i++) {
|
||||
for (i=0; i<GetEepromInterface()->getCapability(Mixes); i++) {
|
||||
MixData *md = &model.mixData[i];
|
||||
if ((md->destCh==0) || (md->destCh>outputs+(unsigned int)GetEepromInterface()->getCapability(ExtraChannels))) continue;
|
||||
QString str = "";
|
||||
while(curDest<(md->destCh-1)) {
|
||||
while (curDest<(md->destCh-1)) {
|
||||
curDest++;
|
||||
if (curDest > outputs) {
|
||||
str = tr("X%1 ").arg(curDest-outputs);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
str = tr("CH%1%2").arg(curDest/10).arg(curDest%10);
|
||||
if (GetEepromInterface()->getCapability(HasChNames) && showNames) {
|
||||
QString name=model.limitData[curDest-1].name;
|
||||
@@ -80,7 +81,8 @@ void MixesPanel::update()
|
||||
|
||||
if (md->destCh > outputs) {
|
||||
str = tr("X%1 ").arg(md->destCh-outputs);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
str = tr("CH%1%2").arg(md->destCh/10).arg(md->destCh%10);
|
||||
str.append(" ");
|
||||
if (GetEepromInterface()->getCapability(HasChNames) && showNames) {
|
||||
@@ -97,7 +99,7 @@ void MixesPanel::update()
|
||||
str.fill(' ');
|
||||
}
|
||||
|
||||
switch(md->mltpx) {
|
||||
switch (md->mltpx) {
|
||||
case (1): str += " *"; break;
|
||||
case (2): str += " R"; break;
|
||||
default: str += " "; break;
|
||||
@@ -110,7 +112,9 @@ void MixesPanel::update()
|
||||
QString phasesStr = getPhasesStr(md->phases, model);
|
||||
if (!phasesStr.isEmpty()) str += " " + phasesStr;
|
||||
|
||||
if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString());
|
||||
if (md->swtch.type != SWITCH_TYPE_NONE) {
|
||||
str += " " + tr("Switch(%1)").arg(md->swtch.toString());
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
if (md->carryTrim>0) {
|
||||
@@ -125,9 +129,9 @@ void MixesPanel::update()
|
||||
if (md->sOffset) str += " " + tr("Offset(%1)").arg(getGVarString(md->sOffset));
|
||||
if (md->curve.value) str += " " + md->curve.toString();
|
||||
|
||||
int scale=GetEepromInterface()->getCapability(SlowScale);
|
||||
if (scale==0)
|
||||
scale=1;
|
||||
int scale = GetEepromInterface()->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (md->delayDown || md->delayUp)
|
||||
str += tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale);
|
||||
if (md->speedDown || md->speedUp)
|
||||
@@ -144,8 +148,8 @@ void MixesPanel::update()
|
||||
qba.append((quint8)i);
|
||||
qba.append((const char*)md, sizeof(MixData));
|
||||
QListWidgetItem *itm = new QListWidgetItem(str);
|
||||
itm->setData(Qt::UserRole,qba); // mix number
|
||||
MixerlistWidget->addItem(itm);//(str);
|
||||
itm->setData(Qt::UserRole, qba); // mix number
|
||||
MixerlistWidget->addItem(itm); //(str);
|
||||
}
|
||||
|
||||
while(curDest<outputs+GetEepromInterface()->getCapability(ExtraChannels)) {
|
||||
|
||||
Reference in New Issue
Block a user