Skip to content

Commit

Permalink
#4056 Number of effects listed on Import Sequence panel
Browse files Browse the repository at this point in the history
  • Loading branch information
derwin12 authored and dkulp committed Jan 26, 2024
1 parent 9c9663e commit 7510ffe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xLights/SeqFileUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,15 +1250,15 @@ void xLightsFrame::ImportXLights(SequenceElements& se, const std::vector<Element
hasEffects |= el->GetEffectLayer(l)->GetEffectCount() > 0;
}
if (hasEffects) {
dlg.AddChannel(el->GetName(), el->GetEffectCount());
dlg.AddChannel(el->GetName(), el->GetModelEffectCount());
}
elementMap[el->GetName()] = el;
int s = 0;
for (size_t sm = 0; sm < el->GetSubModelAndStrandCount(); ++sm) {
SubModelElement* sme = el->GetSubModel(sm);

StrandElement* ste = dynamic_cast<StrandElement*>(sme);
std::string smName = sme->GetName();
std::string smName = sme->GetName();
if (ste != nullptr) {
++s;
if (smName == "") {
Expand Down
12 changes: 12 additions & 0 deletions xLights/sequencer/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,18 @@ bool ModelElement::HasEffects() const
return false;
}

int ModelElement::GetModelEffectCount() const
{
int sum = std::accumulate(
mEffectLayers.begin(),
mEffectLayers.end(), 0,
[](int i, EffectLayer* l) {
return l->GetEffectCount() + i;
});

return sum;
}

int ModelElement::GetEffectCount() const {

int sum = std::accumulate(
Expand Down
1 change: 1 addition & 0 deletions xLights/sequencer/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class ModelElement : public Element

[[nodiscard]] virtual bool HasEffects() const override;
[[nodiscard]] int GetEffectCount() const override;
[[nodiscard]] int GetModelEffectCount() const;
int GetSubModelAndStrandCount() const;
int GetSubModelCount() const;
SubModelElement *GetSubModel(int i) const;
Expand Down

0 comments on commit 7510ffe

Please sign in to comment.