void CueControl::attachCue(CuePointer pCue, int hotCue) { HotcueControl* pControl = m_hotcueControls.value(hotCue, NULL); if (pControl == NULL) { return; } if (pControl->getCue() != NULL) { detachCue(pControl->getHotcueNumber()); } connect(pCue.get(), SIGNAL(updated()), this, SLOT(cueUpdated()), Qt::DirectConnection); pControl->setCue(pCue); }
void CueControl::attachCue(CuePointer pCue, int hotCue) { HotcueControl* pControl = m_hotcueControl.value(hotCue, NULL); if (pControl == NULL) { return; } if (pControl->getCue() != NULL) { detachCue(pControl->getHotcueNumber()); } connect(pCue.get(), SIGNAL(updated()), this, SLOT(cueUpdated()), Qt::DirectConnection); pControl->getPosition()->set(pCue->getPosition()); pControl->getEnabled()->set(pCue->getPosition() == -1 ? 0.0 : 1.0); // set pCue only if all other data is in place // because we have a null check for valid data else where in the code pControl->setCue(pCue); }