Search in sources :

Example 21 with IParameterBank

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

the class ParametersMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final SLMkIIIDisplay d = this.surface.getDisplay();
    d.clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.doesExist()) {
        d.setBlock(1, 1, " Please  select or").setBlock(1, 2, "add a    device.");
        d.setCell(0, 8, "No device");
        d.hideAllElements();
        // Row 4
        this.drawRow4(d, cd, null);
    } else {
        final IParameterPageBank parameterPageBank = cd.getParameterPageBank();
        final Optional<String> selectedPage = parameterPageBank.getSelectedItem();
        d.setCell(0, 8, cd.getName(9)).setCell(1, 8, selectedPage.isPresent() ? selectedPage.get() : "");
        // Row 1 & 2
        for (int i = 0; i < 8; i++) {
            final IParameterBank parameterBank = cd.getParameterBank();
            final IParameter param = parameterBank.getItem(i);
            d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName(9)) : "").setCell(1, i, param.getDisplayedValue(9));
            final int color = param.doesExist() ? SLMkIIIColorManager.SLMKIII_PURPLE : SLMkIIIColorManager.SLMKIII_BLACK;
            d.setPropertyColor(i, 0, color);
            d.setPropertyColor(i, 1, color);
        }
        // Row 4
        this.drawRow4(d, cd, parameterPageBank);
    }
    this.setButtonInfo(d);
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IParameterPageBank(de.mossgrabers.framework.daw.data.bank.IParameterPageBank) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) SLMkIIIDisplay(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 22 with IParameterBank

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

the class ParameterView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 8; i < 12; i++) padGrid.lightEx(i % 4, 3 - i / 4, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean doesExist = cursorDevice.doesExist();
    padGrid.lightEx(0, 0, doesExist && cursorDevice.canSelectPreviousFX() ? MaschineColorManager.COLOR_ROSE : MaschineColorManager.COLOR_BLACK);
    padGrid.lightEx(1, 0, doesExist && cursorDevice.canSelectNextFX() ? MaschineColorManager.COLOR_ROSE : MaschineColorManager.COLOR_BLACK);
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    padGrid.lightEx(2, 0, doesExist && parameterBank.canScrollBackwards() ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
    padGrid.lightEx(3, 0, doesExist && parameterBank.canScrollForwards() ? MaschineColorManager.COLOR_SKIN : MaschineColorManager.COLOR_BLACK);
    final SelectedDeviceMode<?, ?> deviceMode = (SelectedDeviceMode<?, ?>) this.surface.getModeManager().get(Modes.DEVICE_PARAMS);
    for (int i = 0; i < 8; i++) {
        final int x = i % 4;
        final int y = 2 + i / 4;
        final IParameter item = parameterBank.getItem(i);
        if (item.doesExist()) {
            final int color = MaschineColorManager.PARAM_COLORS.get(i).intValue();
            if (i == deviceMode.getSelectedParameter())
                padGrid.lightEx(x, y, color, MaschineColorManager.COLOR_WHITE, false);
            else
                padGrid.lightEx(x, y, color);
        } else
            padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) IParameter(de.mossgrabers.framework.daw.data.IParameter) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) SelectedDeviceMode(de.mossgrabers.framework.mode.device.SelectedDeviceMode) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 23 with IParameterBank

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

the class PageCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes mode = modeManager.getActiveID();
    switch(mode) {
        case DEVICE_PARAMS:
            final ICursorDevice cursorDevice = this.model.getCursorDevice();
            if (this.direction == Direction.LEFT)
                cursorDevice.selectPrevious();
            else
                cursorDevice.selectNext();
            this.mvHelper.notifySelectedDevice();
            break;
        case USER:
            final IParameterBank userBank = this.model.getUserParameterBank();
            if (this.direction == Direction.LEFT)
                userBank.selectPreviousPage();
            else
                userBank.selectNextPage();
            this.mvHelper.notifySelectedUserPage();
            break;
        case BROWSER:
            if (this.direction == Direction.LEFT)
                this.model.getBrowser().previousContentType();
            else
                this.model.getBrowser().nextContentType();
            break;
        default:
            final ITrack cursorTrack = this.model.getCursorTrack();
            if (!cursorTrack.doesExist())
                return;
            final ISlotBank slotBank = cursorTrack.getSlotBank();
            if (this.direction == Direction.LEFT) {
                if (this.surface.isShiftPressed()) {
                    this.surface.setStopConsumed();
                    slotBank.selectPreviousPage();
                } else
                    slotBank.selectPreviousItem();
            } else {
                if (this.surface.isShiftPressed()) {
                    this.surface.setStopConsumed();
                    slotBank.selectNextPage();
                } else
                    slotBank.selectNextItem();
            }
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ISlotBank(de.mossgrabers.framework.daw.data.bank.ISlotBank) ITrack(de.mossgrabers.framework.daw.data.ITrack) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 24 with IParameterBank

use of de.mossgrabers.framework.daw.data.bank.IParameterBank 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 25 with IParameterBank

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

the class LaunchkeyMiniMk3ControllerSetup method processProgramChangeAction.

private void processProgramChangeAction(final int value) {
    final Modes modeID = this.getSurface().getModeManager().getActiveID();
    if (modeID == null)
        return;
    switch(modeID) {
        case VOLUME:
        case PAN:
        case SEND1:
        case SEND2:
            final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
            if (value > 0)
                currentTrackBank.selectNextPage();
            else
                currentTrackBank.selectPreviousPage();
            this.mvHelper.notifySelectedTrack();
            break;
        case DEVICE_PARAMS:
            final ICursorDevice cursorDevice = this.model.getCursorDevice();
            final IParameterBank parameterBank = cursorDevice.getParameterBank();
            if (value > 0)
                parameterBank.selectNextItem();
            else
                parameterBank.selectPreviousItem();
            this.mvHelper.notifySelectedParameterPage();
            break;
        default:
            // Not used
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

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