Search in sources :

Example 46 with IParameter

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

the class ParameterView method executeFunction.

/**
 * {@inheritDoc}
 */
@Override
protected void executeFunction(final int padIndex) {
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final IHost host = this.model.getHost();
    if (!cursorDevice.doesExist()) {
        host.showNotification("No device selected.");
        return;
    }
    switch(padIndex) {
        case 12:
            cursorDevice.selectPrevious();
            break;
        case 13:
            cursorDevice.selectNext();
            break;
        case 14:
            cursorDevice.getParameterBank().scrollBackwards();
            this.mvHelper.notifySelectedParameterPage();
            break;
        case 15:
            cursorDevice.getParameterBank().scrollForwards();
            this.mvHelper.notifySelectedParameterPage();
            break;
        default:
            // Not used
            break;
    }
    if (padIndex >= 8)
        return;
    // Flip row 2 and 1 to look the same as in the Bitwig device display
    final int selectedParameter = padIndex < 4 ? padIndex + 4 : padIndex - 4;
    ((SelectedDeviceMode<?, ?>) this.surface.getModeManager().get(Modes.DEVICE_PARAMS)).selectParameter(selectedParameter);
    this.model.getHost().scheduleTask(() -> {
        final StringBuilder message = new StringBuilder();
        final Optional<String> selectedPage = cursorDevice.getParameterPageBank().getSelectedItem();
        if (selectedPage.isEmpty())
            message.append("No parameters available.");
        else {
            message.append(selectedPage.get()).append(": ");
            final IParameter item = cursorDevice.getParameterBank().getItem(selectedParameter);
            if (item.doesExist())
                message.append(item.getName());
            else
                message.append("None");
        }
        host.showNotification(message.toString());
    }, 200);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IHost(de.mossgrabers.framework.daw.IHost) SelectedDeviceMode(de.mossgrabers.framework.mode.device.SelectedDeviceMode) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 47 with IParameter

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

the class MaschineParametersMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.doesExist()) {
        d.notify("Please select a device...");
        return;
    }
    // Row 1 & 2
    final IParameterBank parameterBank = cd.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(i);
        String name = param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 6) : "";
        if (i == this.getSelectedParameter())
            name = ">" + name;
        d.setCell(0, i, name).setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(8), 8));
    }
    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) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 48 with IParameter

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

the class MaschineUserMode method updateDisplay.

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

Example 49 with IParameter

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

the class DeviceParamsMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.drawDisplay2();
    final Display d = this.surface.getDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        d.notify("Please select a Device...", true, false);
        return;
    }
    // Row 1 & 2
    final int extenderOffset = this.surface.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final IParameter param = cd.getFXParam(extenderOffset + i);
        d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, param.getDisplayedValue(8));
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 50 with IParameter

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

the class DeviceView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    for (int i = 0; i < 8; i++) {
        final IParameter param = this.cursorDevice.getFXParam(i);
        this.surface.getOutput().sendCC(LaunchpadControlSurface.LAUNCHPAD_FADER_1 + i, param.getValue());
    }
}
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