bool VCSlider::copyFrom(const VCWidget *widget) { const VCSlider *slider = qobject_cast<const VCSlider*> (widget); if (slider == nullptr) return false; /* Copy widget style */ setWidgetStyle(slider->widgetStyle()); /* Copy level stuff */ setRangeLowLimit(slider->rangeLowLimit()); setRangeHighLimit(slider->rangeHighLimit()); for (SceneValue scv : slider->levelChannels()) addLevelChannel(scv.fxi, scv.channel); /* Copy playback stuff */ setControlledFunction(slider->controlledFunction()); /* Copy slider appearance */ setValueDisplayStyle(slider->valueDisplayStyle()); setInvertedAppearance(slider->invertedAppearance()); /* Copy Click & Go feature */ setClickAndGoType(slider->clickAndGoType()); /* Copy mode & current value */ setSliderMode(slider->sliderMode()); setValue(slider->value(), false, false); /* Copy monitor mode */ setMonitorEnabled(slider->monitorEnabled()); /* Copy common stuff */ return VCWidget::copyFrom(widget); }
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(); } }