Exemplo n.º 1
0
void VCSlider::slotModeChanged(Doc::Mode mode)
{
    if (mode == Doc::Operate)
    {
        m_topLabel->setEnabled(true);
        if (m_slider)
            m_slider->setEnabled(true);
        if (m_knob)
            m_knob->setEnabled(true);
        m_bottomLabel->setEnabled(true);
        m_tapButton->setEnabled(true);
        m_cngButton->setEnabled(true);

        if (sliderMode() == Playback)
        {
            /* Follow playback function running/stopped status in case the
               function is started from another control. */
            Function* function = m_doc->function(playbackFunction());
            if (function != NULL)
            {
                connect(function, SIGNAL(running(quint32)),
                        this, SLOT(slotPlaybackFunctionRunning(quint32)));
                connect(function, SIGNAL(stopped(quint32)),
                        this, SLOT(slotPlaybackFunctionStopped(quint32)));
                connect(function, SIGNAL(intensityChanged(qreal)),
                        this, SLOT(slotPlaybackFunctionIntensityChanged(qreal)));
            }
        }
    }
    else
    {
        m_topLabel->setEnabled(false);
        if (m_slider)
            m_slider->setEnabled(false);
        if (m_knob)
            m_knob->setEnabled(false);
        m_bottomLabel->setEnabled(false);
        m_tapButton->setEnabled(false);
        m_cngButton->setEnabled(false);

        if (sliderMode() == Playback)
        {
            /* Stop following playback function running/stopped status in case
               the function is changed in Design mode to another. */
            Function* function = m_doc->function(playbackFunction());
            if (function != NULL)
            {
                disconnect(function, SIGNAL(running(quint32)),
                        this, SLOT(slotPlaybackFunctionRunning(quint32)));
                disconnect(function, SIGNAL(stopped(quint32)),
                        this, SLOT(slotPlaybackFunctionStopped(quint32)));
                disconnect(function, SIGNAL(intensityChanged(qreal)),
                        this, SLOT(slotPlaybackFunctionIntensityChanged(qreal)));
            }
        }
    }

    VCWidget::slotModeChanged(mode);
}
Exemplo n.º 2
0
void VCSlider::setPlaybackFunction(quint32 fid)
{
    Function* old = m_doc->function(m_playbackFunction);
    if (old != NULL)
    {
        /* Get rid of old function connections */
        disconnect(old, SIGNAL(running(quint32)),
                this, SLOT(slotPlaybackFunctionRunning(quint32)));
        disconnect(old, SIGNAL(stopped(quint32)),
                this, SLOT(slotPlaybackFunctionStopped(quint32)));
        disconnect(old, SIGNAL(attributeChanged(int, qreal)),
                this, SLOT(slotPlaybackFunctionIntensityChanged(int, qreal)));
    }
Exemplo n.º 3
0
void VCSlider::slotModeChanged(Doc::Mode mode)
{
    if (mode == Doc::Operate)
    {
        enableWidgetUI(true);

        if (sliderMode() == Playback)
        {
            /* Follow playback function running/stopped status in case the
               function is started from another control. */
            Function* function = m_doc->function(playbackFunction());
            if (function != NULL)
            {
                connect(function, SIGNAL(running(quint32)),
                        this, SLOT(slotPlaybackFunctionRunning(quint32)));
                connect(function, SIGNAL(stopped(quint32)),
                        this, SLOT(slotPlaybackFunctionStopped(quint32)));
                connect(function, SIGNAL(attributeChanged(int, qreal)),
                        this, SLOT(slotPlaybackFunctionIntensityChanged(int, qreal)));
            }