Skip to content

Commit

Permalink
engine: fix channel default value
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Apr 30, 2018
1 parent 6d76321 commit ef519c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions engine/src/fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void Fixture::setFixtureDefinition(QLCFixtureDef* fixtureDef,
{
if (fixtureDef != NULL && fixtureMode != NULL)
{
int i;
int i, chNum;

if (m_fixtureDef != NULL && m_fixtureDef != fixtureDef &&
m_fixtureDef->manufacturer() == KXMLFixtureGeneric &&
Expand All @@ -506,6 +506,7 @@ void Fixture::setFixtureDefinition(QLCFixtureDef* fixtureDef,

m_fixtureDef = fixtureDef;
m_fixtureMode = fixtureMode;
chNum = fixtureMode->channels().size();

// If there are no head entries in the mode, create one that contains
// all channels. This const_cast is a bit heretic, but it's easier this
Expand All @@ -514,14 +515,14 @@ void Fixture::setFixtureDefinition(QLCFixtureDef* fixtureDef,
if (fixtureMode->heads().size() == 0)
{
QLCFixtureHead head;
for (i = 0; i < fixtureMode->channels().size(); i++)
for (i = 0; i < chNum; i++)
head.addChannel(i);
fixtureMode->insertHead(-1, head);
}
m_values.resize(fixtureMode->channels().size());
m_aliasInfo.resize(fixtureMode->channels().size());

for (i = 0; i < fixtureMode->channels().size(); i++)
m_aliasInfo.resize(chNum);

for (i = 0; i < chNum; i++)
{
QLCChannel *channel = fixtureMode->channel(i);
const QList <QLCCapability*> capsList = channel->capabilities();
Expand Down
2 changes: 1 addition & 1 deletion engine/src/universe.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ protected slots:
/** Set all intensity channel values to zero */
void zeroIntensityChannels();

/** Return a list with intesity channels and their values */
/** Return a list with intensity channels and their values */
QHash <int, uchar> intensityChannels();

/** Set all channel relative values to zero */
Expand Down

0 comments on commit ef519c2

Please sign in to comment.