Search in sources :

Example 26 with ICursorDevice

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

the class DeviceLayerModeSend method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final int sendIndex = this.getCurrentSendIndex();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        final boolean exists = layer.doesExist();
        final ISend send = layer.getSend(sendIndex);
        d.setCell(0, i, exists ? send.getName() : "").setCell(1, i, send.getDisplayedValue(8));
        if (exists)
            d.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4(d, cd);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ISend(de.mossgrabers.framework.daw.data.ISend) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 27 with ICursorDevice

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

the class ColorView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final int color = note - 36;
    if (color < BitwigColors.BITWIG_COLORS.length) {
        final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
        switch(this.mode) {
            case MODE_TRACK:
                final IChannelBank tb = this.model.getCurrentTrackBank();
                final ITrack t = tb.getSelectedTrack();
                if (t == null) {
                    final IMasterTrack master = this.model.getMasterTrack();
                    if (master.isSelected())
                        master.setColor(entry[0], entry[1], entry[2]);
                } else
                    t.setColor(entry[0], entry[1], entry[2]);
                break;
            case MODE_LAYER:
                final ICursorDevice cd = this.model.getCursorDevice();
                final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
                cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
                break;
            case MODE_CLIP:
                final ICursorClip clip = this.model.getCursorClip();
                if (clip != null)
                    clip.setColor(entry[0], entry[1], entry[2]);
                break;
        }
    }
    this.surface.getViewManager().restoreView();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 28 with ICursorDevice

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

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

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

the class DeviceParamsMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final Display d = this.surface.getDisplay().clearRow(0).clearRow(2);
    final ICursorDevice cd = this.model.getCursorDevice();
    if (cd.hasSelectedDevice()) {
        for (int i = 0; i < 8; i++) {
            final IParameter param = cd.getFXParam(i);
            d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 8) : "").setCell(2, i, param.getDisplayedValue(8));
        }
    } else
        d.setRow(0, "                       Please select a device...                       ");
    d.done(0).done(2);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)72 IChannel (de.mossgrabers.framework.daw.data.IChannel)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)22 ITrack (de.mossgrabers.framework.daw.data.ITrack)19 Display (de.mossgrabers.framework.controller.display.Display)10 ModeManager (de.mossgrabers.framework.mode.ModeManager)9 View (de.mossgrabers.framework.view.View)8 ViewManager (de.mossgrabers.framework.view.ViewManager)8 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)7 IParameter (de.mossgrabers.framework.daw.data.IParameter)6 ITransport (de.mossgrabers.framework.daw.ITransport)5 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)4 SceneView (de.mossgrabers.framework.view.SceneView)4 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)3 IBrowser (de.mossgrabers.framework.daw.IBrowser)3 Scales (de.mossgrabers.framework.scale.Scales)3 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)3 DrumView (de.mossgrabers.launchpad.view.DrumView)3