Search in sources :

Example 26 with PushConfiguration

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

the class NoteRepeatMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    if (index != 7 && !this.increaseKnobMovement())
        return;
    final PushConfiguration configuration = this.surface.getConfiguration();
    final IValueChanger valueChanger = this.model.getValueChanger();
    switch(index) {
        case 0:
        case 1:
            final int sel = Resolution.change(Resolution.getMatch(configuration.getNoteRepeatPeriod().getValue()), valueChanger.isIncrease(value));
            configuration.setNoteRepeatPeriod(Resolution.values()[sel]);
            break;
        case 2:
        case 3:
            if (this.host.supports(Capability.NOTE_REPEAT_LENGTH)) {
                final int sel2 = Resolution.change(Resolution.getMatch(configuration.getNoteRepeatLength().getValue()), valueChanger.calcKnobChange(value) > 0);
                configuration.setNoteRepeatLength(Resolution.values()[sel2]);
            }
            break;
        case 5:
            if (this.host.supports(Capability.NOTE_REPEAT_MODE))
                configuration.setPrevNextNoteRepeatMode(valueChanger.isIncrease(value));
            break;
        case 6:
            if (this.host.supports(Capability.NOTE_REPEAT_OCTAVES))
                configuration.setNoteRepeatOctave(configuration.getNoteRepeatOctave() + (valueChanger.calcKnobChange(value) > 0 ? 1 : -1));
            break;
        case 7:
            if (this.host.supports(Capability.NOTE_REPEAT_SWING))
                this.model.getGroove().getParameter(GrooveParameterID.SHUFFLE_AMOUNT).changeValue(value);
            break;
        default:
            // Not used
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger)

Example 27 with PushConfiguration

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

the class NoteRepeatMode method onFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.UP || this.noteRepeat == null)
        return;
    final PushConfiguration configuration = this.surface.getConfiguration();
    switch(index) {
        case 0:
        case 1:
            final int sel = Resolution.change(Resolution.getMatch(this.noteRepeat.getPeriod()), index == 1);
            configuration.setNoteRepeatPeriod(Resolution.values()[sel]);
            break;
        case 2:
        case 3:
            if (this.host.supports(Capability.NOTE_REPEAT_LENGTH)) {
                final int sel2 = Resolution.change(Resolution.getMatch(this.noteRepeat.getNoteLength()), index == 3);
                configuration.setNoteRepeatLength(Resolution.values()[sel2]);
            }
            break;
        case 5:
            if (this.host.supports(Capability.NOTE_REPEAT_USE_PRESSURE_TO_VELOCITY))
                this.noteRepeat.toggleUsePressure();
            break;
        case 6:
            if (this.host.supports(Capability.NOTE_REPEAT_IS_FREE_RUNNING))
                this.noteRepeat.toggleIsFreeRunning();
            break;
        case 7:
            if (this.host.supports(Capability.NOTE_REPEAT_SWING))
                this.noteRepeat.toggleShuffle();
            break;
        default:
            // Unused
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration)

Example 28 with PushConfiguration

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

the class ScalesMode method update.

private void update() {
    this.surface.getViewManager().getActive().updateNoteMapping();
    final PushConfiguration config = this.surface.getConfiguration();
    config.setScale(this.scales.getScale().getName());
    config.setScaleBase(Scales.BASES.get(this.scales.getScaleOffset()));
    config.setScaleInKey(!this.scales.isChromatic());
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration)

Example 29 with PushConfiguration

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

the class SessionViewSelectMode method onFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    final PushConfiguration configuration = this.surface.getConfiguration();
    switch(index) {
        case 0:
        case 1:
            configuration.setFlipSession(index == 1);
            this.activateView(VIEWS[index]);
            break;
        case 2:
            configuration.setSceneView();
            this.surface.getModeManager().restore();
            break;
        case 6:
            this.surface.getModeManager().setActive(Modes.MARKERS);
            break;
        case 7:
            this.surface.getModeManager().restore();
            configuration.toggleScenesClipMode();
            break;
        default:
            // Not used
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration)

Example 30 with PushConfiguration

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

the class TrackCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final PushConfiguration config = this.surface.getConfiguration();
    if (this.surface.isShiftPressed()) {
        config.setVUMetersEnabled(!config.isEnableVUMeters());
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes currentMode = modeManager.getActiveID();
    if (currentMode != null) {
        if (config.isPush2()) {
            if (Modes.TRACK.equals(currentMode) || Modes.VOLUME.equals(currentMode) || Modes.CROSSFADER.equals(currentMode) || Modes.PAN.equals(currentMode)) {
                this.model.toggleCurrentTrackBank();
            } else if (currentMode.ordinal() >= Modes.SEND1.ordinal() && currentMode.ordinal() <= Modes.SEND8.ordinal()) {
                modeManager.setActive(Modes.TRACK);
                this.model.toggleCurrentTrackBank();
            } else
                modeManager.setActive(config.getCurrentMixMode());
        } else {
            // Layer mode selection for Push 1
            if (this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
                modeManager.setActive(Modes.DEVICE_LAYER);
                return;
            }
            if (Modes.TRACK.equals(currentMode))
                this.model.toggleCurrentTrackBank();
            else
                modeManager.setActive(Modes.TRACK);
        }
    } else
        modeManager.setActive(Modes.TRACK);
    config.setDebugMode(modeManager.getActiveID());
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = tb.getSelectedItem();
    if (track.isEmpty())
        tb.getItem(0).select();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

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