Search in sources :

Example 46 with ICursorDevice

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

the class DeviceHandler method scrollParameterBank.

private void scrollParameterBank(final KnobMode knobMode, final MidiValue value) {
    if (isAbsolute(knobMode) || !this.increaseKnobMovement())
        return;
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    if (this.isIncrease(knobMode, value))
        parameterBank.selectNextPage();
    else
        parameterBank.selectPreviousPage();
    this.mvHelper.notifySelectedParameterPage();
}
Also used : IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 47 with ICursorDevice

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

the class DeviceLayerRightCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannelBank<ILayer> bank = cd.getLayerBank();
    final Optional<ILayer> sel = bank.getSelectedItem();
    if (!cd.hasLayers() || sel.isEmpty())
        cd.selectNext();
    else
        bank.selectNextItem();
}
Also used : ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 48 with ICursorDevice

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

the class DeviceLayerRightCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    // Enter layer
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasLayers())
        return;
    final IChannelBank<ILayer> bank = cd.getLayerBank();
    final Optional<ILayer> layer = bank.getSelectedItem();
    if (layer.isEmpty())
        bank.getItem(0).select();
    else
        layer.get().enter();
}
Also used : ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 49 with ICursorDevice

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

the class DeviceLayerLeftCommand method canExecute.

/**
 * Check if the command can be executed.
 *
 * @return True if it can
 */
public boolean canExecute() {
    if (this.surface.isShiftPressed())
        return true;
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannelBank<ILayer> bank = cd.getLayerBank();
    final Optional<ILayer> layer = bank.getSelectedItem();
    return cd.hasLayers() && layer.isPresent() ? bank.canScrollBackwards() : cd.canSelectPreviousFX();
}
Also used : ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 50 with ICursorDevice

use of de.mossgrabers.framework.daw.data.ICursorDevice 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)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)67 IParameter (de.mossgrabers.framework.daw.data.IParameter)17 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)14 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)10 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)8 ILayer (de.mossgrabers.framework.daw.data.ILayer)8 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)8 ITrack (de.mossgrabers.framework.daw.data.ITrack)7 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)7 IBrowser (de.mossgrabers.framework.daw.IBrowser)5 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)5 Modes (de.mossgrabers.framework.mode.Modes)5 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 IDevice (de.mossgrabers.framework.daw.data.IDevice)3 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)3 IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)3 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)2