Search in sources :

Example 1 with MCUConfiguration

use of de.mossgrabers.controller.mackie.mcu.MCUConfiguration in project DrivenByMoss by git-moss.

the class AssignableCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final MCUConfiguration configuration = this.surface.getConfiguration();
    switch(this.getSetting()) {
        case MCUConfiguration.FOOTSWITCH_2_PREV_MODE:
            if (event == ButtonEvent.DOWN)
                this.switcher.scrollDown();
            break;
        case MCUConfiguration.FOOTSWITCH_2_NEXT_MODE:
            if (event == ButtonEvent.DOWN)
                this.switcher.scrollUp();
            break;
        case MCUConfiguration.FOOTSWITCH_2_SHOW_MARKER_MODE:
            if (event != ButtonEvent.DOWN)
                return;
            final ModeManager modeManager = this.surface.getModeManager();
            if (modeManager.isActive(Modes.MARKERS))
                modeManager.restore();
            else
                modeManager.setActive(Modes.MARKERS);
            final IMode mode = modeManager.getActive();
            if (mode != null)
                this.surface.getDisplay().notify(mode.getName());
            break;
        case MCUConfiguration.FOOTSWITCH_2_USE_FADERS_LIKE_EDIT_KNOBS:
            this.flipCommand.executeNormal(event);
            break;
        case MCUConfiguration.FOOTSWITCH_2_TOGGLE_MOTOR_FADERS_ON_OFF:
            if (event != ButtonEvent.DOWN)
                return;
            configuration.toggleMotorFaders();
            this.mvHelper.delayDisplay(() -> "Motor Faders: " + (configuration.hasMotorFaders() ? "On" : "Off"));
            break;
        case MCUConfiguration.FOOTSWITCH_2_ACTION:
            if (event != ButtonEvent.DOWN)
                return;
            final String assignableActionID = configuration.getAssignableAction(this.index);
            if (assignableActionID != null)
                this.model.getApplication().invokeAction(assignableActionID);
            break;
        default:
            super.execute(event, velocity);
            break;
    }
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration) IMode(de.mossgrabers.framework.featuregroup.IMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 2 with MCUConfiguration

use of de.mossgrabers.controller.mackie.mcu.MCUConfiguration in project DrivenByMoss by git-moss.

the class FaderTouchCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final MCUConfiguration configuration = this.surface.getConfiguration();
    if (event == ButtonEvent.LONG || configuration.useFadersAsKnobs())
        return;
    final boolean isTouched = event == ButtonEvent.DOWN;
    // Master Channel
    if (this.index == 8) {
        if (isTouched && configuration.isTouchChannel())
            this.model.getMasterTrack().select();
        return;
    }
    // Select channel
    if (configuration.isTouchChannel() && event == ButtonEvent.DOWN)
        this.getTrackBank().getItem(this.channel).select();
    final ModeManager modeManager = this.surface.getModeManager();
    if (configuration.useFadersAsKnobs()) {
        modeManager.getActive().onKnobTouch(this.index, isTouched);
        return;
    }
    modeManager.get(Modes.VOLUME).onKnobTouch(this.index, isTouched);
    final int pos = this.surface.getSurfaceID() * 8 + this.index;
    // Temporarily enable volume mode
    if (isTouched) {
        if (!hasTouchedFader()) {
            if (modeManager.isActive(Modes.VOLUME))
                modeManager.setPreviousID(Modes.VOLUME);
            else
                modeManager.setActive(Modes.VOLUME);
        }
        setTouchedFader(pos, true);
    } else {
        setTouchedFader(pos, false);
        if (!hasTouchedFader())
            modeManager.restore();
    }
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 3 with MCUConfiguration

use of de.mossgrabers.controller.mackie.mcu.MCUConfiguration in project DrivenByMoss by git-moss.

the class SelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (this.handleButtonCombinations(event))
        return;
    final MCUConfiguration configuration = this.surface.getConfiguration();
    final ITrackBank trackBank = this.getTrackBank();
    if (event == ButtonEvent.UP) {
        final ITrack track = trackBank.getItem(this.channel);
        if (!track.isSelected()) {
            track.select();
            return;
        }
        if (configuration.isTrackNavigationFlat()) {
            if (track.isGroup())
                track.toggleGroupExpanded();
        } else
            track.enter();
    } else if (event == ButtonEvent.LONG && !configuration.isTrackNavigationFlat()) {
        trackBank.selectParent();
        for (int i = 0; i < 8; i++) this.surface.setTriggerConsumed(ButtonID.get(ButtonID.ROW_SELECT_1, i));
    }
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 4 with MCUConfiguration

use of de.mossgrabers.controller.mackie.mcu.MCUConfiguration in project DrivenByMoss by git-moss.

the class TempoTicksCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final MCUConfiguration configuration = this.surface.getConfiguration();
    if (this.surface.isSelectPressed())
        configuration.toggleDisplayTime();
    else
        configuration.toggleDisplayTicks();
    this.model.getHost().scheduleTask(() -> {
        final String message = (configuration.isDisplayTime() ? "TIME - " : "BEATS - ") + (configuration.isDisplayTicks() ? "TICKS" : "TEMPO");
        this.surface.getDisplay().notify(message);
    }, 200);
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration)

Example 5 with MCUConfiguration

use of de.mossgrabers.controller.mackie.mcu.MCUConfiguration in project DrivenByMoss by git-moss.

the class MCUFlipCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final MCUConfiguration configuration = this.surface.getConfiguration();
    configuration.toggleUseFadersAsKnobs();
    this.mvHelper.delayDisplay(() -> "Use faders as knobs: " + (configuration.useFadersAsKnobs() ? "On" : "Off"));
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration)

Aggregations

MCUConfiguration (de.mossgrabers.controller.mackie.mcu.MCUConfiguration)5 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1 IMode (de.mossgrabers.framework.featuregroup.IMode)1