Search in sources :

Example 61 with ICursorDevice

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

the class DeviceLayerModeSend method onValueKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
    this.isKnobTouched[index] = isTouched;
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final IChannel layer = cd.getLayerOrDrumPad(offset + index);
    if (!layer.doesExist())
        return;
    final int sendIndex = this.getCurrentSendIndex();
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
            cd.resetLayerOrDrumPadSend(offset + index, sendIndex);
            return;
        }
        final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
        final String name = fxTrackBank == null ? layer.getSend(sendIndex).getName() : fxTrackBank.getTrack(sendIndex).getName();
        if (!name.isEmpty())
            this.surface.getDisplay().notify("Send " + name + ": " + layer.getSend(sendIndex).getDisplayedValue());
    }
    cd.touchLayerOrDrumPadSend(offset + index, sendIndex, isTouched);
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 62 with ICursorDevice

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

the class DeviceLayerModeVolume method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        d.setCell(0, i, layer.doesExist() ? "Volume" : "").setCell(1, i, layer.getVolumeStr(8));
        if (layer.doesExist())
            d.setCell(2, i, config.isEnableVUMeters() ? layer.getVu() : layer.getVolume(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4(d, cd);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 63 with ICursorDevice

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

the class DeviceParamsMode method updateSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateSecondRow() {
    final int white = this.isPush2 ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH1_COLOR2_WHITE;
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        this.disableSecondRow();
        this.surface.updateButton(109, white);
        return;
    }
    final int green = this.isPush2 ? PushColors.PUSH2_COLOR2_GREEN : PushColors.PUSH1_COLOR2_GREEN;
    final int grey = this.isPush2 ? PushColors.PUSH2_COLOR2_GREY_LO : PushColors.PUSH1_COLOR2_GREY_LO;
    final int orange = this.isPush2 ? PushColors.PUSH2_COLOR2_ORANGE : PushColors.PUSH1_COLOR2_ORANGE;
    final int off = this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
    final int turquoise = this.isPush2 ? PushColors.PUSH2_COLOR2_TURQUOISE_HI : PushColors.PUSH1_COLOR2_TURQUOISE_HI;
    this.surface.updateButton(102, cd.isEnabled() ? green : grey);
    this.surface.updateButton(103, cd.isParameterPageSectionVisible() ? orange : white);
    this.surface.updateButton(104, cd.isExpanded() ? orange : white);
    this.surface.updateButton(105, off);
    this.surface.updateButton(106, this.showDevices ? white : orange);
    this.surface.updateButton(107, this.model.getHost().hasPinning() ? cd.isPinned() ? turquoise : grey : off);
    this.surface.updateButton(108, cd.isWindowOpen() ? turquoise : grey);
    this.surface.updateButton(109, white);
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 64 with ICursorDevice

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

the class DeviceParamsMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        this.disableFirstRow();
        return;
    }
    final int selectedColor = this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI;
    final int existsColor = this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO;
    final int offColor = this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
    if (this.showDevices) {
        for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, cd.doesSiblingExist(i) ? i == cd.getPositionInBank() ? selectedColor : existsColor : offColor);
    } else {
        final String[] pages = cd.getParameterPageNames();
        final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
        final int start = page / 8 * 8;
        for (int i = 0; i < 8; i++) {
            final int index = start + i;
            this.surface.updateButton(20 + i, index < pages.length ? index == page ? selectedColor : existsColor : offColor);
        }
    }
}
Also used : ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 65 with ICursorDevice

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

the class DeviceParamsMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        d.clear().setBlock(1, 0, "           Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'...  ").allDone();
        return;
    }
    // Row 1 & 2
    for (int i = 0; i < 8; i++) {
        final IParameter param = cd.getFXParam(i);
        d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, param.getDisplayedValue(8));
    }
    // Row 3
    d.setBlock(2, 0, "Selected Device:").setBlock(2, 1, cd.getName());
    // Row 4
    if (this.showDevices) {
        for (int i = 0; i < 8; i++) d.setCell(3, i, cd.doesSiblingExist(i) ? (i == cd.getPositionInBank() ? PushDisplay.RIGHT_ARROW : "") + cd.getSiblingDeviceName(i) : "");
    } else {
        final String[] pages = cd.getParameterPageNames();
        final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
        final int start = page / 8 * 8;
        for (int i = 0; i < 8; i++) {
            final int index = start + i;
            d.setCell(3, i, index < pages.length ? (index == page ? PushDisplay.RIGHT_ARROW : "") + pages[index] : "");
        }
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)72 IChannel (de.mossgrabers.framework.daw.data.IChannel)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)22 ITrack (de.mossgrabers.framework.daw.data.ITrack)19 Display (de.mossgrabers.framework.controller.display.Display)10 ModeManager (de.mossgrabers.framework.mode.ModeManager)9 View (de.mossgrabers.framework.view.View)8 ViewManager (de.mossgrabers.framework.view.ViewManager)8 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)7 IParameter (de.mossgrabers.framework.daw.data.IParameter)6 ITransport (de.mossgrabers.framework.daw.ITransport)5 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)4 SceneView (de.mossgrabers.framework.view.SceneView)4 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)3 IBrowser (de.mossgrabers.framework.daw.IBrowser)3 Scales (de.mossgrabers.framework.scale.Scales)3 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)3 DrumView (de.mossgrabers.launchpad.view.DrumView)3