Add static models
This commit is contained in:
@@ -24,6 +24,16 @@
|
|||||||
#include "radiodataconversionstate.h"
|
#include "radiodataconversionstate.h"
|
||||||
#include "compounditemmodels.h"
|
#include "compounditemmodels.h"
|
||||||
|
|
||||||
|
void CustomFunctionData::convert(RadioDataConversionState & cstate)
|
||||||
|
{
|
||||||
|
cstate.setComponent(tr("CFN"), 8);
|
||||||
|
cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
|
||||||
|
swtch.convert(cstate);
|
||||||
|
if (func == FuncVolume || func == FuncBacklight || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
|
||||||
|
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CustomFunctionData::clear()
|
void CustomFunctionData::clear()
|
||||||
{
|
{
|
||||||
memset(reinterpret_cast<void *>(this), 0, sizeof(CustomFunctionData));
|
memset(reinterpret_cast<void *>(this), 0, sizeof(CustomFunctionData));
|
||||||
@@ -95,9 +105,9 @@ QString CustomFunctionData::funcToString(const ModelData * model) const
|
|||||||
else if (func == FuncSetFailsafe)
|
else if (func == FuncSetFailsafe)
|
||||||
return tr("Set Failsafe");
|
return tr("Set Failsafe");
|
||||||
else if (func == FuncRangeCheckInternalModule)
|
else if (func == FuncRangeCheckInternalModule)
|
||||||
return tr("RangeCheck Int. Module");
|
return tr("Range Check Int. Module");
|
||||||
else if (func == FuncRangeCheckExternalModule)
|
else if (func == FuncRangeCheckExternalModule)
|
||||||
return tr("RangeCheck Ext. Module");
|
return tr("Range Check Ext. Module");
|
||||||
else if (func == FuncBindInternalModule)
|
else if (func == FuncBindInternalModule)
|
||||||
return tr("Bind Int. Module");
|
return tr("Bind Int. Module");
|
||||||
else if (func == FuncBindExternalModule)
|
else if (func == FuncBindExternalModule)
|
||||||
@@ -143,17 +153,6 @@ void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox
|
|||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomFunctionData::populatePlaySoundParams(QStringList & qs)
|
|
||||||
{
|
|
||||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
|
||||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CustomFunctionData::populateHapticParams(QStringList & qs)
|
|
||||||
{
|
|
||||||
qs << "0" << "1" << "2" << "3";
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CustomFunctionData::paramToString(const ModelData * model) const
|
QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||||
{
|
{
|
||||||
QStringList qs;
|
QStringList qs;
|
||||||
@@ -164,18 +163,10 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
|||||||
return QString("%1").arg(param / 10.0) + tr("s");
|
return QString("%1").arg(param / 10.0) + tr("s");
|
||||||
}
|
}
|
||||||
else if (func == FuncPlaySound) {
|
else if (func == FuncPlaySound) {
|
||||||
CustomFunctionData::populatePlaySoundParams(qs);
|
return playSoundToString(param);
|
||||||
if (param >= 0 && param < (int)qs.count())
|
|
||||||
return qs.at(param);
|
|
||||||
else
|
|
||||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
|
||||||
}
|
}
|
||||||
else if (func == FuncPlayHaptic) {
|
else if (func == FuncPlayHaptic) {
|
||||||
CustomFunctionData::populateHapticParams(qs);
|
return harpicToString(param);
|
||||||
if (param >= 0 && param < (int)qs.count())
|
|
||||||
return qs.at(param);
|
|
||||||
else
|
|
||||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
|
||||||
}
|
}
|
||||||
else if (func == FuncReset) {
|
else if (func == FuncReset) {
|
||||||
QComboBox cb;
|
QComboBox cb;
|
||||||
@@ -184,7 +175,7 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
|||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
return cb.itemText(pos);
|
return cb.itemText(pos);
|
||||||
else
|
else
|
||||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
return QString(CPN_STR_UNKNOWN_ITEM);
|
||||||
}
|
}
|
||||||
else if (func == FuncVolume || func == FuncPlayValue || func == FuncBacklight) {
|
else if (func == FuncVolume || func == FuncPlayValue || func == FuncBacklight) {
|
||||||
RawSource item(param);
|
RawSource item(param);
|
||||||
@@ -222,7 +213,7 @@ QString CustomFunctionData::repeatToString() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
QString CustomFunctionData::repeatToString(int value) const
|
QString CustomFunctionData::repeatToString(int value)
|
||||||
{
|
{
|
||||||
if (value == -1) {
|
if (value == -1) {
|
||||||
return tr("Played once, not during startup");
|
return tr("Played once, not during startup");
|
||||||
@@ -309,14 +300,9 @@ bool CustomFunctionData::isResetParamAvailable(const ModelData * model, int inde
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomFunctionData::convert(RadioDataConversionState & cstate)
|
QString CustomFunctionData::harpicToString() const
|
||||||
{
|
{
|
||||||
cstate.setComponent(tr("CFN"), 8);
|
return harpicToString(param);
|
||||||
cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
|
|
||||||
swtch.convert(cstate);
|
|
||||||
if (func == FuncVolume || func == FuncBacklight || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
|
|
||||||
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -326,20 +312,27 @@ QString CustomFunctionData::harpicToString(int value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
QStringList CustomFunctionData::playsoundStringList()
|
QStringList CustomFunctionData::playSoundStringList()
|
||||||
{
|
{
|
||||||
return QStringList("Beep 1" "Beep 2" "Beep 3" "Warn 1" "Warn 2" "Cheep" "Ratata" "Tick"
|
QStringList strl;
|
||||||
"Siren" "Ring" "SciFi" "Robot" "Chirp" "Tada" "Crickt" "AlmClk");
|
strl << tr("Beep 1") << tr("Beep 2") << tr("Beep 3") << tr("Warn 1") << tr("Warn 2") << tr("Cheep") << tr("Ratata") << tr("Tick")
|
||||||
|
<< tr("Siren") << tr("Ring") << tr("Sci Fi") << tr("Robot") << tr("Chirp") << tr("Tada") << tr("Cricket") << tr("Alarm Clock");
|
||||||
|
return strl;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CustomFunctionData::playSoundToString() const
|
||||||
|
{
|
||||||
|
return playSoundToString(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
QString CustomFunctionData::playsoundToString(int value)
|
QString CustomFunctionData::playSoundToString(int value)
|
||||||
{
|
{
|
||||||
QStringList strl = playsoundStringList();
|
QStringList strl = playSoundStringList();
|
||||||
if (value < strl.count())
|
if (value < strl.count())
|
||||||
return strl.at(value);
|
return strl.at(value);
|
||||||
else
|
else
|
||||||
return CPN_STR_UNKNOWN_ITEM;
|
return QString(CPN_STR_UNKNOWN_ITEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -357,13 +350,13 @@ AbstractStaticItemModel * CustomFunctionData::repeatItemModel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
AbstractStaticItemModel * CustomFunctionData::playSoundsItemModel()
|
AbstractStaticItemModel * CustomFunctionData::playSoundItemModel()
|
||||||
{
|
{
|
||||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||||
mdl->setName("customfunctiondata.playsounds");
|
mdl->setName("customfunctiondata.playsounds");
|
||||||
|
|
||||||
for (int i = 0; i <= 60; i++) {
|
for (int i = 0; i < playSoundStringList().count(); i++) {
|
||||||
mdl->appendToItemList(playsoundsToString(i), i);
|
mdl->appendToItemList(playSoundToString(i), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
mdl->loadItemList();
|
mdl->loadItemList();
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ class CustomFunctionData {
|
|||||||
unsigned int adjustMode;
|
unsigned int adjustMode;
|
||||||
int repeatParam;
|
int repeatParam;
|
||||||
|
|
||||||
|
void convert(RadioDataConversionState & cstate);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
QString nameToString(int index, bool globalContext = false) const;
|
QString nameToString(int index, bool globalContext = false) const;
|
||||||
@@ -109,24 +111,20 @@ class CustomFunctionData {
|
|||||||
QString paramToString(const ModelData * model) const;
|
QString paramToString(const ModelData * model) const;
|
||||||
QString repeatToString() const;
|
QString repeatToString() const;
|
||||||
QString enabledToString() const;
|
QString enabledToString() const;
|
||||||
QString playsoundsToString() const;
|
QString playSoundToString() const;
|
||||||
QString harpicToString() const;
|
QString harpicToString() const;
|
||||||
|
|
||||||
static void populateResetParams(const ModelData * model, QComboBox * b, unsigned int value);
|
static void populateResetParams(const ModelData * model, QComboBox * b, unsigned int value);
|
||||||
static void populatePlaySoundParams(QStringList & qs);
|
|
||||||
static void populateHapticParams(QStringList & qs);
|
|
||||||
static bool isFuncAvailable(int index);
|
static bool isFuncAvailable(int index);
|
||||||
static int funcContext(int index);
|
static int funcContext(int index);
|
||||||
static int resetParamCount(const ModelData * model);
|
static int resetParamCount(const ModelData * model);
|
||||||
static bool isResetParamAvailable(const ModelData * model, int index);
|
static bool isResetParamAvailable(const ModelData * model, int index);
|
||||||
|
|
||||||
void convert(RadioDataConversionState & cstate);
|
|
||||||
|
|
||||||
static QString repeatToString(int value);
|
static QString repeatToString(int value);
|
||||||
static QStringList playsoundStringList();
|
static QStringList playSoundStringList();
|
||||||
static QString playsoundsToString(int value);
|
static QString playSoundToString(int value);
|
||||||
static QString harpicToString(int value);
|
static QString harpicToString(int value);
|
||||||
static AbstractStaticItemModel * repeatItemModel();
|
static AbstractStaticItemModel * repeatItemModel();
|
||||||
static AbstractStaticItemModel * playsoundsItemModel();
|
static AbstractStaticItemModel * playSoundItemModel();
|
||||||
static AbstractStaticItemModel * harpicItemModel();
|
static AbstractStaticItemModel * harpicItemModel();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "customfunctions.h"
|
#include "customfunctions.h"
|
||||||
|
#include "compounditemmodels.h"
|
||||||
#include "filtereditemmodels.h"
|
#include "filtereditemmodels.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
@@ -77,35 +78,39 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
lock = true;
|
lock = true;
|
||||||
fswCapability = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
fswCapability = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
||||||
|
|
||||||
dlgFilterFactory = new FilteredItemModelFactory();
|
tabModelFactory = new CompoundItemModelFactory(&generalSettings, model);
|
||||||
|
playSoundId = tabModelFactory->registerItemModel(CustomFunctionData::playSoundItemModel());
|
||||||
|
harpicId = tabModelFactory->registerItemModel(CustomFunctionData::harpicItemModel());
|
||||||
|
|
||||||
funcActionsId = dlgFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_CustomFuncAction),
|
tabFilterFactory = new FilteredItemModelFactory();
|
||||||
|
|
||||||
|
funcActionsId = tabFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_CustomFuncAction),
|
||||||
model ? CustomFunctionData::AllFunctionContexts : CustomFunctionData::GlobalFunctionsContext),
|
model ? CustomFunctionData::AllFunctionContexts : CustomFunctionData::GlobalFunctionsContext),
|
||||||
"Function Actions");
|
"Function Actions");
|
||||||
connectItemModelEvents(dlgFilterFactory->getItemModel(funcActionsId));
|
connectItemModelEvents(tabFilterFactory->getItemModel(funcActionsId));
|
||||||
|
|
||||||
funcResetParamId = dlgFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_CustomFuncResetParam)),
|
funcResetParamId = tabFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_CustomFuncResetParam)),
|
||||||
"Reset Params");
|
"Reset Params");
|
||||||
connectItemModelEvents(dlgFilterFactory->getItemModel(funcResetParamId));
|
connectItemModelEvents(tabFilterFactory->getItemModel(funcResetParamId));
|
||||||
|
|
||||||
rawSwitchId = dlgFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSwitch),
|
rawSwitchId = tabFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSwitch),
|
||||||
model ? RawSwitch::SpecialFunctionsContext : RawSwitch::GlobalFunctionsContext),
|
model ? RawSwitch::SpecialFunctionsContext : RawSwitch::GlobalFunctionsContext),
|
||||||
"RawSwitch");
|
"RawSwitch");
|
||||||
connectItemModelEvents(dlgFilterFactory->getItemModel(rawSwitchId));
|
connectItemModelEvents(tabFilterFactory->getItemModel(rawSwitchId));
|
||||||
|
|
||||||
rawSourceAllId = dlgFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource)),
|
rawSourceAllId = tabFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource)),
|
||||||
"RawSource All");
|
"RawSource All");
|
||||||
connectItemModelEvents(dlgFilterFactory->getItemModel(rawSourceAllId));
|
connectItemModelEvents(tabFilterFactory->getItemModel(rawSourceAllId));
|
||||||
|
|
||||||
rawSourceInputsId = dlgFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
rawSourceInputsId = tabFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||||
RawSource::InputSourceGroups),
|
RawSource::InputSourceGroups),
|
||||||
"RawSource Inputs");
|
"RawSource Inputs");
|
||||||
connectItemModelEvents(dlgFilterFactory->getItemModel(rawSourceInputsId));
|
connectItemModelEvents(tabFilterFactory->getItemModel(rawSourceInputsId));
|
||||||
|
|
||||||
rawSourceGVarsId = dlgFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
rawSourceGVarsId = tabFilterFactory->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource),
|
||||||
RawSource::GVarsGroup),
|
RawSource::GVarsGroup),
|
||||||
"RawSource GVars");
|
"RawSource GVars");
|
||||||
connectItemModelEvents(dlgFilterFactory->getItemModel(rawSourceGVarsId));
|
connectItemModelEvents(tabFilterFactory->getItemModel(rawSourceGVarsId));
|
||||||
|
|
||||||
if (!firmware->getCapability(VoicesAsNumbers)) {
|
if (!firmware->getCapability(VoicesAsNumbers)) {
|
||||||
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
|
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
|
||||||
@@ -155,7 +160,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
|
|
||||||
// The switch
|
// The switch
|
||||||
fswtchSwtch[i] = new QComboBox(this);
|
fswtchSwtch[i] = new QComboBox(this);
|
||||||
fswtchSwtch[i]->setModel(dlgFilterFactory->getItemModel(rawSwitchId));
|
fswtchSwtch[i]->setModel(tabFilterFactory->getItemModel(rawSwitchId));
|
||||||
fswtchSwtch[i]->setCurrentIndex(fswtchSwtch[i]->findData(functions[i].swtch.toValue()));
|
fswtchSwtch[i]->setCurrentIndex(fswtchSwtch[i]->findData(functions[i].swtch.toValue()));
|
||||||
fswtchSwtch[i]->setProperty("index", i);
|
fswtchSwtch[i]->setProperty("index", i);
|
||||||
fswtchSwtch[i]->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
fswtchSwtch[i]->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
||||||
@@ -165,7 +170,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
|||||||
|
|
||||||
// The function
|
// The function
|
||||||
fswtchFunc[i] = new QComboBox(this);
|
fswtchFunc[i] = new QComboBox(this);
|
||||||
fswtchFunc[i]->setModel(dlgFilterFactory->getItemModel(funcActionsId));
|
fswtchFunc[i]->setModel(tabFilterFactory->getItemModel(funcActionsId));
|
||||||
fswtchFunc[i]->setCurrentIndex(fswtchFunc[i]->findData(functions[i].func));
|
fswtchFunc[i]->setCurrentIndex(fswtchFunc[i]->findData(functions[i].func));
|
||||||
fswtchFunc[i]->setProperty("index", i);
|
fswtchFunc[i]->setProperty("index", i);
|
||||||
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
|
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
|
||||||
@@ -259,7 +264,8 @@ CustomFunctionsPanel::~CustomFunctionsPanel()
|
|||||||
{
|
{
|
||||||
if (mediaPlayer)
|
if (mediaPlayer)
|
||||||
stopSound(mediaPlayerCurrent);
|
stopSound(mediaPlayerCurrent);
|
||||||
delete dlgFilterFactory;
|
delete tabModelFactory;
|
||||||
|
delete tabFilterFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomFunctionsPanel::onMediaPlayerStateChanged(QMediaPlayer::State state)
|
void CustomFunctionsPanel::onMediaPlayerStateChanged(QMediaPlayer::State state)
|
||||||
@@ -674,37 +680,35 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsi
|
|||||||
QStringList qs;
|
QStringList qs;
|
||||||
b->setModel(new QStandardItemModel(b)); // clear combo box but not any shared item model
|
b->setModel(new QStandardItemModel(b)); // clear combo box but not any shared item model
|
||||||
if (function == FuncPlaySound) {
|
if (function == FuncPlaySound) {
|
||||||
CustomFunctionData::populatePlaySoundParams(qs);
|
b->setModel(tabModelFactory->getItemModel(playSoundId));
|
||||||
b->addItems(qs);
|
b->setCurrentIndex(b->findData(value));
|
||||||
b->setCurrentIndex(value);
|
|
||||||
}
|
}
|
||||||
else if (function == FuncPlayHaptic) {
|
else if (function == FuncPlayHaptic) {
|
||||||
CustomFunctionData::populateHapticParams(qs);
|
b->setModel(tabModelFactory->getItemModel(harpicId));
|
||||||
b->addItems(qs);
|
b->setCurrentIndex(b->findData(value));
|
||||||
b->setCurrentIndex(value);
|
|
||||||
}
|
}
|
||||||
else if (function == FuncReset) {
|
else if (function == FuncReset) {
|
||||||
b->setModel(dlgFilterFactory->getItemModel(funcResetParamId));
|
b->setModel(tabFilterFactory->getItemModel(funcResetParamId));
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
}
|
}
|
||||||
else if (function == FuncVolume || function == FuncBacklight) {
|
else if (function == FuncVolume || function == FuncBacklight) {
|
||||||
b->setModel(dlgFilterFactory->getItemModel(rawSourceInputsId));
|
b->setModel(tabFilterFactory->getItemModel(rawSourceInputsId));
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
}
|
}
|
||||||
else if (function == FuncPlayValue) {
|
else if (function == FuncPlayValue) {
|
||||||
b->setModel(dlgFilterFactory->getItemModel(rawSourceAllId));
|
b->setModel(tabFilterFactory->getItemModel(rawSourceAllId));
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
}
|
}
|
||||||
else if (function >= FuncAdjustGV1 && function <= FuncAdjustGVLast) {
|
else if (function >= FuncAdjustGV1 && function <= FuncAdjustGVLast) {
|
||||||
switch (adjustmode) {
|
switch (adjustmode) {
|
||||||
case 1:
|
case 1:
|
||||||
b->setModel(dlgFilterFactory->getItemModel(rawSourceInputsId));
|
b->setModel(tabFilterFactory->getItemModel(rawSourceInputsId));
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
if (b->currentIndex() < 0)
|
if (b->currentIndex() < 0)
|
||||||
b->setCurrentIndex(0);
|
b->setCurrentIndex(0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
b->setModel(dlgFilterFactory->getItemModel(rawSourceGVarsId));
|
b->setModel(tabFilterFactory->getItemModel(rawSourceGVarsId));
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
if (b->currentIndex() < 0)
|
if (b->currentIndex() < 0)
|
||||||
b->setCurrentIndex(0);
|
b->setCurrentIndex(0);
|
||||||
|
|||||||
@@ -98,13 +98,16 @@ class CustomFunctionsPanel : public GenericPanel
|
|||||||
void resetCBsAndRefresh(int idx);
|
void resetCBsAndRefresh(int idx);
|
||||||
void connectItemModelEvents(FilteredItemModel * itemModel);
|
void connectItemModelEvents(FilteredItemModel * itemModel);
|
||||||
|
|
||||||
FilteredItemModelFactory * dlgFilterFactory;
|
CompoundItemModelFactory * tabModelFactory;
|
||||||
|
FilteredItemModelFactory * tabFilterFactory;
|
||||||
int funcActionsId;
|
int funcActionsId;
|
||||||
int funcResetParamId;
|
int funcResetParamId;
|
||||||
int rawSwitchId;
|
int rawSwitchId;
|
||||||
int rawSourceAllId;
|
int rawSourceAllId;
|
||||||
int rawSourceInputsId;
|
int rawSourceInputsId;
|
||||||
int rawSourceGVarsId;
|
int rawSourceGVarsId;
|
||||||
|
int playSoundId;
|
||||||
|
int harpicId;
|
||||||
|
|
||||||
QSet<QString> tracksSet;
|
QSet<QString> tracksSet;
|
||||||
QSet<QString> scriptsSet;
|
QSet<QString> scriptsSet;
|
||||||
|
|||||||
Reference in New Issue
Block a user