Search in sources :

Example 96 with ITrackBank

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

the class DeviceLayerMode method updateDisplayElements.

/**
 * Update all 8 elements.
 *
 * @param display The display
 * @param l The channel data
 */
protected void updateDisplayElements(final IGraphicDisplay display, final Optional<ILayer> l) {
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = this.getDrumPadIndex();
    // Get the index at which to draw the Sends element
    int sendsIndex = l.isEmpty() ? -1 : l.get().getIndex() - offset + 1;
    if (sendsIndex == 8)
        sendsIndex = 6;
    this.updateMenuItems(-1);
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = this.bank.getItem(offset + i);
        final Pair<String, Boolean> pair = this.menu.get(i);
        final String topMenu = pair.getKey();
        final boolean isTopMenuOn = pair.getValue().booleanValue();
        // Channel info
        final String bottomMenu = layer.doesExist() ? layer.getName(12) : "";
        final ColorEx bottomMenuColor = layer.getColor();
        final boolean isBottomMenuOn = layer.isSelected();
        if (layer.isSelected()) {
            final IValueChanger valueChanger = this.model.getValueChanger();
            final boolean enableVUMeters = config.isEnableVUMeters();
            final int vuR = valueChanger.toDisplayValue(enableVUMeters ? layer.getVuRight() : 0);
            final int vuL = valueChanger.toDisplayValue(enableVUMeters ? layer.getVuLeft() : 0);
            display.addChannelElement(topMenu, isTopMenuOn, bottomMenu, ChannelType.LAYER, bottomMenuColor, isBottomMenuOn, valueChanger.toDisplayValue(layer.getVolume()), valueChanger.toDisplayValue(layer.getModulatedVolume()), this.isKnobTouched[0] ? layer.getVolumeStr(8) : "", valueChanger.toDisplayValue(layer.getPan()), valueChanger.toDisplayValue(layer.getModulatedPan()), this.isKnobTouched[1] ? layer.getPanStr(8) : "", vuL, vuR, layer.isMute(), layer.isSolo(), false, layer.isActivated(), 0, false);
        } else if (sendsIndex == i && l.isPresent()) {
            final ITrackBank fxTrackBank = this.model.getEffectTrackBank();
            final SendData[] sendData = new SendData[4];
            for (int j = 0; j < 4; j++) {
                final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
                final int sendPos = sendOffset + j;
                final ISend send = l.get().getSendBank().getItem(sendPos);
                final boolean doesExist = send.doesExist();
                sendData[j] = new SendData(fxTrackBank == null ? send.getName() : fxTrackBank.getItem(sendPos).getName(), doesExist && this.isKnobTouched[4 + j] ? send.getDisplayedValue() : "", doesExist ? send.getValue() : 0, doesExist ? send.getModulatedValue() : 0, true);
            }
            display.addSendsElement(topMenu, isTopMenuOn, layer.doesExist() ? layer.getName() : "", ChannelType.LAYER, this.bank.getItem(offset + i).getColor(), layer.isSelected(), sendData, true, l.get().isActivated(), layer.isActivated());
        } else
            display.addChannelSelectorElement(topMenu, isTopMenuOn, bottomMenu, ChannelType.LAYER, bottomMenuColor, isBottomMenuOn, layer.isActivated());
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ColorEx(de.mossgrabers.framework.controller.color.ColorEx) ISend(de.mossgrabers.framework.daw.data.ISend) SendData(de.mossgrabers.framework.graphics.canvas.utils.SendData)

Example 97 with ITrackBank

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

the class DeviceLayerMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    if (!this.isPush2 || this.configuration.isMuteLongPressed() || this.configuration.isSoloLongPressed() || this.configuration.isMuteSoloLocked()) {
        final int offset = this.getDrumPadIndex();
        final ILayer layer = this.bank.getItem(offset + index);
        if (this.configuration.isMuteState())
            layer.toggleMute();
        else
            layer.toggleSolo();
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    ITrackBank fxTrackBank;
    switch(index) {
        case 0:
            if (modeManager.isActive(Modes.DEVICE_LAYER_VOLUME))
                this.setMode(Modes.DEVICE_LAYER);
            else
                this.setMode(Modes.DEVICE_LAYER_VOLUME);
            break;
        case 1:
            if (modeManager.isActive(Modes.DEVICE_LAYER_PAN))
                this.setMode(Modes.DEVICE_LAYER);
            else
                this.setMode(Modes.DEVICE_LAYER_PAN);
            break;
        case 2:
            // Not used
            break;
        case 3:
            if (this.model.isEffectTrackBankActive())
                return;
            // Check if there are more than 4 FX channels
            if (!this.configuration.isSendsAreToggled()) {
                fxTrackBank = this.model.getEffectTrackBank();
                if (fxTrackBank == null || !fxTrackBank.getItem(4).doesExist())
                    return;
            }
            this.configuration.setSendsAreToggled(!this.configuration.isSendsAreToggled());
            this.bindControls();
            if (!modeManager.isActive(Modes.DEVICE_LAYER))
                this.setMode(Modes.get(Modes.DEVICE_LAYER_SEND1, this.configuration.isSendsAreToggled() ? 4 : 0));
            break;
        case 7:
            if (this.surface.isShiftPressed())
                this.handleSendEffect(this.configuration.isSendsAreToggled() ? 7 : 3);
            else
                this.moveUp();
            break;
        default:
            this.handleSendEffect(index - (this.configuration.isSendsAreToggled() ? 0 : 4));
            break;
    }
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ILayer(de.mossgrabers.framework.daw.data.ILayer) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 98 with ITrackBank

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

the class CrossfadeMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        if (!t.doesExist())
            continue;
        display.setCell(0, i, "Crossfdr");
        final IParameter crossfadeParameter = t.getCrossfadeParameter();
        display.setCell(1, i, CROSSFADE_TEXT.get(crossfadeParameter.getDisplayedValue()));
        display.setCell(2, i, crossfadeParameter.getValue(), Format.FORMAT_PAN);
    }
    this.drawRow4(display);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 99 with ITrackBank

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

the class TrackCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final PushConfiguration config = this.surface.getConfiguration();
    if (this.surface.isShiftPressed()) {
        config.setVUMetersEnabled(!config.isEnableVUMeters());
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes currentMode = modeManager.getActiveID();
    if (currentMode != null) {
        if (config.isPush2()) {
            if (Modes.TRACK.equals(currentMode) || Modes.VOLUME.equals(currentMode) || Modes.CROSSFADER.equals(currentMode) || Modes.PAN.equals(currentMode)) {
                this.model.toggleCurrentTrackBank();
            } else if (currentMode.ordinal() >= Modes.SEND1.ordinal() && currentMode.ordinal() <= Modes.SEND8.ordinal()) {
                modeManager.setActive(Modes.TRACK);
                this.model.toggleCurrentTrackBank();
            } else
                modeManager.setActive(config.getCurrentMixMode());
        } else {
            // Layer mode selection for Push 1
            if (this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
                modeManager.setActive(Modes.DEVICE_LAYER);
                return;
            }
            if (Modes.TRACK.equals(currentMode))
                this.model.toggleCurrentTrackBank();
            else
                modeManager.setActive(Modes.TRACK);
        }
    } else
        modeManager.setActive(Modes.TRACK);
    config.setDebugMode(modeManager.getActiveID());
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = tb.getSelectedItem();
    if (track.isEmpty())
        tb.getItem(0).select();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 100 with ITrackBank

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

the class PanMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        display.setCell(0, i, t.doesExist() ? "Pan" : "").setCell(1, i, t.getPanStr(8));
        if (t.doesExist())
            display.setCell(2, i, t.getPan(), Format.FORMAT_PAN);
    }
    this.drawRow4(display);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)121 ITrack (de.mossgrabers.framework.daw.data.ITrack)85 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)17 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 Modes (de.mossgrabers.framework.mode.Modes)15 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)10 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)10 ISend (de.mossgrabers.framework.daw.data.ISend)10 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)8 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)7 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 ITransport (de.mossgrabers.framework.daw.ITransport)5 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)5 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)5 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)4 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)3 IHost (de.mossgrabers.framework.daw.IHost)3