Search in sources :

Example 71 with IParameter

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

the class ParamsMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
    d.clear();
    if (this.model.hasSelectedDevice()) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        d.setCell(0, 0, cursorDevice.getName(8).toUpperCase(Locale.US));
        final Optional<String> selectedItem = cursorDevice.getParameterPageBank().getSelectedItem();
        if (selectedItem.isPresent())
            d.setCell(1, 0, selectedItem.get().toUpperCase(Locale.US));
        for (int i = 0; i < 8; i++) {
            final IParameter p = this.bank.getItem(i);
            final String name = StringUtils.shortenAndFixASCII(p.getName(8), 8).toUpperCase(Locale.US);
            if (!name.isEmpty())
                d.setCell(0, 1 + i, name).setCell(1, 1 + i, checkForUpperCase(StringUtils.shortenAndFixASCII(p.getDisplayedValue(8), 8)));
            d.setBar(1 + i, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB1, i)).isTouched() && p.doesExist(), p.getValue());
        }
    } else
        d.setCell(0, 3, "  PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "DEVICE").allDone();
    d.allDone();
}
Also used : Kontrol1Display(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display) IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 72 with IParameter

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

the class ParamsMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IValueChanger valueChanger = this.model.getValueChanger();
    final IParameterPageBank parameterPageBank = this.cursorDevice.getParameterPageBank();
    final Optional<String> selectedItem = parameterPageBank.getSelectedItem();
    final String selectedPage = selectedItem.isPresent() ? StringUtils.optimizeName(selectedItem.get(), 8) : "";
    final int[] vuData = new int[16];
    for (int i = 0; i < 8; i++) {
        final IParameter parameter = this.bank.getItem(i);
        // Track Available
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_AVAILABLE, TrackType.GENERIC, i);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_SELECTED, parameter.isSelected() ? 1 : 0, i);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_RECARM, 0, i);
        final boolean exists = parameter.doesExist();
        final String info = exists ? parameter.getDisplayedValue(8) : " ";
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME_TEXT, 0, i, info);
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_PAN_TEXT, 0, i, info);
        final String name = exists ? this.cursorDevice.getName(8) + "\n" + selectedPage + "\n" + parameter.getName(16) : "None";
        this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_NAME, 0, i, name);
        final int j = 2 * i;
        vuData[j] = valueChanger.toMidiValue(parameter.getModulatedValue());
        vuData[j + 1] = valueChanger.toMidiValue(parameter.getModulatedValue());
    }
    this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_VU, 2, 0, vuData);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) IParameterPageBank(de.mossgrabers.framework.daw.data.bank.IParameterPageBank)

Example 73 with IParameter

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

the class MaschineJamSwingCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (this.surface.isSelectPressed()) {
        if (event == ButtonEvent.DOWN) {
            final IParameter parameter = this.model.getGroove().getParameter(GrooveParameterID.ENABLED);
            parameter.setValue(parameter.getValue() == 0 ? this.model.getValueChanger().getUpperBound() - 1 : 0);
            this.mvHelper.delayDisplay(() -> parameter.getName() + ": " + parameter.getDisplayedValue());
        }
        return;
    }
    if (event == ButtonEvent.DOWN) {
        this.surface.getViewManager().setTemporary(Views.SHUFFLE);
        this.encoderManager.enableTemporaryEncodeMode(EncoderMode.TEMPORARY_SWING);
    } else if (event == ButtonEvent.UP) {
        this.surface.getViewManager().restore();
        this.encoderManager.disableTemporaryEncodeMode();
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter)

Example 74 with IParameter

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

the class LaunchkeyMk3ParameterMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    if (this.areKnobs) {
        // Display device and current parameter page
        final StringBuilder sb = new StringBuilder();
        if (this.cursorDevice.doesExist())
            sb.append(this.cursorDevice.getName(8)).append(' ').append(this.cursorDevice.getParameterPageBank().getSelectedItem());
        else
            sb.append("No device");
        d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, sb.toString());
        final ICursorTrack cursorTrack = this.model.getCursorTrack();
        final String trackText = cursorTrack.doesExist() ? String.format("%d: %s", Integer.valueOf(cursorTrack.getPosition() + 1), cursorTrack.getName()) : "No sel. track";
        d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE + 1, 0, trackText);
    }
    final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
    // Format track names
    final IParameterBank parameterBank = this.cursorDevice.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter item = parameterBank.getItem(i);
        final boolean exists = item.doesExist();
        final int offset = i * 2;
        d.setCell(row + offset, 0, exists ? item.getName() : "No parameter");
        d.setCell(row + offset + 1, 0, exists ? item.getDisplayedValue() : "");
    }
    // Add master fader
    if (!this.areKnobs) {
        final IMasterTrack masterTrack = this.model.getMasterTrack();
        d.setCell(row + 16, 0, "Master");
        d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorTrack(de.mossgrabers.framework.daw.data.ICursorTrack) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 75 with IParameter

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

the class ParameterMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    this.isKnobTouched[index] = isTouched;
    if (!this.cursorDevice.doesExist())
        return;
    final IParameter item = this.cursorDevice.getParameterBank().getItem(index);
    if (!item.doesExist())
        return;
    if (isTouched && this.surface.isDeletePressed()) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        item.resetValue();
    }
    item.touchValue(isTouched);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter)

Aggregations

IParameter (de.mossgrabers.framework.daw.data.IParameter)76 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)17 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)14 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)6 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)6 IGroove (de.mossgrabers.framework.daw.IGroove)5 Display (de.mossgrabers.framework.controller.display.Display)4 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)4 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)4 PushDisplay (de.mossgrabers.push.controller.PushDisplay)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)2 FaderConfig (de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)2