void VCSlider::setSliderMode(SliderMode mode) { Q_ASSERT(mode >= Bus && mode <= Submaster); /* Disconnect these to prevent double callbacks and non-needes signals */ disconnect(Bus::instance(), SIGNAL(nameChanged(quint32, const QString&)), this, SLOT(slotBusNameChanged(quint32, const QString&))); disconnect(Bus::instance(), SIGNAL(valueChanged(quint32, quint32)), this, SLOT(slotBusValueChanged(quint32, quint32))); /* Unregister this as a DMX source if the new mode is not "Level" */ if (m_sliderMode == Level && mode != Level) _app->masterTimer()->unregisterDMXSource(this); m_sliderMode = mode; if (mode == Bus) { /* Set the slider range */ m_slider->setRange(busLowLimit() * MasterTimer::frequency(), busHighLimit() * MasterTimer::frequency()); setSliderValue(Bus::instance()->value(bus())); slotSliderMoved(sliderValue()); /* Reconnect to bus emitter */ connect(Bus::instance(), SIGNAL(nameChanged(quint32, const QString&)), this, SLOT(slotBusNameChanged(quint32, const QString&))); connect(Bus::instance(), SIGNAL(valueChanged(quint32, quint32)), this, SLOT(slotBusValueChanged(quint32, quint32))); m_bottomLabel->hide(); m_tapButton->show(); m_time->start(); }
void VCSlider::setSliderMode(SliderMode mode) { Q_ASSERT(mode >= Bus && mode <= Submaster); /* Disconnect these to prevent double callbacks and non-essential signals (with Level & Submaster modes) */ disconnect(Bus::emitter(), SIGNAL(nameChanged(t_bus_id, const QString&)), this, SLOT(slotBusNameChanged(t_bus_id, const QString&))); disconnect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)), this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value))); m_sliderMode = mode; if (mode == Bus) { /* Set the slider range */ m_slider->setRange(busLowLimit() * KFrequency, busHighLimit() * KFrequency); /* Reconnect to bus emitter */ connect(Bus::emitter(), SIGNAL(nameChanged(t_bus_id, const QString&)), this, SLOT(slotBusNameChanged(t_bus_id, const QString&))); connect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)), this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value))); m_bottomLabel->hide(); m_tapButton->show(); m_time->start(); }