Skip to content

Commit

Permalink
engine: fix wrong channel offset on autodetection
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Dec 24, 2018
1 parent 37cfb16 commit 58b1684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions debian/changelog
Expand Up @@ -2,6 +2,7 @@ qlcplus (4.12.1) stable; urgency=low


* engine/RGBMatrix: fix crash when a fixture group has out of bounds heads * engine/RGBMatrix: fix crash when a fixture group has out of bounds heads
* engine/EFX: fix crash when previewing a cloned EFX * engine/EFX: fix crash when previewing a cloned EFX
* Simple Desk: fix wrong channel offset
* Virtual Console/Slider: fix Click & Go not applied to channels * Virtual Console/Slider: fix Click & Go not applied to channels
* Virtual Console/Frame: fix geometry after move in collapsed state * Virtual Console/Frame: fix geometry after move in collapsed state
* New fixture: American DJ FREQ Matrix Quad (thanks to Rasmus Ahlberg) * New fixture: American DJ FREQ Matrix Quad (thanks to Rasmus Ahlberg)
Expand Down
8 changes: 7 additions & 1 deletion engine/src/fadechannel.cpp
Expand Up @@ -102,14 +102,18 @@ void FadeChannel::unsetTypeFlag(int flag)


void FadeChannel::autoDetect(const Doc *doc) void FadeChannel::autoDetect(const Doc *doc)
{ {
bool fixtureWasInvalid = false;
// reset before autodetecting // reset before autodetecting
setType(0); setType(0);


/* on invalid fixture, channel number is most likely /* on invalid fixture, channel number is most likely
* absolute (SimpleDesk/CueStack do it this way), so attempt * absolute (SimpleDesk/CueStack do it this way), so attempt
* a reverse lookup to try and find the Fixture ID */ * a reverse lookup to try and find the Fixture ID */
if (m_fixture == Fixture::invalidId()) if (m_fixture == Fixture::invalidId())
{
fixtureWasInvalid = true;
m_fixture = doc->fixtureForAddress(channel()); m_fixture = doc->fixtureForAddress(channel());
}


Fixture *fixture = doc->fixture(m_fixture); Fixture *fixture = doc->fixture(m_fixture);
if (fixture == NULL) if (fixture == NULL)
Expand All @@ -123,7 +127,9 @@ void FadeChannel::autoDetect(const Doc *doc)
m_universe = fixture->universe(); m_universe = fixture->universe();
m_address = fixture->address(); m_address = fixture->address();


if (m_channel >= fixture->channels()) // if the fixture was invalid at the beginning of this method
// it means channel was an absolute address, so, fix it
if (fixtureWasInvalid)
m_channel -= fixture->address(); m_channel -= fixture->address();


const QLCChannel *channel = fixture->channel(m_channel); const QLCChannel *channel = fixture->channel(m_channel);
Expand Down

0 comments on commit 58b1684

Please sign in to comment.