Search in sources :

Example 1 with ISendBank

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

the class GenericFlexiControllerSetup method updateIndication.

protected void updateIndication() {
    final Set<FlexiCommand> commands = this.configuration.getMappedCommands();
    final FlexiCommand[] allCommands = FlexiCommand.values();
    final ITrackBank trackBank = this.model.getTrackBank();
    final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
    for (int i = 0; i < trackBank.getPageSize(); i++) {
        final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
        final ITrack track = trackBank.getItem(i);
        track.setVolumeIndication(this.testVolumeIndication(commands, allCommands, i, hasTrackSel));
        track.setPanIndication(this.testPanIndication(commands, allCommands, i, hasTrackSel));
        final ISendBank sendBank = track.getSendBank();
        final int sendPageSize = sendBank.getPageSize();
        for (int j = 0; j < sendPageSize; j++) sendBank.getItem(j).setIndication(this.testSendIndication(commands, allCommands, i, hasTrackSel, sendPageSize, j));
    }
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.setVolumeIndication(commands.contains(FlexiCommand.MASTER_SET_VOLUME));
    masterTrack.setPanIndication(commands.contains(FlexiCommand.MASTER_SET_PANORAMA));
    final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
    for (int i = 0; i < parameterBank.getPageSize(); i++) parameterBank.getItem(i).setIndication(this.testParameterIndication(commands, allCommands, i));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) FlexiCommand(de.mossgrabers.controller.generic.controller.FlexiCommand) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 2 with ISendBank

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

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

the class SendParameterProvider method get.

/**
 * {@inheritDoc}
 */
@Override
public IParameter get(final int index) {
    if (this.sendIndex == -1) {
        final Optional<ITrack> track = this.bank.getSelectedItem();
        if (track.isEmpty())
            return EmptyParameter.INSTANCE;
        final ISendBank sendBank = track.get().getSendBank();
        return sendBank.getItemCount() > 0 ? sendBank.getItem(index) : EmptyParameter.INSTANCE;
    }
    final ISendBank sendBank = this.bank.getItem(index).getSendBank();
    return sendBank.getItemCount() == 0 ? EmptyParameter.INSTANCE : sendBank.getItem(this.sendIndex);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 4 with ISendBank

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

Example 5 with ISendBank

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

the class TrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> t = currentTrackBank.getSelectedItem();
    final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
    d.clear();
    if (t.isEmpty()) {
        d.setCell(0, 3, "  PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "TRACK").allDone();
        return;
    }
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    final ITrack track = t.get();
    d.setCell(0, 0, (isEffectTrackBankActive ? "TR-FX " : "TRACK ") + (track.getPosition() + 1)).setCell(1, 0, StringUtils.shortenAndFixASCII(track.getName(), 8).toUpperCase(Locale.US));
    d.setCell(0, 1, "VOLUME").setCell(1, 1, getSecondLineText(track)).setCell(0, 2, "PAN").setCell(1, 2, track.getPanStr(8));
    d.setBar(1, this.surface.getContinuous(ContinuousID.KNOB1).isTouched(), track.getVolume());
    d.setPanBar(2, this.surface.getContinuous(ContinuousID.KNOB2).isTouched(), track.getPan());
    if (!isEffectTrackBankActive) {
        final ISendBank sendBank = track.getSendBank();
        for (int i = 0; i < 6; i++) {
            final int pos = 3 + i;
            final ISend sendData = sendBank.getItem(i);
            d.setCell(0, pos, StringUtils.shortenAndFixASCII(sendData.getName(8), 8).toUpperCase(Locale.US)).setCell(1, pos, sendData.getDisplayedValue(8));
            d.setBar(pos, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB3, i)).isTouched() && sendData.doesExist(), sendData.getValue());
        }
    }
    d.allDone();
}
Also used : Kontrol1Display(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Aggregations

ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)31 ITrack (de.mossgrabers.framework.daw.data.ITrack)25 ISend (de.mossgrabers.framework.daw.data.ISend)17 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)8 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)4 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)3 ILayer (de.mossgrabers.framework.daw.data.ILayer)3 TitleChannelsComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent)2 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)2 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)2 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 ISpecificDevice (de.mossgrabers.framework.daw.data.ISpecificDevice)2 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 Modes (de.mossgrabers.framework.mode.Modes)2 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)1 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)1 FlexiCommand (de.mossgrabers.controller.generic.controller.FlexiCommand)1 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)1