feat(cpn): Only show active channels in source lists (#3971)

This commit is contained in:
Neil Horne
2023-09-02 18:45:29 +10:00
committed by GitHub
parent 71b0614503
commit cb08a4de25
3 changed files with 18 additions and 0 deletions
+3
View File
@@ -351,6 +351,9 @@ bool RawSource::isAvailable(const ModelData * const model, const GeneralSettings
return false; return false;
} }
} }
if (type == SOURCE_TYPE_CH && !model->hasMixes(index))
return false;
} }
if (gs) { if (gs) {
+14
View File
@@ -187,6 +187,7 @@ void MixesPanel::gm_openMix(int index)
if(dlg->exec()) { if(dlg->exec()) {
model->mixData[index] = mixd; model->mixData[index] = mixd;
emit modified(); emit modified();
updateItemModels();
update(); update();
} }
else { else {
@@ -194,6 +195,7 @@ void MixesPanel::gm_openMix(int index)
gm_deleteMix(index); gm_deleteMix(index);
} }
mixInserted = false; mixInserted = false;
updateItemModels();
update(); update();
} }
delete dlg; delete dlg;
@@ -275,6 +277,7 @@ void MixesPanel::mixersDelete(bool prompt)
mixersDeleteList(list); mixersDeleteList(list);
emit modified(); emit modified();
updateItemModels();
update(); update();
} }
@@ -331,6 +334,7 @@ void MixesPanel::pasteMixerMimeData(const QMimeData * mimeData, int destIdx)
} }
emit modified(); emit modified();
updateItemModels();
update(); update();
} }
} }
@@ -519,6 +523,7 @@ void MixesPanel::moveMixUp()
highlightList << gm_moveMix(idx, false); highlightList << gm_moveMix(idx, false);
} }
emit modified(); emit modified();
updateItemModels();
update(); update();
setSelectedByMixList(highlightList); setSelectedByMixList(highlightList);
} }
@@ -531,6 +536,7 @@ void MixesPanel::moveMixDown()
highlightList << gm_moveMix(idx, true); highlightList << gm_moveMix(idx, true);
} }
emit modified(); emit modified();
updateItemModels();
update(); update();
setSelectedByMixList(highlightList); setSelectedByMixList(highlightList);
} }
@@ -540,6 +546,7 @@ void MixesPanel::clearMixes()
if (QMessageBox::question(this, tr("Clear Mixes?"), tr("Really clear all the mixes?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { if (QMessageBox::question(this, tr("Clear Mixes?"), tr("Really clear all the mixes?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
model->clearMixes(); model->clearMixes();
emit modified(); emit modified();
updateItemModels();
update(); update();
} }
} }
@@ -567,3 +574,10 @@ void MixesPanel::onItemModelUpdateComplete()
lock = false; lock = false;
} }
} }
void MixesPanel::updateItemModels()
{
lock = true;
sharedItemModels->update(AbstractItemModel::IMUE_Channels);
}
+1
View File
@@ -82,6 +82,7 @@ class MixesPanel : public ModelPanel
void AddMixerLine(int dest); void AddMixerLine(int dest);
QString getMixerText(int dest, bool newChannel); QString getMixerText(int dest, bool newChannel);
void connectItemModelEvents(const int id); void connectItemModelEvents(const int id);
void updateItemModels();
}; };
#endif // _MIXES_H_ #endif // _MIXES_H_