当前位置: 首页>>代码示例>>C++>>正文


C++ HotcueControl类代码示例

本文整理汇总了C++中HotcueControl的典型用法代码示例。如果您正苦于以下问题:C++ HotcueControl类的具体用法?C++ HotcueControl怎么用?C++ HotcueControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HotcueControl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lock

void CueControl::hintReader(QVector<Hint>* pHintList) {
    QMutexLocker lock(&m_mutex);

    Hint cue_hint;
    double cuePoint = m_pCuePoint->get();
    if (cuePoint >= 0) {
        cue_hint.sample = m_pCuePoint->get();
        cue_hint.length = 0;
        cue_hint.priority = 10;
        pHintList->append(cue_hint);
    }

    for (int i = 0; i < m_iNumHotCues; ++i) {
        HotcueControl* pControl = m_hotcueControl[i];
        Cue *pCue = pControl->getCue();
        if (pCue != NULL) {
            double position = pControl->getPosition()->get();
            if (position != -1) {
                cue_hint.sample = position;
                if (cue_hint.sample % 2 != 0)
                    cue_hint.sample--;
                cue_hint.length = 0;
                cue_hint.priority = 10;
                pHintList->push_back(cue_hint);
            }
        }
    }
}
开发者ID:Gussss,项目名称:mixxx,代码行数:28,代码来源:cuecontrol.cpp

示例2: hintReader

void CueControl::hintReader(HintVector* pHintList) {
    Hint cue_hint;
    double cuePoint = m_pCuePoint->get();
    if (cuePoint >= 0) {
        cue_hint.sample = m_pCuePoint->get();
        cue_hint.length = 0;
        cue_hint.priority = 10;
        pHintList->append(cue_hint);
    }

    // this is called from the engine thread
    // it is no locking required, because m_hotcueControl is filled during the
    // constructor and getPosition()->get() is a ControlObject
    for (QList<HotcueControl*>::const_iterator it = m_hotcueControl.constBegin();
         it != m_hotcueControl.constEnd(); ++it) {
        HotcueControl* pControl = *it;
        double position = pControl->getPosition()->get();
        if (position != -1) {
            cue_hint.sample = position;
            if (cue_hint.sample % 2 != 0)
                cue_hint.sample--;
            cue_hint.length = 0;
            cue_hint.priority = 10;
            pHintList->append(cue_hint);
        }
    }
}
开发者ID:AndreiRO,项目名称:mixxx,代码行数:27,代码来源:cuecontrol.cpp

示例3: detachCue

void CueControl::detachCue(int hotCue) {
    HotcueControl* pControl = m_hotcueControls.value(hotCue, NULL);
    if (pControl == NULL) {
        return;
    }
    CuePointer pCue(pControl->getCue());
    if (!pCue)
        return;
    disconnect(pCue.get(), 0, this, 0);
    pControl->resetCue();
}
开发者ID:DJMaxergy,项目名称:mixxx,代码行数:11,代码来源:cuecontrol.cpp

示例4: detachCue

void CueControl::detachCue(int hotCue) {
    if (hotCue < 0 || hotCue >= m_iNumHotCues) {
        return;
    }
    HotcueControl* pControl = m_hotcueControl[hotCue];
    Cue* pCue = pControl->getCue();
    if (!pCue)
        return;
    disconnect(pCue, 0, this, 0);
    pControl->setCue(NULL);
    pControl->getPosition()->set(-1);
    pControl->getEnabled()->set(0);
}
开发者ID:Gussss,项目名称:mixxx,代码行数:13,代码来源:cuecontrol.cpp

示例5: lock

void CueControl::trackCuesUpdated() {
    QMutexLocker lock(&m_mutex);
    QSet<int> active_hotcues;

    if (!m_pLoadedTrack)
        return;

    const QList<CuePointer> cuePoints(m_pLoadedTrack->getCuePoints());
    QListIterator<CuePointer> it(cuePoints);
    while (it.hasNext()) {
        CuePointer pCue(it.next());

        if (pCue->getType() != Cue::CUE && pCue->getType() != Cue::LOAD)
            continue;

        int hotcue = pCue->getHotCue();
        if (hotcue != -1) {
            HotcueControl* pControl = m_hotcueControls.value(hotcue, NULL);

            // Cue's hotcue doesn't have a hotcue control.
            if (pControl == NULL) {
                continue;
            }

            CuePointer pOldCue(pControl->getCue());

            // If the old hotcue is different than this one.
            if (pOldCue != pCue) {
                // If the old hotcue exists, detach it
                if (pOldCue) {
                    detachCue(hotcue);
                }
                attachCue(pCue, hotcue);
            } else {
                // If the old hotcue is the same, then we only need to update
                pControl->setPosition(pCue->getPosition());
            }
            // Add the hotcue to the list of active hotcues
            active_hotcues.insert(hotcue);
        }
    }

    // Detach all hotcues that are no longer present
    for (int i = 0; i < m_iNumHotCues; ++i) {
        if (!active_hotcues.contains(i)) {
            detachCue(i);
        }
    }
}
开发者ID:DJMaxergy,项目名称:mixxx,代码行数:49,代码来源:cuecontrol.cpp

示例6: detachCue

void CueControl::detachCue(int hotCue) {
    HotcueControl* pControl = m_hotcueControl.value(hotCue, NULL);
    if (pControl == NULL) {
        return;
    }
    Cue* pCue = pControl->getCue();
    if (!pCue)
        return;
    disconnect(pCue, 0, this, 0);
    // clear pCue first because we have a null check for valid data else where
    // in the code
    pControl->setCue(NULL);
    pControl->getPosition()->set(-1); // invalidate position for hintReader()
    pControl->getEnabled()->set(0);
}
开发者ID:AndreiRO,项目名称:mixxx,代码行数:15,代码来源:cuecontrol.cpp

示例7: attachCue

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);

}
开发者ID:DJMaxergy,项目名称:mixxx,代码行数:15,代码来源:cuecontrol.cpp

示例8: attachCue

void CueControl::attachCue(Cue* pCue, int hotCue) {
    if (hotCue < 0 || hotCue >= m_iNumHotCues) {
        return;
    }
    HotcueControl* pControl = m_hotcueControl[hotCue];
    if (pControl->getCue() != NULL) {
        detachCue(pControl->getHotcueNumber());
    }
    pControl->setCue(pCue);
    connect(pCue, SIGNAL(updated()),
            this, SLOT(cueUpdated()),
            Qt::DirectConnection);

    pControl->getPosition()->set(pCue->getPosition());
    pControl->getEnabled()->set(pCue->getPosition() == -1 ? 0.0 : 1.0);
}
开发者ID:Gussss,项目名称:mixxx,代码行数:16,代码来源:cuecontrol.cpp

示例9: attachCue

void CueControl::attachCue(Cue* pCue, int hotCue) {
    HotcueControl* pControl = m_hotcueControl.value(hotCue, NULL);
    if (pControl == NULL) {
        return;
    }
    if (pControl->getCue() != NULL) {
        detachCue(pControl->getHotcueNumber());
    }
    connect(pCue, 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);

}
开发者ID:AndreiRO,项目名称:mixxx,代码行数:19,代码来源:cuecontrol.cpp


注:本文中的HotcueControl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。