Search in sources :

Example 6 with IParameterBank

use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.

the class FireUserMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final IParameterBank userBank = this.model.getUserParameterBank();
    final int page = userBank.getScrollPosition() / userBank.getPageSize();
    final String desc = "User Page: " + (page + 1);
    String paramLine = "";
    int value = -1;
    final int touchedKnob = this.getTouchedKnob();
    if (touchedKnob > -1) {
        final IParameter p = userBank.getItem(touchedKnob);
        paramLine = p.getName(5);
        if (paramLine.isEmpty())
            paramLine = "Not mapped";
        else {
            value = p.getValue();
            paramLine += ": " + p.getDisplayedValue(6);
        }
    }
    display.addElement(new TitleValueComponent(desc, paramLine, value, false));
    display.send();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 7 with IParameterBank

use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.

the class SLControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final SLControlSurface surface = this.getSurface();
    for (int i = 0; i < 8; i++) {
        final int index = i;
        this.addFader(ContinuousID.get(ContinuousID.FADER1, i), "Fader " + (i + 1), null, BindType.CC, SLControlSurface.MKII_SLIDER1 + i);
        final IHwRelativeKnob relativeKnob = this.addRelativeKnob(ContinuousID.get(ContinuousID.DEVICE_KNOB1, i), "Device Knob " + (i + 1), null, SLControlSurface.MKII_KNOB_ROW1_1 + i, RelativeEncoding.SIGNED_BIT);
        relativeKnob.addOutput(() -> {
            final boolean hasDevice = this.model.hasSelectedDevice();
            final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
            return hasDevice ? parameterBank.getItem(index).getValue() : 0;
        }, value -> surface.getMidiOutput().sendCC(0x70 + index, Math.min(value * 11 / 127, 11)));
        this.addAbsoluteKnob(ContinuousID.get(ContinuousID.KNOB1, i), "Knob " + (i + 1), null, SLControlSurface.MKII_KNOB_ROW2_1 + i);
    }
    this.addFader(ContinuousID.TOUCHPAD_X, "Touchpad X", new TouchpadCommand(true, this.model, surface), BindType.CC, SLControlSurface.MKII_TOUCHPAD_X);
    this.addFader(ContinuousID.TOUCHPAD_Y, "Touchpad Y", new TouchpadCommand(false, this.model, surface), BindType.CC, SLControlSurface.MKII_TOUCHPAD_Y);
    // These are no faders but cannot be mapped to any meaningful control anyway
    this.addFader(ContinuousID.HELLO, "Tap Init", new TapTempoInitMkICommand(this.model, surface), BindType.CC, SLControlSurface.MKI_BUTTON_TAP_TEMPO);
    this.addFader(ContinuousID.TEMPO, "Tap Tempo", new TapTempoMkICommand(this.model, surface), BindType.CC, SLControlSurface.MKI_BUTTON_TAP_TEMPO_VALUE);
    // Volume, Track and Parameter modes are always bound since they have dedicated controls
    final ModeManager modeManager = surface.getModeManager();
    modeManager.get(Modes.VOLUME).onActivate();
    modeManager.get(Modes.TRACK).onActivate();
    modeManager.get(Modes.DEVICE_PARAMS).onActivate();
}
Also used : IHwRelativeKnob(de.mossgrabers.framework.controller.hardware.IHwRelativeKnob) TapTempoMkICommand(de.mossgrabers.controller.novation.sl.command.continuous.TapTempoMkICommand) TapTempoInitMkICommand(de.mossgrabers.controller.novation.sl.command.continuous.TapTempoInitMkICommand) SLControlSurface(de.mossgrabers.controller.novation.sl.controller.SLControlSurface) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) TouchpadCommand(de.mossgrabers.controller.novation.sl.command.continuous.TouchpadCommand) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 8 with IParameterBank

use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.

the class MVHelper method notifySelectedUserPage.

/**
 * Display the name of the selected user parameter page.
 */
public void notifySelectedUserPage() {
    this.delayDisplay(() -> {
        final IParameterBank userBank = this.model.getUserParameterBank();
        final int page = userBank.getScrollPosition() / userBank.getPageSize();
        return "User Page: " + (page + 1);
    });
}
Also used : IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank)

Example 9 with IParameterBank

use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.

the class UserMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.drawDisplay2();
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    // Row 1 & 2
    final int extenderOffset = this.surface.getExtenderOffset();
    final IParameterBank parameterBank = this.model.getUserParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(extenderOffset + i);
        d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(6), 6) : "").setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(6), 6));
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank)

Example 10 with IParameterBank

use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.

the class UserMode method updateKnobLEDs.

/**
 * {@inheritDoc}
 */
@Override
public void updateKnobLEDs() {
    final int upperBound = this.model.getValueChanger().getUpperBound();
    final int extenderOffset = this.surface.getExtenderOffset();
    final IParameterBank parameterBank = this.model.getUserParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(extenderOffset + i);
        this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_SINGLE_DOT, param.doesExist() ? Math.max(1, param.getValue()) : 0, upperBound);
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank)

Aggregations

IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)25 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)14 IParameter (de.mossgrabers.framework.daw.data.IParameter)14 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)5 ITrack (de.mossgrabers.framework.daw.data.ITrack)4 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)3 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)3 IDevice (de.mossgrabers.framework.daw.data.IDevice)2 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 Modes (de.mossgrabers.framework.mode.Modes)2 ACVSConfiguration (de.mossgrabers.controller.akai.acvs.ACVSConfiguration)1 ACVSDisplay (de.mossgrabers.controller.akai.acvs.controller.ACVSDisplay)1 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)1 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)1 FlexiCommand (de.mossgrabers.controller.generic.controller.FlexiCommand)1 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)1 TapTempoInitMkICommand (de.mossgrabers.controller.novation.sl.command.continuous.TapTempoInitMkICommand)1