Search in sources :

Example 6 with PushConfiguration

use of de.mossgrabers.controller.ableton.push.PushConfiguration in project DrivenByMoss by git-moss.

the class SetupMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    final PushConfiguration config = this.surface.getConfiguration();
    final int displayBrightness = config.getDisplayBrightness();
    final int ledBrightness = config.getLedBrightness();
    final int padSensitivity = config.getPadSensitivity();
    final int padGain = config.getPadGain();
    final int padDynamics = config.getPadDynamics();
    display.addOptionElement("", "Setup", true, "", "", false, true);
    display.addOptionElement("Brightness", "Info", false, "", "", false, true);
    display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "Display", displayBrightness * 1023 / 100, displayBrightness + "%", this.isKnobTouched[2], -1);
    display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "LEDs", ledBrightness * 1023 / 100, ledBrightness + "%", this.isKnobTouched[3], -1);
    display.addOptionElement("        Pads", " ", false, "", "", false, true);
    display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "Sensitivity", padSensitivity * 1023 / 10, Integer.toString(padSensitivity), this.isKnobTouched[5], -1);
    display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "Gain", padGain * 1023 / 10, Integer.toString(padGain), this.isKnobTouched[6], -1);
    display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "Dynamics", padDynamics * 1023 / 10, Integer.toString(padDynamics), this.isKnobTouched[7], -1);
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration)

Example 7 with PushConfiguration

use of de.mossgrabers.controller.ableton.push.PushConfiguration in project DrivenByMoss by git-moss.

the class TrackMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = tb.getSelectedItem();
    if (track.isEmpty())
        display.setRow(1, "                     Please selecta track...                        ");
    else {
        final ITrack t = track.get();
        final PushConfiguration config = this.surface.getConfiguration();
        final int upperBound = this.model.getValueChanger().getUpperBound();
        final String volValueStr = config.isEnableVUMeters() ? Push1Display.formatValue(t.getVolume(), t.getVu(), upperBound) : Push1Display.formatValue(t.getVolume(), upperBound);
        display.setCell(0, 0, "Volume").setCell(1, 0, t.getVolumeStr(8)).setCell(2, 0, volValueStr);
        display.setCell(0, 1, "Pan").setCell(1, 1, t.getPanStr(8)).setCell(2, 1, t.getPan(), Format.FORMAT_PAN);
        final int sendStart = 2;
        final int sendCount = 6;
        final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
        final ISendBank sendBank = t.getSendBank();
        for (int i = 0; i < sendCount; i++) {
            final int pos = sendStart + i;
            if (!isEffectTrackBankActive) {
                final ISend send = sendBank.getItem(i);
                if (send.doesExist())
                    display.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
            }
        }
    }
    this.drawRow4(display);
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) 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)

Example 8 with PushConfiguration

use of de.mossgrabers.controller.ableton.push.PushConfiguration in project DrivenByMoss by git-moss.

the class VolumeMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        display.setCell(0, i, t.doesExist() ? "Volume" : "").setCell(1, i, t.getVolumeStr(8));
        if (t.doesExist())
            display.setCell(2, i, config.isEnableVUMeters() ? Push1Display.formatValue(t.getVolume(), t.getVu(), upperBound) : Push1Display.formatValue(t.getVolume(), upperBound));
    }
    this.drawRow4(display);
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 9 with PushConfiguration

use of de.mossgrabers.controller.ableton.push.PushConfiguration in project DrivenByMoss by git-moss.

the class AccentCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    switch(event) {
        case DOWN:
            this.quitAccentMode = false;
            break;
        case LONG:
            this.quitAccentMode = true;
            this.surface.getModeManager().setTemporary(Modes.ACCENT);
            break;
        case UP:
            if (this.quitAccentMode)
                this.surface.getModeManager().restore();
            else {
                final PushConfiguration config = this.surface.getConfiguration();
                config.setAccentEnabled(!config.isAccentActive());
            }
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration)

Example 10 with PushConfiguration

use of de.mossgrabers.controller.ableton.push.PushConfiguration in project DrivenByMoss by git-moss.

the class SoloCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    // Update for key combinations
    this.surface.getViewManager().getActive().updateNoteMapping();
    if (this.surface.isSelectPressed()) {
        if (event == ButtonEvent.UP)
            this.model.getProject().clearSolo();
        return;
    }
    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) {
            if (config.isMuteSoloLocked() && config.isSoloState())
                config.setMuteSoloLocked(false);
            else {
                config.setMuteSoloLocked(true);
                config.setTrackState(TrackState.SOLO);
            }
        }
        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 Modes activeModeId = this.surface.getModeManager().getActiveID();
    if (Modes.isLayerMode(activeModeId)) {
        final ICursorDevice cd = this.model.getCursorDevice();
        final Optional<?> layer = cd.getLayerBank().getSelectedItem();
        if (layer.isPresent())
            ((ILayer) layer.get()).toggleSolo();
    } else if (Modes.MASTER.equals(activeModeId))
        this.model.getMasterTrack().toggleSolo();
    else
        this.model.getCursorTrack().toggleSolo();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) Modes(de.mossgrabers.framework.mode.Modes) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)31 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)10 ITrack (de.mossgrabers.framework.daw.data.ITrack)8 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)6 Modes (de.mossgrabers.framework.mode.Modes)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 IDeviceMetadata (de.mossgrabers.framework.daw.data.IDeviceMetadata)4 ISend (de.mossgrabers.framework.daw.data.ISend)4 SendData (de.mossgrabers.framework.graphics.canvas.utils.SendData)3 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)2 Resolution (de.mossgrabers.framework.daw.constants.Resolution)2 IChannel (de.mossgrabers.framework.daw.data.IChannel)2 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)2 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)2 INoteRepeat (de.mossgrabers.framework.daw.midi.INoteRepeat)2 ArrayList (java.util.ArrayList)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)1 ChannelType (de.mossgrabers.framework.daw.resource.ChannelType)1 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)1