Search in sources :

Example 26 with ITrack

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

the class TrackMode method updateKnobLEDs.

/**
 * {@inheritDoc}
 */
@Override
protected void updateKnobLEDs() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    final ITrack t = tb.getSelectedTrack();
    if (t == null) {
        for (int i = 0; i < 8; i++) this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, 0, upperBound);
        return;
    }
    this.surface.setKnobLED(0, MCUControlSurface.KNOB_LED_MODE_WRAP, t.getVolume(), upperBound);
    this.surface.setKnobLED(1, MCUControlSurface.KNOB_LED_MODE_BOOST_CUT, t.getPan(), upperBound);
    final boolean displayCrossfader = this.surface.getConfiguration().isDisplayCrossfader();
    final int start = displayCrossfader ? 3 : 2;
    final int end = displayCrossfader ? 5 : 6;
    if (displayCrossfader) {
        final String crossfadeMode = t.getCrossfadeMode();
        this.surface.setKnobLED(2, MCUControlSurface.KNOB_LED_MODE_SINGLE_DOT, "A".equals(crossfadeMode) ? 1 : "B".equals(crossfadeMode) ? 127 : 64, upperBound);
    }
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    for (int i = 0; i < end; i++) this.surface.setKnobLED(start + i, MCUControlSurface.KNOB_LED_MODE_WRAP, isEffectTrackBankActive ? 0 : t.getSend(i).getValue(), upperBound);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 27 with ITrack

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

the class VolumeMode method updateKnobLEDs.

/**
 * {@inheritDoc}
 */
@Override
protected void updateKnobLEDs() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    final int extenderOffset = this.surface.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(extenderOffset + i);
        this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, t.getVolume(), upperBound);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 28 with ITrack

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

the class LeftCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    final int index = sel == null ? 0 : sel.getIndex() - 1;
    final View view = this.surface.getViewManager().getActiveView();
    if (index == -1 || this.surface.isShiftPressed()) {
        if (!tb.canScrollTracksUp())
            return;
        tb.scrollTracksPageUp();
        final int newSel = index == -1 || sel == null ? 7 : sel.getIndex();
        this.surface.scheduleTask(() -> view.selectTrack(newSel), 75);
        return;
    }
    view.selectTrack(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) View(de.mossgrabers.framework.view.View)

Example 29 with ITrack

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

the class SelectNoteViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    if (sel == null) {
        viewManager.setActiveView(Views.VIEW_SESSION);
        return;
    }
    final boolean isShifted = this.surface.isShiftPressed();
    if (Views.isNoteView(isShifted ? viewManager.getPreviousViewId() : viewManager.getActiveViewId())) {
        if (isShifted)
            this.seqSelect.executeNormal(event);
        else
            this.playSelect.executeNormal(event);
    } else {
        final Integer viewID = viewManager.getPreferredView(sel.getPosition());
        if (viewID == null)
            this.seqSelect.executeNormal(event);
        else
            viewManager.setActiveView(viewID);
    }
    viewManager.setPreferredView(sel.getPosition(), viewManager.getActiveViewId());
    this.surface.getDisplay().notify(viewManager.getActiveView().getName());
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 30 with ITrack

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

the class BaseMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final int extenderOffset = this.surface.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(extenderOffset + i);
        this.surface.updateButton(MCUControlSurface.MCU_ARM1 + i, track.isRecArm() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
        this.surface.updateButton(MCUControlSurface.MCU_SOLO1 + i, track.isSolo() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
        this.surface.updateButton(MCUControlSurface.MCU_MUTE1 + i, track.isMute() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
        this.surface.updateButton(MCUControlSurface.MCU_SELECT1 + i, track.isSelected() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF);
    }
    this.updateKnobLEDs();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9