Skip to content

Commit

Permalink
ui: fix some more cross universe cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Jan 4, 2025
1 parent 86d67f3 commit b85bfec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions engine/src/doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ bool Doc::addFixture(Fixture* fixture, quint32 id, bool crossUniverse)
m_addresses[i] = id;
}

if (crossUniverse)
uni = floor((fixture->universeAddress() + fixture->channels()) / 512);

if (uni >= inputOutputMap()->universesCount())
{
for (i = inputOutputMap()->universesCount(); i <= uni; i++)
Expand Down
16 changes: 8 additions & 8 deletions ui/src/fixturemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,15 +1202,15 @@ void FixtureManager::slotAddRGBPanel()
if (address + fxi->channels() > 512)
{
if (!rgb.crossUniverse())
uniIndex++;

if (m_doc->inputOutputMap()->getUniverseID(uniIndex) == m_doc->inputOutputMap()->invalidUniverse())
{
m_doc->inputOutputMap()->addUniverse();
m_doc->inputOutputMap()->startUniverses();
}
if (!rgb.crossUniverse())
uniIndex++;
address = 0;
}
}
if (m_doc->inputOutputMap()->getUniverseID(uniIndex) == m_doc->inputOutputMap()->invalidUniverse())
{
m_doc->inputOutputMap()->addUniverse();
m_doc->inputOutputMap()->startUniverses();
}

fxi->setUniverse(m_doc->inputOutputMap()->getUniverseID(uniIndex));
Expand All @@ -1220,7 +1220,7 @@ void FixtureManager::slotAddRGBPanel()
m_doc->addFixture(fxi, Fixture::invalidId(), rgb.crossUniverse());

address += fxi->channels();
if (address > 512 && rgb.crossUniverse())
if (address >= 512 && rgb.crossUniverse())
{
address -= 512;
uniIndex++;
Expand Down

0 comments on commit b85bfec

Please sign in to comment.