Search in sources :

Example 1 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 2 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)

Example 3 with PushConfiguration

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

the class VolumeCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes currentMode = modeManager.getActiveID();
    // Layer mode selection for Push 1
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
        modeManager.setActive(Modes.DEVICE_LAYER_VOLUME);
        return;
    }
    if (Modes.VOLUME.equals(currentMode)) {
        if (this.model.getHost().supports(Capability.HAS_CROSSFADER))
            modeManager.setActive(Modes.CROSSFADER);
    } else
        modeManager.setActive(Modes.VOLUME);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 4 with PushConfiguration

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

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event == ButtonEvent.DOWN) {
        this.isTemporary = false;
        final ViewManager viewManager = this.surface.getViewManager();
        final ModeManager modeManager = this.surface.getModeManager();
        if (Views.isSessionView(viewManager.getActiveID())) {
            if (modeManager.isActive(Modes.SESSION_VIEW_SELECT))
                modeManager.restore();
            else
                modeManager.setTemporary(Modes.SESSION_VIEW_SELECT);
            return;
        }
        // Switch to the preferred session view and display scene/clip mode if enabled
        final PushConfiguration configuration = this.surface.getConfiguration();
        viewManager.setActive(configuration.isScenesClipViewSelected() ? Views.SCENE_PLAY : Views.SESSION);
        if (configuration.shouldDisplayScenesOrClips())
            modeManager.setActive(Modes.SESSION);
        return;
    }
    if (event == ButtonEvent.UP && this.isTemporary)
        this.surface.getViewManager().restore();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 5 with PushConfiguration

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

the class MuteCommand 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().clearMute();
        return;
    }
    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) {
            if (config.isMuteSoloLocked() && config.isMuteState())
                config.setMuteSoloLocked(false);
            else {
                config.setMuteSoloLocked(true);
                config.setTrackState(TrackState.MUTE);
            }
        }
        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 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()).toggleMute();
    } else if (Modes.MASTER.equals(activeModeId))
        this.model.getMasterTrack().toggleMute();
    else
        this.model.getCursorTrack().toggleMute();
}
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