Exemplo n.º 1
0
void VCSoloFrame::slotModeChanged(Doc::Mode mode)
{
    VCFrame::slotModeChanged(mode);

    // Get all buttons in this soloFrame
    QListIterator <VCButton*> it(findChildren<VCButton*>());

    while (it.hasNext() == true)
    {
        VCButton* button = it.next();

        // make sure the buttons nearest soloframe is this
        if (thisIsNearestSoloFrameParent(button))
        {
            if (mode == Doc::Operate)
            {
                // listen to when the button function is started
                connect(button, SIGNAL(functionStarting()),
                        this, SLOT(slotButtonFunctionStarting()),
                        Qt::DirectConnection);
            }
            else
            {
                // remove listener
                connect(button, SIGNAL(functionStarting()),
                        this, SLOT(slotButtonFunctionStarting()));
            }
        }
    }
}
Exemplo n.º 2
0
void VCAudioTriggers::enableCapture(bool enable)
{
    // in case the audio input device has been changed in the meantime...
    QSharedPointer<AudioCapture> capture(m_doc->audioInputCapture());
    bool captureIsNew = m_inputCapture != capture.data();
    m_inputCapture = capture.data();

    if (enable == true)
    {
        if (m_inputCapture->isInitialized() == false)
            m_inputCapture->initialize();
        connect(m_inputCapture, SIGNAL(dataProcessed(double*,int,double,quint32)),
                this, SLOT(slotDisplaySpectrum(double*,int,double,quint32)));
        m_inputCapture->registerBandsNumber(m_spectrum->barsNumber());

        m_button->blockSignals(true);
        m_button->setChecked(true);
        m_button->blockSignals(false);

        // Invalid ID: Stop every other widget
        emit functionStarting(Function::invalidId());
    }
    else
    {
        if (!captureIsNew)
Exemplo n.º 3
0
void VCAudioTriggers::enableCapture(bool enable)
{
    if (enable == true)
    {
        // in case the audio input device has been changed in the meantime...
        m_inputCapture = m_doc->audioInputCapture();

        if (m_inputCapture->isInitialized() == false)
        {
            if (m_inputCapture->initialize(44100, 1, 2048) == false)
            {
                QMessageBox::warning(this, tr("Audio open error"),
                                     tr("An error occurred while initializing the selected audio device. Please review your audio input settings."));
                m_button->setChecked(false);
                return;
            }
        }
        m_inputCapture->registerBandsNumber(m_spectrum->barsNumber());
        // Invalid ID: Stop every other widget
        emit functionStarting(Function::invalidId());
        connect(m_inputCapture, SIGNAL(dataProcessed(double*,int,double,quint32)),
                this, SLOT(slotDisplaySpectrum(double*,int,double,quint32)));
        if (m_inputCapture->isRunning() == false)
            m_inputCapture->start();
        m_button->blockSignals(true);
        m_button->setChecked(true);
        m_button->blockSignals(false);
    }
Exemplo n.º 4
0
int VCButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = VCWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: functionStarting(); break;
        case 1: slotChooseIcon(); break;
        case 2: slotResetIcon(); break;
        case 3: slotKeyPressed((*reinterpret_cast< const QKeySequence(*)>(_a[1]))); break;
        case 4: slotKeyReleased((*reinterpret_cast< const QKeySequence(*)>(_a[1]))); break;
        case 5: slotInputValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2])),(*reinterpret_cast< uchar(*)>(_a[3]))); break;
        case 6: slotFunctionRemoved((*reinterpret_cast< quint32(*)>(_a[1]))); break;
        case 7: slotFunctionRunning((*reinterpret_cast< quint32(*)>(_a[1]))); break;
        case 8: slotFunctionStopped((*reinterpret_cast< quint32(*)>(_a[1]))); break;
        case 9: slotFunctionFlashing((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
        case 10: slotBlinkReady(); break;
        default: ;
        }
        _id -= 11;
    }
    return _id;
}