Skip to content

Commit

Permalink
ui: a few fixes for attribute override usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Aug 13, 2017
1 parent fc2fd22 commit b10c2cb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion engine/src/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ int Function::requestAttributeOverride(int attributeIndex, qreal value)

calculateOverrideValue(attributeIndex);

qDebug() << name() << "Override requested for attribute" << attributeIndex << "returned" << m_lastOverrideAttributeId;
qDebug() << name() << "Override requested for attribute" << attributeIndex << "value" << value << "ID" << m_lastOverrideAttributeId;

m_lastOverrideAttributeId++;

Expand Down
10 changes: 5 additions & 5 deletions ui/src/virtualconsole/vcbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void VCButton::notifyFunctionStarting(quint32 fid, qreal intensity)
if (f != NULL)
{
f->stop(functionParent());
m_intensityOverrideId = -1;
resetIntensityOverrideAttribute();
}
}
}
Expand All @@ -433,7 +433,7 @@ void VCButton::slotFunctionRemoved(quint32 fid)
if (fid == m_function)
{
setFunction(Function::invalidId());
m_intensityOverrideId = -1;
resetIntensityOverrideAttribute();
}
}

Expand Down Expand Up @@ -679,7 +679,7 @@ void VCButton::pressFunction()
if (state() == Active && !(isChildOfSoloFrame() && f->startedAsChild()))
{
f->stop(functionParent());
m_intensityOverrideId = -1;
resetIntensityOverrideAttribute();
}
else
{
Expand Down Expand Up @@ -747,7 +747,7 @@ void VCButton::slotFunctionStopped(quint32 fid)
{
if (fid == m_function && m_action == Toggle)
{
m_intensityOverrideId = -1;
resetIntensityOverrideAttribute();
setState(Inactive);
blink(250);
}
Expand Down Expand Up @@ -822,7 +822,7 @@ QMenu* VCButton::customMenu(QMenu* parentMenu)

void VCButton::adjustIntensity(qreal val)
{
if (state() != Monitoring)
if (state() == Active)
{
Function* func = m_doc->function(m_function);
if (func != NULL)
Expand Down
4 changes: 2 additions & 2 deletions ui/src/virtualconsole/vccuelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void VCCueList::slotFunctionRemoved(quint32 fid)
if (fid == m_chaserID)
{
setChaser(Function::invalidId());
m_intensityOverrideId = -1;
resetIntensityOverrideAttribute();
}
}

Expand Down Expand Up @@ -954,7 +954,7 @@ void VCCueList::stopChaser()
if (ch == NULL)
return;
ch->stop(functionParent());
m_intensityOverrideId = -1;
resetIntensityOverrideAttribute();
}

void VCCueList::setNextPrevBehavior(NextPrevBehavior nextPrev)
Expand Down
3 changes: 1 addition & 2 deletions ui/src/virtualconsole/vcslider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,6 @@ void VCSlider::writeDMXPlayback(MasterTimer* timer, QList<Universe *> ua)
if (value == 0)
{
// Make sure we ignore the fade out time
adjustFunctionIntensity(function, 0);
if (function->stopped() == false)
{
function->stop(functionParent());
Expand All @@ -1130,9 +1129,9 @@ void VCSlider::writeDMXPlayback(MasterTimer* timer, QList<Universe *> ua)
function->start(timer, functionParent(),
0, 0, Function::defaultSpeed(), Function::defaultSpeed());
#endif
adjustFunctionIntensity(function, pIntensity * intensity());
function->start(timer, functionParent());
}
adjustFunctionIntensity(function, pIntensity * intensity());
emit functionStarting(m_playbackFunction, pIntensity);
}
m_playbackChangeCounter--;
Expand Down
2 changes: 2 additions & 0 deletions ui/src/virtualconsole/vcwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ void VCWidget::adjustFunctionIntensity(Function *f, qreal value)
if (f == NULL)
return;

//qDebug() << "adjustFunctionIntensity" << caption() << "value" << value;

if (m_intensityOverrideId == Function::invalidAttributeId())
m_intensityOverrideId = f->requestAttributeOverride(Function::Intensity, value);
else
Expand Down

0 comments on commit b10c2cb

Please sign in to comment.