Search in sources :

Example 56 with IChannelBank

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

the class AddTrackCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    IChannelBank tb = this.model.getTrackBank();
    final IApplication application = this.model.getApplication();
    if (this.surface.isShiftPressed()) {
        application.addEffectTrack();
        tb = this.model.getEffectTrackBank();
    } else if (this.surface.isSelectPressed())
        application.addAudioTrack();
    else
        application.addInstrumentTrack();
    final IChannelBank bank = tb;
    this.surface.scheduleTask(() -> {
        final int pos = bank.getTrackCount() - 1;
        bank.scrollToChannel(pos);
        bank.getTrack(pos % bank.getNumTracks()).select();
    }, 200);
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 57 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 58 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 59 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 60 with IChannelBank

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

the class CursorCommand method scrollTracksLeft.

protected void scrollTracksLeft() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    final int index = sel == null ? 0 : sel.getIndex() - 1;
    if (index == -1 || this.surface.isShiftPressed()) {
        this.scrollTrackBankLeft(sel, index);
        return;
    }
    this.selectTrack(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Aggregations

IChannelBank (de.mossgrabers.framework.daw.IChannelBank)114 ITrack (de.mossgrabers.framework.daw.data.ITrack)92 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)22 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)20 ModeManager (de.mossgrabers.framework.mode.ModeManager)20 PushConfiguration (de.mossgrabers.push.PushConfiguration)19 Display (de.mossgrabers.framework.controller.display.Display)18 ISend (de.mossgrabers.framework.daw.data.ISend)11 ViewManager (de.mossgrabers.framework.view.ViewManager)10 PushDisplay (de.mossgrabers.push.controller.PushDisplay)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ISlot (de.mossgrabers.framework.daw.data.ISlot)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)5 View (de.mossgrabers.framework.view.View)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)3