Search in sources :

Example 11 with ITransport

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

the class PlayView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final int buttonIDOrdinal = buttonID.ordinal();
    // Button row 2: Track toggles
    if (buttonIDOrdinal >= ButtonID.ROW1_1.ordinal() && buttonIDOrdinal <= ButtonID.ROW1_8.ordinal() || buttonIDOrdinal >= ButtonID.ROW2_1.ordinal() && buttonIDOrdinal <= ButtonID.ROW2_8.ordinal())
        return SLControlSurface.MKII_BUTTON_STATE_OFF;
    final Modes mode = this.surface.getModeManager().getActiveID();
    final boolean isSession = Modes.SESSION == mode;
    final boolean isDevice = Modes.DEVICE_PARAMS == mode;
    final boolean isPlayOptions = Modes.PLAY_OPTIONS == mode;
    final boolean isTrack = Modes.TRACK == mode;
    final boolean isVolume = Modes.VOLUME == mode;
    switch(buttonID) {
        case ROW_SELECT_1:
            return isSession ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
        case ROW_SELECT_2:
            return isDevice ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
        case ROW_SELECT_3:
            return isPlayOptions ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
        case ROW_SELECT_4:
            return isTrack ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
        case ROW_SELECT_5:
            return SLControlSurface.MKII_BUTTON_STATE_OFF;
        case ROW_SELECT_6:
            return isVolume ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
        case ROW_SELECT_7:
        case ROW_SELECT_8:
            return SLControlSurface.MKII_BUTTON_STATE_OFF;
        default:
            // Fall through
            break;
    }
    // Transport buttons
    if (this.surface.isTransportActive()) {
        if (buttonIDOrdinal >= ButtonID.ROW3_1.ordinal() && buttonIDOrdinal <= ButtonID.ROW3_8.ordinal())
            return SLControlSurface.MKII_BUTTON_STATE_OFF;
        final ITransport transport = this.model.getTransport();
        switch(buttonID) {
            case ROW4_3:
                return !transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
            case ROW4_4:
                return transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
            case ROW4_5:
                return transport.isLoop() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
            case ROW4_6:
                return transport.isRecording() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
            default:
                return 0;
        }
    }
    // Draw sequencer
    return this.drawDrumGrid(buttonIDOrdinal);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 12 with ITransport

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

the class MasterHandler method changeMasterCrossfader.

private void changeMasterCrossfader(final KnobMode knobMode, final MidiValue value) {
    final ITransport transport = this.model.getTransport();
    final int val = value.getValue();
    final IParameter crossfadeParameter = transport.getCrossfadeParameter();
    if (isAbsolute(knobMode))
        crossfadeParameter.setValue(this.getAbsoluteValueChanger(value), val);
    else
        crossfadeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 13 with ITransport

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

the class ShiftView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final ITransport t = this.model.getTransport();
    final IPadGrid padGrid = this.surface.getPadGrid();
    padGrid.light(36, t.isPlaying() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(37, t.isRecording() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(38, t.isLoop() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(39, t.isMetronomeOn() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(40, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(41, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(42, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(43, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(44, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(45, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(46, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(47, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(48, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
    padGrid.light(49, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(50, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(51, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 14 with ITransport

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

the class TransportHandler method handleMetronomeVolume.

private void handleMetronomeVolume(final KnobMode knobMode, final MidiValue value) {
    final ITransport transport = this.model.getTransport();
    final IParameter metronomeVolumeParameter = transport.getMetronomeVolumeParameter();
    final int val = value.getValue();
    if (isAbsolute(knobMode))
        metronomeVolumeParameter.setValue(this.getAbsoluteValueChanger(value), val);
    else
        metronomeVolumeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 15 with ITransport

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

the class TransportHandler method handleTempo.

private void handleTempo(final KnobMode knobMode, final MidiValue value) {
    final ITransport transport = this.model.getTransport();
    if (isAbsolute(knobMode)) {
        final int val = value.getValue();
        transport.setTempo(transport.scaleTempo(val, value.isHighRes() ? 16384 : 128));
    } else
        transport.changeTempo(this.isIncrease(knobMode, value), this.surface.isKnobSensitivitySlow());
}
Also used : ITransport(de.mossgrabers.framework.daw.ITransport)

Aggregations

ITransport (de.mossgrabers.framework.daw.ITransport)47 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)5 IHost (de.mossgrabers.framework.daw.IHost)5 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)5 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)4 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)4 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)4 View (de.mossgrabers.framework.view.View)4 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 ModeManager (de.mossgrabers.framework.mode.ModeManager)3 ButtonEvent (de.mossgrabers.framework.utils.ButtonEvent)3 SceneView (de.mossgrabers.framework.view.SceneView)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 ButtonID (de.mossgrabers.framework.controller.ButtonID)2