Skip to content

Commit

Permalink
engine: fix multi-head intensity palette
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Nov 6, 2024
1 parent 8a5a946 commit 7872029
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions engine/src/qlcpalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,20 @@ QList<SceneValue> QLCPalette::valuesFromFixtures(Doc *doc, QList<quint32> fixtur
case Dimmer:
{
int dValue = value().toInt();
quint32 intCh = fixture->type() == QLCFixtureDef::Dimmer ?
quint32 masterIntensityChannel = fixture->type() == QLCFixtureDef::Dimmer ?
0 : fixture->masterIntensityChannel();

if (intCh != QLCChannel::invalid())
{
if (fType != Flat)
dValue = int((qreal(intFanValue - dValue) * factor) + dValue);
if (fType != Flat)
dValue = int((qreal(intFanValue - dValue) * factor) + dValue);

list << SceneValue(id, intCh, uchar(dValue));
if (masterIntensityChannel != QLCChannel::invalid())
list << SceneValue(id, masterIntensityChannel, uchar(dValue));

for (int i = 0; i < fixture->heads(); i++)
{
quint32 headDimmerChannel = fixture->channelNumber(QLCChannel::Intensity, QLCChannel::MSB, i);
if (headDimmerChannel != QLCChannel::invalid())
list << SceneValue(id, headDimmerChannel, uchar(dValue));
}
}
break;
Expand Down

0 comments on commit 7872029

Please sign in to comment.