Search in sources :

Example 46 with IChannel

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

the class LayerDetailsMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
    if (deviceChain == null)
        message.setMessage(3, "Please select a layer...");
    else {
        message.addOptionElement("Layer: " + deviceChain.getName(), "", false, "", "Active", deviceChain.isActivated(), false);
        message.addEmptyElement();
        message.addOptionElement("", "", false, "", "Mute", deviceChain.isMute(), false);
        message.addOptionElement("", "", false, "", "Solo", deviceChain.isSolo(), false);
        message.addEmptyElement();
        message.addEmptyElement();
        message.addEmptyElement();
        message.addOptionElement("", "", false, "", "Select Color", false, false);
    }
    display.send(message);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 47 with IChannel

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

the class LayerDetailsMode method onFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    final IChannel deviceChain = this.model.getCursorDevice().getSelectedLayerOrDrumPad();
    if (deviceChain == null)
        return;
    switch(index) {
        case 0:
            this.model.getCursorDevice().toggleLayerOrDrumPadIsActivated(deviceChain.getIndex());
            break;
        case 2:
            this.model.getCursorDevice().toggleLayerOrDrumPadMute(deviceChain.getIndex());
            break;
        case 3:
            this.model.getCursorDevice().toggleLayerOrDrumPadSolo(deviceChain.getIndex());
            break;
        case 7:
            final ViewManager viewManager = this.surface.getViewManager();
            ((ColorView) viewManager.getView(Views.VIEW_COLOR)).setMode(ColorView.SelectMode.MODE_LAYER);
            viewManager.setActiveView(Views.VIEW_COLOR);
            break;
        default:
            // Not used
            break;
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ViewManager(de.mossgrabers.framework.view.ViewManager) ColorView(de.mossgrabers.push.view.ColorView)

Example 48 with IChannel

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

the class FireLayerMode method onKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
    this.selectedParameter = this.surface.isPressed(ButtonID.ALT) ? ALT_MODES[index] : MODES[index];
    this.isKnobTouched[index] = isTouched;
    final ISpecificDevice cd = this.model.getDrumDevice();
    final Optional<ILayer> channelOptional = cd.getLayerBank().getSelectedItem();
    if (!channelOptional.isPresent())
        return;
    final IChannel channel = channelOptional.get();
    switch(this.selectedParameter) {
        case VOLUME:
            if (isTouched && this.surface.isDeletePressed())
                channel.resetVolume();
            channel.touchVolume(isTouched);
            break;
        case PAN:
            if (isTouched && this.surface.isDeletePressed())
                channel.resetPan();
            channel.touchPan(isTouched);
            break;
        case SEND1:
        case SEND2:
        case SEND3:
        case SEND4:
        case SEND5:
        case SEND6:
            final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
            final ISend item = channel.getSendBank().getItem(sendIndex);
            if (isTouched && this.surface.isDeletePressed())
                item.resetValue();
            item.touchValue(isTouched);
            break;
        default:
            // No more
            break;
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ILayer(de.mossgrabers.framework.daw.data.ILayer) ISpecificDevice(de.mossgrabers.framework.daw.data.ISpecificDevice) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 49 with IChannel

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

the class FireLayerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    String desc = "Select";
    String label = "a drum pad";
    int value = -1;
    int vuLeft = -1;
    int vuRight = -1;
    boolean isPan = false;
    final ISpecificDevice cd = this.model.getDrumDevice();
    final Optional<ILayer> channelOptional = cd.getLayerBank().getSelectedItem();
    if (channelOptional.isPresent()) {
        final IChannel channel = channelOptional.get();
        vuLeft = channel.getVuLeft();
        vuRight = channel.getVuRight();
        desc = channel.getPosition() + 1 + ": " + channel.getName(9);
        final ISendBank sendBank = channel.getSendBank();
        switch(this.selectedParameter) {
            case VOLUME:
                label = "Vol: " + channel.getVolumeStr();
                value = channel.getVolume();
                break;
            case PAN:
                label = "Pan: " + channel.getPanStr();
                value = channel.getPan();
                isPan = true;
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                label = getSendLabel(sendBank, sendIndex);
                value = getSendValue(sendBank, sendIndex);
                break;
            default:
                label = "Select a track";
                break;
        }
    }
    display.addElement(new TitleValueComponent(desc, label, value, vuLeft, vuRight, isPan));
    display.send();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ILayer(de.mossgrabers.framework.daw.data.ILayer) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) ISpecificDevice(de.mossgrabers.framework.daw.data.ISpecificDevice) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 50 with IChannel

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

the class AbstractDrumView method getDrumPadColor.

protected String getDrumPadColor(final int index, final IDrumDevice primary, final boolean isRecording) {
    final int offsetY = this.scales.getDrumOffset();
    // Playing note?
    if (this.keyManager.isKeyPressed(offsetY + index))
        return isRecording ? AbstractDrumView.COLOR_PAD_RECORD : AbstractDrumView.COLOR_PAD_PLAY;
    // Selected?
    if (this.selectedPad == index)
        return AbstractDrumView.COLOR_PAD_SELECTED;
    // Exists and active?
    final IDrumPadBank drumPadBank = primary.getDrumPadBank();
    final IChannel drumPad = drumPadBank.getItem(index);
    if (!drumPad.doesExist() || !drumPad.isActivated())
        return this.surface.getConfiguration().isTurnOffEmptyDrumPads() ? AbstractDrumView.COLOR_PAD_OFF : AbstractDrumView.COLOR_PAD_NO_CONTENT;
    // Muted or soloed?
    if (drumPad.isMute() || drumPadBank.hasSoloedPads() && !drumPad.isSolo())
        return AbstractDrumView.COLOR_PAD_MUTED;
    return this.getPadContentColor(drumPad);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) IDrumPadBank(de.mossgrabers.framework.daw.data.bank.IDrumPadBank)

Aggregations

IChannel (de.mossgrabers.framework.daw.data.IChannel)57 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)9 ISend (de.mossgrabers.framework.daw.data.ISend)9 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 Display (de.mossgrabers.framework.controller.display.Display)5 IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)5 ModeManager (de.mossgrabers.framework.mode.ModeManager)4 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)3 ILayer (de.mossgrabers.framework.daw.data.ILayer)3 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)3 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)3 PushDisplay (de.mossgrabers.push.controller.PushDisplay)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)2 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)2