Search in sources :

Example 31 with IMasterTrack

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

the class SLControllerSetup method updateIndication.

private void updateIndication() {
    final SLControlSurface surface = this.getSurface();
    final Integer mode = surface.getModeManager().getActiveModeId();
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(Modes.MODE_MASTER.equals(mode));
    mt.setPanIndication(Modes.MODE_MASTER.equals(mode));
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isVolume = Modes.MODE_VOLUME.equals(mode);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final ITrack selectedTrack = tb.getSelectedTrack();
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && Modes.MODE_TRACK.equals(mode);
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && (isVolume || hasTrackSel));
        track.setPanIndication(!isEffect && hasTrackSel);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel);
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect);
        fxTrack.setPanIndication(isEffect);
        cursorDevice.indicateParameter(i, true);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) SLControlSurface(de.mossgrabers.sl.controller.SLControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 32 with IMasterTrack

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

the class FaderCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final int value) {
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    if (masterTrack.isSelected()) {
        if (this.index == 0)
            masterTrack.setVolume(value);
    } else
        this.model.getCurrentTrackBank().getTrack(this.index).setVolume(value);
    final ModeManager modeManager = this.surface.getModeManager();
    if (!modeManager.isActiveMode(Modes.MODE_VOLUME))
        modeManager.setActiveMode(Modes.MODE_VOLUME);
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 33 with IMasterTrack

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

the class BeatstepControllerSetup method updateIndication.

protected void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActive(Views.TRACK);
    final boolean isDevice = viewManager.isActive(Views.DEVICE);
    final boolean isSession = viewManager.isActive(Views.SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    final ITrackBank tbe = this.model.getEffectTrackBank();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    if (tbe != null)
        tbe.setIndication(isEffect && isSession);
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
        final ITrack track = tb.getItem(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        final ISendBank sendBank = track.getSendBank();
        for (int j = 0; j < 6; j++) sendBank.getItem(j).setIndication(!isEffect && hasTrackSel && isTrack);
        if (tbe != null) {
            final Optional<ITrack> selectedFXTrack = tbe.getSelectedItem();
            final boolean hasFXTrackSel = selectedFXTrack.isPresent() && selectedFXTrack.get().getIndex() == i;
            final ITrack fxTrack = tbe.getItem(i);
            fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
            fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        }
        parameterBank.getItem(i).setIndication(isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 34 with IMasterTrack

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

the class MasterMode method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    int index = this.isButtonRow(0, buttonID);
    if (index >= 0) {
        final ColorManager colorManager = this.model.getColorManager();
        final boolean isPush2 = this.surface.getConfiguration().isPush2();
        if (index == 0)
            return this.getTrackButtonColor();
        if (index < 4 || index == 5)
            return colorManager.getColorIndex(AbstractFeatureGroup.BUTTON_COLOR_OFF);
        if (index > 5)
            return colorManager.getColorIndex(AbstractFeatureGroup.BUTTON_COLOR_ON);
        final int red = isPush2 ? PushColorManager.PUSH2_COLOR_RED_HI : PushColorManager.PUSH1_COLOR_RED_HI;
        return this.model.getApplication().isEngineActive() ? colorManager.getColorIndex(AbstractFeatureGroup.BUTTON_COLOR_ON) : red;
    }
    index = this.isButtonRow(1, buttonID);
    if (index >= 0) {
        final int off = this.isPush2 ? PushColorManager.PUSH2_COLOR_BLACK : PushColorManager.PUSH1_COLOR_BLACK;
        if (this.isPush2 || index > 0)
            return off;
        final boolean muteState = this.surface.getConfiguration().isMuteState();
        final IMasterTrack master = this.model.getMasterTrack();
        if (muteState)
            return master.isMute() ? off : PushColorManager.PUSH1_COLOR2_YELLOW_HI;
        return master.isSolo() ? PushColorManager.PUSH1_COLOR2_BLUE_HI : PushColorManager.PUSH1_COLOR2_GREY_LO;
    }
    return super.getButtonColor(buttonID);
}
Also used : PushColorManager(de.mossgrabers.controller.ableton.push.controller.PushColorManager) ColorManager(de.mossgrabers.framework.controller.color.ColorManager) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 35 with IMasterTrack

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

the class BaseMode method drawDisplay2.

protected void drawDisplay2() {
    if (!this.surface.getConfiguration().hasDisplay2())
        return;
    final ITrackBank tb = this.getTrackBank();
    // Format track names
    final ITextDisplay d2 = this.surface.getTextDisplay(1);
    final int extenderOffset = this.getExtenderOffset();
    final boolean isMainDevice = this.surface.isMainDevice();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(extenderOffset + i);
        d2.setCell(0, i, StringUtils.shortenAndFixASCII(t.getName(), isMainDevice ? 6 : 7));
    }
    if (isMainDevice)
        d2.setCell(0, 8, "Maste");
    d2.done(0);
    d2.clearRow(1);
    if (isMainDevice) {
        final IMasterTrack masterTrack = this.model.getMasterTrack();
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        final ITrack selectedTrack;
        if (masterTrack.isSelected())
            selectedTrack = masterTrack;
        else {
            final Optional<ITrack> selectedItem = tb.getSelectedItem();
            selectedTrack = selectedItem.isPresent() ? selectedItem.get() : EmptyTrack.INSTANCE;
        }
        d2.setBlock(1, 0, "Sel. track:").setBlock(1, 1, selectedTrack == null ? "None" : StringUtils.shortenAndFixASCII(selectedTrack.getName(), 11));
        d2.setBlock(1, 2, "Sel. devce:").setBlock(1, 3, cursorDevice.doesExist() ? StringUtils.shortenAndFixASCII(cursorDevice.getName(), 11) : "None");
    }
    d2.done(1);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)40 ITrack (de.mossgrabers.framework.daw.data.ITrack)15 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)7 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)6 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)5 Display (de.mossgrabers.framework.controller.display.Display)4 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)4 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)4 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)3 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IApplication (de.mossgrabers.framework.daw.IApplication)2 IProject (de.mossgrabers.framework.daw.IProject)2 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)2 ITransport (de.mossgrabers.framework.daw.ITransport)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 PushDisplay (de.mossgrabers.push.controller.PushDisplay)2 BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)1 PushColorManager (de.mossgrabers.controller.ableton.push.controller.PushColorManager)1