Search in sources :

Example 21 with IChannel

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

the class DeviceLayerMode method updateMuteMenu.

protected void updateMuteMenu() {
    for (int i = 0; i < 8; i++) {
        final IChannel layer = this.bank.getItem(i);
        this.menu.get(i).set(layer.doesExist() ? "Mute" : "", Boolean.valueOf(layer.isMute()));
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel)

Example 22 with IChannel

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

the class DrumView method getDrumPadColor.

private int getDrumPadColor(final int index, final IDrumDevice primary) {
    final int offsetY = this.scales.getDrumOffset();
    // Playing note?
    if (this.keyManager.isKeyPressed(offsetY + index))
        return BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK;
    // Selected?
    if (this.selectedPad == index)
        return BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED;
    // Exists and active?
    final IDrumPadBank drumPadBank = primary.getDrumPadBank();
    final IChannel drumPad = drumPadBank.getItem(index);
    if (!drumPad.doesExist() || !drumPad.isActivated())
        return BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF;
    // Muted or soloed?
    if (drumPad.isMute() || drumPadBank.hasSoloedPads() && !drumPad.isSolo())
        return BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF;
    return BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE;
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) IDrumPadBank(de.mossgrabers.framework.daw.data.bank.IDrumPadBank)

Example 23 with IChannel

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

the class FireTrackMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ITrackBank trackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> trackOptional = trackBank.getSelectedItem();
    String label = "None";
    if (trackOptional.isPresent()) {
        final ITrack track = trackOptional.get();
        label = track.getPosition() + 1 + ": " + track.getName(9);
    }
    final int size = trackBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = trackBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 24 with IChannel

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

the class AbstractDrum64View method getDrumPadColor.

private String getDrumPadColor(final int index, final IDrumDevice primary, final boolean isRecording) {
    // Playing note?
    if (this.pressedKeys[this.offsetY + index] > 0)
        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)

Example 25 with IChannel

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

the class FireLayerMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ISpecificDevice cd = this.model.getDrumDevice();
    final ILayerBank layerBank = cd.getLayerBank();
    final Optional<ILayer> channelOptional = layerBank.getSelectedItem();
    String label = "None";
    if (channelOptional.isPresent()) {
        final IChannel channel = channelOptional.get();
        label = channel.getPosition() + 1 + ": " + channel.getName(9);
    }
    final int size = layerBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = layerBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = layerBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : ILayerBank(de.mossgrabers.framework.daw.data.bank.ILayerBank) IChannel(de.mossgrabers.framework.daw.data.IChannel) ILayer(de.mossgrabers.framework.daw.data.ILayer) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISpecificDevice(de.mossgrabers.framework.daw.data.ISpecificDevice) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

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