Example #1
0
void GeneratorSine::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropFreqScale = propertyManager()->addProperty(QVariant::Double, "Frequency scale");
    m_pPropFreqScale->setAttribute("minimum", 0.01);
    m_pPropFreqScale->setAttribute("maximum", 100.0);
    m_pPropFreqScale->setAttribute("singleStep", 1.0);
    m_pPropFreqScale->setValue(1.0);

    m_pPropAmplitude = propertyManager()->addProperty(QVariant::Double, "Amplitude");
    m_pPropAmplitude->setAttribute("minimum", 0.0);
    m_pPropAmplitude->setAttribute("maximum", 1.0);
    m_pPropAmplitude->setValue(1.0);

    m_pPropPhase = propertyManager()->addProperty(QVariant::Double, "Phase, \302\260");
    m_pPropPhase->setAttribute("minumum", -180.0);
    m_pPropPhase->setAttribute("maximum", 180);
    m_pPropPhase->setValue(0.0);

    pRoot->addSubProperty(m_pPropFreqScale);
    pRoot->addSubProperty(m_pPropAmplitude);
    pRoot->addSubProperty(m_pPropPhase);

    // Property change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_ASSERT(pProperty);
        setValues();
    });
}
Example #2
0
void Generator::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropWaveform = propertyManager()->addProperty(QtVariantPropertyManager::enumTypeId(), "Waveform");
    QVariantList list;
    list << "Sine" << "Sawtooth" << "Square" << "Triangle";
    m_pPropWaveform->setAttribute("enumNames", list);
    m_pPropWaveform->setValue(0);

    m_pPropBandPassLimit = propertyManager()->addProperty(QVariant::Bool, "Limit bandpass");
    m_pPropBandPassLimit->setValue(false);

    m_pPropTrigger = propertyManager()->addProperty(QVariant::Bool, "Trigger");
    m_pPropTrigger->setValue(false);
    m_pPropTrigger->setToolTip("Reset generator phase to zero when key is pressed");

    pRoot->addSubProperty(m_pPropWaveform);
    pRoot->addSubProperty(m_pPropBandPassLimit);
    pRoot->addSubProperty(m_pPropTrigger);

    // Properties change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        setValues();
    });
}
Example #3
0
void StkFreeVerb::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();
    m_pPropRoomSize = propertyManager()->addProperty(QVariant::Double, "Room size");
    setPropertyAttrs(m_pPropRoomSize, 0.0f, 1.0f, 0.1f, 0.5f);

    m_pPropDamping = propertyManager()->addProperty(QVariant::Double, "Damping");
    setPropertyAttrs(m_pPropDamping, 0.0f, 1.0f, 0.1f, 0.4f);

    m_pPropWidth = propertyManager()->addProperty(QVariant::Double, "Left-right mix");
    setPropertyAttrs(m_pPropWidth, 0.0f, 1.0f, 0.1f, 1.0f);

    m_pPropFrozen = propertyManager()->addProperty(QVariant::Bool, "Frozen");
    m_pPropFrozen->setValue(false);

    m_pPropEffectMix = propertyManager()->addProperty(QVariant::Double, "Effect mix");
    setPropertyAttrs(m_pPropEffectMix, 0.0f, 1.0f, 0.1f, 0.75f);

    pRoot->addSubProperty(m_pPropRoomSize);
    pRoot->addSubProperty(m_pPropDamping);
    pRoot->addSubProperty(m_pPropWidth);
    pRoot->addSubProperty(m_pPropFrozen);
    pRoot->addSubProperty(m_pPropEffectMix);

    // Properties change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        setValues();
    });
}
Example #4
0
void MidiIn::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    QtVariantProperty *pPropPitchBend = propertyManager()->addProperty(propertyManager()->groupTypeId(), "Pitch bend");

    m_pPropPitchBendSemitones = propertyManager()->addProperty(QVariant::Int, "Semitones");
    m_pPropPitchBendSemitones->setAttribute("minimum", 1);
    m_pPropPitchBendSemitones->setAttribute("maximum", 24);
    m_pPropPitchBendSemitones->setValue(1);

    pPropPitchBend->addSubProperty(m_pPropPitchBendSemitones);
    pRoot->addSubProperty(pPropPitchBend);
}
Example #5
0
QtVariantProperty *TreeWidgetEditor::setupPropertyGroup(const QString &title, PropertyDefinition *propDefs)
{
    setupProperties(propDefs);
    QtVariantProperty *groupProp = m_propertyManager->addProperty(QtVariantPropertyManager::groupTypeId(), title);
    foreach (QtVariantProperty *prop, m_rootProperties)
        groupProp->addSubProperty(prop);
    m_rootProperties.clear();
    return groupProp;
}
Example #6
0
void LHPFilter::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pFilterType = propertyManager()->addProperty(QtVariantPropertyManager::enumTypeId(), "Filter type");
    QVariantList list;
    list << "Low-pass" << "High-pass";
    m_pFilterType->setAttribute("enumNames", list);
    m_pFilterType->setValue(0);
    pRoot->addSubProperty(m_pFilterType);

}
Example #7
0
void Dial::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropLabel = propertyManager()->addProperty(QVariant::String, "Label");
    m_pPropLabel->setValue(plugin()->name());

    m_pPropValue = propertyManager()->addProperty(QVariant::Double, "Value");
    m_pPropValue->setValue(0.0);
    m_pPropValue->setAttribute("decimals", 2);
    m_pPropValue->setAttribute("singleStep", 0.1);

    m_pPropMin = propertyManager()->addProperty(QVariant::Double, "Mininum");
    m_pPropMin->setValue(0.0);
    m_pPropMin->setAttribute("decimals", 2);
    m_pPropMin->setAttribute("signleStep", 0.1);


    m_pPropMax = propertyManager()->addProperty(QVariant::Double, "Maximum");
    m_pPropMax->setValue(1.0);
    m_pPropMax->setAttribute("decimals", 2);
    m_pPropMax->setAttribute("signleStep", 0.1);

    m_pPropSteps = propertyManager()->addProperty(QVariant::Int, "Steps");
    m_pPropSteps->setValue(10);
    m_pPropSteps->setAttribute("minimum", 2);

    QObject::connect(propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        updateDialValues();
    });

    pRoot->addSubProperty(m_pPropLabel);
    pRoot->addSubProperty(m_pPropValue);
    pRoot->addSubProperty(m_pPropMin);
    pRoot->addSubProperty(m_pPropMax);
    pRoot->addSubProperty(m_pPropSteps);

    updateDialValues();
}
Example #8
0
void StkCubic::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    QtVariantProperty *pCoefs = propertyManager()->addProperty(propertyManager()->groupTypeId(), "Coefficients");

    m_pPropA1 = propertyManager()->addProperty(QVariant::Double, "A1");
    m_pPropA1->setAttribute("singleStep", 0.0);
    m_pPropA1->setValue(1.0);
    pCoefs->addSubProperty(m_pPropA1);

    m_pPropA2 = propertyManager()->addProperty(QVariant::Double, "A2");
    m_pPropA2->setAttribute("singleStep", 0.0);
    m_pPropA2->setValue(0.0);
    pCoefs->addSubProperty(m_pPropA2);

    m_pPropA3 = propertyManager()->addProperty(QVariant::Double, "A3");
    m_pPropA3->setAttribute("singleStep", 0.0);
    m_pPropA3->setValue(-1.0 / 3.0);
    pCoefs->addSubProperty(m_pPropA3);


    m_pPropThreshold = propertyManager()->addProperty(QVariant::Double, "Threshold");
    m_pPropThreshold->setAttribute("minimum", 0.0);
    m_pPropThreshold->setAttribute("maximum", 1.0);
    m_pPropThreshold->setAttribute("singleStep", 0.1);
    m_pPropThreshold->setValue(0.66);

    pRoot->addSubProperty(pCoefs);
    pRoot->addSubProperty(m_pPropThreshold);

    // Properties change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        setValues();
    });
}
Example #9
0
 //-----------------------------------------------------------------------
 // Class MacroLinkItem
 //-----------------------------------------------------------------------
 void MacroLinkItem::setupProperties(WndProperties& propWnd) const
 {
   QtVariantPropertyManager& propManager = propWnd.infoPropertyManager();
   QtVariantProperty* item;
   QtVariantProperty* group;
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("General"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Link type"));
   item->setValue(edge().srcPin().data()->dataRef().staticCast<app::MacroPin>()->getType());
   group->addSubProperty(item);
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("Source"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Macro"));
   item->setValue(edge().srcPin().data()->vertex().dataRef().staticCast<app::Macro>()->getName());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Output pin"));
   item->setValue(edge().srcPin().data()->dataRef().staticCast<app::MacroPin>()->getName());
   group->addSubProperty(item);
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("Destination"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Macro"));
   item->setValue(edge().destPin().data()->vertex().dataRef().staticCast<app::Macro>()->getName());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Input pin"));
   item->setValue(edge().destPin().data()->dataRef().staticCast<app::MacroPin>()->getName());
   group->addSubProperty(item);
 }
Example #10
0
void ExposedInput::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();
    m_pPropName = propertyManager()->addProperty(QVariant::String, "Name");
    m_pPropName->setValue("input");

    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        // Update text item with the value for the property.
        QtVariantProperty *pV = dynamic_cast<QtVariantProperty*>(pProperty);
        if (pV == m_pPropName) {
            if (m_pNameItem != nullptr) {
                m_pNameItem->setText(pV->valueText() + " ");
            }
        }
    });
    pRoot->addSubProperty(m_pPropName);
}
Example #11
0
 void MacroItem::setupProperties(WndProperties& propWnd) const
 {
   QtVariantPropertyManager& propManager = propWnd.infoPropertyManager();
   QtVariantProperty* item;
   QtVariantProperty* group;
   app::Macro::Ptr macro = vertex().dataRef().staticCast<app::Macro>();
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("General"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Macro"));
   item->setValue(macro->getName());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Instance UUID"));
   item->setValue(vertex().id().toString());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Creator"));
   item->setValue(macro->getCreator());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Group"));
   item->setValue(macro->getGroup());
   group->addSubProperty(item);
   QtVariantProperty* libItem = propManager.addProperty(QVariant::String, QObject::tr("Library"));
   libItem->setValue(macro->getLibrary().getName());
   group->addSubProperty(libItem);
   item = propManager.addProperty(QVariant::String, QObject::tr("Libray file"));
   item->setValue(macro->getLibrary().getPath());
   libItem->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Version"));
   item->setValue(macro->getLibrary().getVersionString());
   libItem->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Build"));
   item->setValue(macro->getLibrary().getBuildType());
   libItem->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Build date"));
   item->setValue(macro->getLibrary().getBuildDate());
   libItem->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Qt version"));
   item->setValue(macro->getLibrary().getQtVersionString());
   libItem->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Creator"));
   item->setValue(macro->getLibrary().getCreator());
   libItem->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("API Version"));
   item->setValue(macro->getLibrary().getAPIVersionString());
   libItem->addSubProperty(item);
   // setup QML
   propWnd.setQMLProperties(macro.toWeakRef());
 }