Search in sources :

Example 1 with IParameterProvider

use of de.mossgrabers.framework.parameterprovider.IParameterProvider in project DrivenByMoss by git-moss.

the class BaseMode method bindControls.

/**
 * {@inheritDoc}
 */
@Override
protected void bindControls() {
    if (!this.isActive || this.defaultParameterProvider == null)
        return;
    super.bindControls();
    final IParameterProvider parameterProvider;
    if (this.surface.getConfiguration().useFadersAsKnobs())
        parameterProvider = this.getParameterProvider();
    else
        parameterProvider = ((AbstractMode<?, ?, ?>) this.surface.getModeManager().get(Modes.VOLUME)).getParameterProvider();
    for (int i = 0; i < this.controls.size(); i++) this.surface.getContinuous(ContinuousID.get(ContinuousID.FADER1, i)).bind(parameterProvider.get(i));
}
Also used : IParameterProvider(de.mossgrabers.framework.parameterprovider.IParameterProvider) AbstractMode(de.mossgrabers.framework.featuregroup.AbstractMode)

Example 2 with IParameterProvider

use of de.mossgrabers.framework.parameterprovider.IParameterProvider in project DrivenByMoss by git-moss.

the class AbstractMode method getKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public int getKnobValue(final int index) {
    final IParameterProvider parameterProvider = this.getParameterProvider();
    if (parameterProvider == null)
        return -1;
    final IParameter param = parameterProvider.get(index);
    return param.doesExist() ? param.getValue() : -1;
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IParameterProvider(de.mossgrabers.framework.parameterprovider.IParameterProvider)

Aggregations

IParameterProvider (de.mossgrabers.framework.parameterprovider.IParameterProvider)2 IParameter (de.mossgrabers.framework.daw.data.IParameter)1 AbstractMode (de.mossgrabers.framework.featuregroup.AbstractMode)1