Search in sources :

Example 56 with ITrack

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

the class MuteCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    // Update for key combinations
    this.surface.getViewManager().getActiveView().updateNoteMapping();
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2()) {
        config.setTrackState(TrackState.MUTE);
        return;
    }
    // Toggle mute lock mode
    if (this.surface.isShiftPressed()) {
        if (event == ButtonEvent.UP)
            config.setMuteSoloLocked(!config.isMuteSoloLocked());
        return;
    }
    // Behaviour like Push 1
    if (config.isMuteSoloLocked()) {
        config.setTrackState(TrackState.MUTE);
        return;
    }
    if (event == ButtonEvent.DOWN) {
        config.setIsMuteLongPressed(false);
        return;
    }
    if (event == ButtonEvent.LONG) {
        config.setIsMuteLongPressed(true);
        config.setTrackState(TrackState.MUTE);
        return;
    }
    if (config.isMuteLongPressed()) {
        config.setIsMuteLongPressed(false);
        return;
    }
    final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
    if (Modes.isTrackMode(activeModeId)) {
        final IChannelBank tb = this.model.getCurrentTrackBank();
        final ITrack selTrack = tb.getSelectedTrack();
        if (selTrack != null)
            selTrack.toggleMute();
    } else if (Modes.isLayerMode(activeModeId)) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final IChannel layer = cd.getSelectedLayerOrDrumPad();
        if (layer != null)
            cd.toggleLayerOrDrumPadMute(layer.getIndex());
    } else if (activeModeId == Modes.MODE_MASTER)
        this.model.getMasterTrack().toggleMute();
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 57 with ITrack

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

the class SoloCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    // Update for key combinations
    this.surface.getViewManager().getActiveView().updateNoteMapping();
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2()) {
        config.setTrackState(TrackState.SOLO);
        return;
    }
    // Toggle solo lock mode
    if (this.surface.isShiftPressed()) {
        if (event == ButtonEvent.UP)
            config.setMuteSoloLocked(!config.isMuteSoloLocked());
        return;
    }
    // Behaviour like Push 1
    if (config.isMuteSoloLocked()) {
        config.setTrackState(TrackState.SOLO);
        return;
    }
    if (event == ButtonEvent.DOWN) {
        config.setIsSoloLongPressed(false);
        return;
    }
    if (event == ButtonEvent.LONG) {
        config.setIsSoloLongPressed(true);
        config.setTrackState(TrackState.SOLO);
        return;
    }
    if (config.isSoloLongPressed()) {
        config.setIsSoloLongPressed(false);
        return;
    }
    final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
    if (Modes.isTrackMode(activeModeId)) {
        final IChannelBank tb = this.model.getCurrentTrackBank();
        final ITrack selTrack = tb.getSelectedTrack();
        if (selTrack != null)
            selTrack.toggleSolo();
    } else if (Modes.isLayerMode(activeModeId)) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final IChannel layer = cd.getSelectedLayerOrDrumPad();
        if (layer != null)
            cd.toggleLayerOrDrumPadSolo(layer.getIndex());
    } else if (activeModeId == Modes.MODE_MASTER)
        this.model.getMasterTrack().toggleSolo();
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 58 with ITrack

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

the class TrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
    final ITrack t = currentTrackBank.getSelectedTrack();
    final Display d = this.surface.getDisplay();
    if (t == null) {
        d.setRow(0, "                        Please select a track...                       ").clearRow(2).done(2);
        return;
    }
    d.setCell(0, 0, "Volume").setCell(2, 0, t.getVolumeStr(8)).setCell(0, 1, "Pan").setCell(2, 1, t.getPanStr(8));
    int sendStart = 2;
    int sendCount = 6;
    if (this.surface.getConfiguration().isDisplayCrossfader()) {
        sendStart = 3;
        sendCount = 5;
        final String crossfadeMode = t.getCrossfadeMode();
        d.setCell(0, 2, "Crossfdr").setCell(2, 2, "A".equals(crossfadeMode) ? "A" : "B".equals(crossfadeMode) ? "       B" : "   <> ");
    }
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    int pos;
    if (fxTrackBank != null) {
        final boolean isFX = this.model.isEffectTrackBankActive();
        for (int i = 0; i < sendCount; i++) {
            final ITrack fxTrack = fxTrackBank.getTrack(i);
            final boolean isEmpty = isFX || !fxTrack.doesExist();
            pos = sendStart + i;
            d.setCell(0, pos, isEmpty ? "" : fxTrack.getName()).setCell(2, pos, isEmpty ? "" : t.getSend(i).getDisplayedValue(8));
        }
        if (isFX)
            d.setCell(0, 7, t.getName());
    } else {
        for (int i = 0; i < sendCount; i++) {
            pos = sendStart + i;
            final ISend send = t.getSend(i);
            d.setCell(0, pos, send.getName(8)).setCell(2, pos, send.getDisplayedValue(8));
        }
    }
    d.done(0).done(2);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) Display(de.mossgrabers.framework.controller.display.Display)

Example 59 with ITrack

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

the class SendMode 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()) {
            final ISend send = t.getSendBank().getItem(this.sendIndex);
            display.setCell(0, i, send.getName());
            display.setCell(1, i, send.getDisplayedValue(8));
            display.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
        }
    }
    this.drawRow4(display);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 60 with ITrack

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

the class SendMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("null")
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    this.updateTrackMenu(5 + this.sendIndex % 4);
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final IValueChanger valueChanger = this.model.getValueChanger();
    final int sendOffset = this.surface.getConfiguration().isSendsAreToggled() ? 4 : 0;
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        final SendData[] sendData = new SendData[4];
        for (int j = 0; j < 4; j++) {
            final int sendPos = sendOffset + j;
            final ISend send = t.getSendBank().getItem(sendPos);
            final boolean exists = send != null && send.doesExist();
            sendData[j] = new SendData(exists ? send.getName() : " ", exists && this.sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue(8) : "", valueChanger.toDisplayValue(exists ? send.getValue() : -1), valueChanger.toDisplayValue(exists ? send.getModulatedValue() : -1), this.sendIndex == sendPos);
        }
        final Pair<String, Boolean> pair = this.menu.get(i);
        display.addSendsElement(pair.getKey(), pair.getValue().booleanValue(), t.doesExist() ? t.getName() : "", this.updateType(t), t.getColor(), t.isSelected(), sendData, false, t.isActivated(), t.isActivated());
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) ISend(de.mossgrabers.framework.daw.data.ISend) SendData(de.mossgrabers.framework.graphics.canvas.utils.SendData)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9