fix(color): Crash on inputs/mixes pages mixes/expos limit reached (#2985)
This commit is contained in:
@@ -47,15 +47,6 @@ uint8_t getExposCount()
|
||||
return count;
|
||||
}
|
||||
|
||||
bool reachExposLimit()
|
||||
{
|
||||
if (getExposCount() >= MAX_EXPOS) {
|
||||
POPUP_WARNING(STR_NOFREEEXPO);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: these functions need to be added to the generic API
|
||||
// used by all radios, and be removed from UI code
|
||||
//
|
||||
@@ -181,6 +172,15 @@ ModelInputsPage::ModelInputsPage():
|
||||
});
|
||||
}
|
||||
|
||||
bool ModelInputsPage::reachExposLimit()
|
||||
{
|
||||
if (getExposCount() >= MAX_EXPOS) {
|
||||
new MessageDialog(form, STR_WARNING, STR_NOFREEEXPO);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
InputMixGroup* ModelInputsPage::getGroupBySrc(mixsrc_t src)
|
||||
{
|
||||
auto g =
|
||||
|
||||
@@ -59,4 +59,6 @@ class ModelInputsPage : public PageTab
|
||||
void pasteInput(uint8_t dst_idx, uint8_t input);
|
||||
void pasteInputBefore(uint8_t dst_idx);
|
||||
void pasteInputAfter(uint8_t dst_idx);
|
||||
|
||||
bool reachExposLimit();
|
||||
};
|
||||
|
||||
@@ -64,15 +64,6 @@ uint8_t getMixesCount()
|
||||
return count;
|
||||
}
|
||||
|
||||
bool reachMixesLimit()
|
||||
{
|
||||
if (getMixesCount() >= MAX_MIXERS) {
|
||||
POPUP_WARNING(STR_NOFREEMIXER);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void insertMix(uint8_t idx, uint8_t channel)
|
||||
{
|
||||
pauseMixerCalculations();
|
||||
@@ -312,6 +303,15 @@ ModelMixesPage::ModelMixesPage() :
|
||||
setIcon(ICON_MODEL_MIXER);
|
||||
}
|
||||
|
||||
bool ModelMixesPage::reachMixesLimit()
|
||||
{
|
||||
if (getMixesCount() >= MAX_MIXERS) {
|
||||
new MessageDialog(form, STR_WARNING, STR_NOFREEMIXER);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
InputMixGroup* ModelMixesPage::getGroupByIndex(uint8_t index)
|
||||
{
|
||||
MixData* mix = mixAddress(index);
|
||||
|
||||
@@ -53,4 +53,6 @@ class ModelMixesPage : public ModelInputsPage
|
||||
void pasteMixAfter(uint8_t dst_idx);
|
||||
|
||||
void enableMonitors(bool enabled);
|
||||
|
||||
bool reachMixesLimit();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user