void VCSlider::setSliderMode(SliderMode mode) { Q_ASSERT(mode >= Level && mode <= GrandMaster); if (mode != m_sliderMode) Tardis::instance()->enqueueAction(VCSliderSetMode, id(), m_sliderMode, mode); m_sliderMode = mode; emit sliderModeChanged(mode); setRangeLowLimit(0); setRangeHighLimit(UCHAR_MAX); setControlledAttribute(Function::Intensity); m_controlledAttributeId = Function::invalidAttributeId(); switch(mode) { case Level: case Adjust: setValue(0); m_doc->masterTimer()->registerDMXSource(this); break; case Submaster: setValue(UCHAR_MAX); m_doc->masterTimer()->unregisterDMXSource(this); break; case GrandMaster: setValueDisplayStyle(PercentageValue); setValue(UCHAR_MAX); m_doc->masterTimer()->unregisterDMXSource(this); break; } }
void VCSlider::setSliderMode(SliderMode mode) { Q_ASSERT(mode >= Level && mode <= GrandMaster); if (mode != m_sliderMode) Tardis::instance()->enqueueAction(Tardis::VCSliderSetMode, id(), m_sliderMode, mode); m_sliderMode = mode; emit sliderModeChanged(mode); setRangeLowLimit(0); setRangeHighLimit(UCHAR_MAX); setControlledAttribute(Function::Intensity); m_controlledAttributeId = Function::invalidAttributeId(); switch (mode) { case Level: case Adjust: setValue(0); m_doc->masterTimer()->registerDMXSource(this); break; case Submaster: setValue(UCHAR_MAX); break; case GrandMaster: setValueDisplayStyle(PercentageValue); setValue(UCHAR_MAX); break; } if (mode == Submaster || mode == GrandMaster) { m_doc->masterTimer()->unregisterDMXSource(this); // request to delete all the active faders foreach (GenericFader *fader, m_fadersMap.values()) fader->requestDelete(); m_fadersMap.clear(); } }