Search in sources :

Example 86 with ITrackBank

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

the class ModeMultiSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    final Modes activeModeId = this.modeManager.getActiveID();
    Modes newMode = this.currentModeID;
    // If coming from a mode not on the list, activate the last one
    if (this.currentModeID.equals(activeModeId)) {
        final ITrackBank trackBank = this.model.getTrackBank();
        int index = this.modeIds.indexOf(activeModeId);
        // If a send mode is selected check if the according send exists
        do {
            index++;
            if (index < 0 || index >= this.modeIds.size())
                index = 0;
            newMode = this.modeIds.get(index);
        } while (Modes.isSendMode(newMode) && !trackBank.canEditSend(newMode.ordinal() - Modes.SEND1.ordinal()));
    }
    this.activateMode(newMode);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 87 with ITrackBank

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

the class AddTrackCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    ITrackBank tb = this.model.getTrackBank();
    final IApplication application = this.model.getApplication();
    if (this.combi1 != null && this.surface.isPressed(this.combi1)) {
        application.addEffectTrack();
        tb = this.model.getEffectTrackBank();
        if (tb == null)
            return;
    } else if (this.combi2 != null && this.surface.isPressed(this.combi2))
        this.model.getTrackBank().addChannel(ChannelType.AUDIO);
    else
        this.model.getTrackBank().addChannel(ChannelType.INSTRUMENT);
    final ITrackBank bank = tb;
    this.surface.scheduleTask(() -> {
        final int pos = bank.getItemCount() - 1;
        if (pos < 0) {
            this.surface.errorln("Warning: No track created.");
            return;
        }
        bank.scrollTo(pos);
        bank.getItem(pos % bank.getPageSize()).select();
    }, 200);
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 88 with ITrackBank

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

the class SelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final ITrack track = currentTrackBank.getItem(this.index);
    if (track != null)
        track.select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 89 with ITrackBank

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

the class AbstractTrackMode method onFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
    if (event == ButtonEvent.DOWN)
        return;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getItem(index);
    if (event == ButtonEvent.UP) {
        if (this.surface.isPressed(ButtonID.DUPLICATE)) {
            this.surface.setTriggerConsumed(ButtonID.DUPLICATE);
            track.duplicate();
            return;
        }
        if (this.surface.isPressed(ButtonID.DELETE)) {
            this.surface.setTriggerConsumed(ButtonID.DELETE);
            track.remove();
            return;
        }
        if (this.surface.isPressed(ButtonID.STOP_CLIP)) {
            this.surface.setTriggerConsumed(ButtonID.STOP_CLIP);
            track.stop();
            return;
        }
        if (this.surface.isPressed(ButtonID.RECORD)) {
            this.surface.setTriggerConsumed(ButtonID.RECORD);
            track.toggleRecArm();
            return;
        }
        if (!track.isSelected()) {
            track.select();
            return;
        }
        // mode
        if (track.isGroup()) {
            if (this.surface.isShiftPressed())
                track.toggleGroupExpanded();
            else
                track.enter();
        } else
            this.surface.getButton(ButtonID.DEVICE).trigger(ButtonEvent.DOWN);
        return;
    }
    // LONG press, go out of group
    if (!this.model.isEffectTrackBankActive()) {
        this.model.getTrackBank().selectParent();
        this.surface.setTriggerConsumed(ButtonID.get(ButtonID.ROW1_1, index));
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 90 with ITrackBank

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

the class AbstractTrackMode method updateChannelDisplay.

// Push 2
// Called from sub-classes
protected void updateChannelDisplay(final IGraphicDisplay display, final int selectedMenu, final boolean isVolume, final boolean isPan) {
    this.updateMenuItems(selectedMenu);
    final IValueChanger valueChanger = this.model.getValueChanger();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    final ICursorTrack cursorTrack = this.model.getCursorTrack();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        final Pair<String, Boolean> pair = this.menu.get(i);
        final String topMenu = pair.getKey();
        final boolean isTopMenuOn = pair.getValue().booleanValue();
        final int crossfadeMode = this.getCrossfadeModeAsNumber(t);
        final boolean enableVUMeters = config.isEnableVUMeters();
        final int vuR = valueChanger.toDisplayValue(enableVUMeters ? t.getVuRight() : 0);
        final int vuL = valueChanger.toDisplayValue(enableVUMeters ? t.getVuLeft() : 0);
        display.addChannelElement(selectedMenu, topMenu, isTopMenuOn, t.doesExist() ? t.getName(12) : "", this.updateType(t), t.getColor(), t.isSelected(), valueChanger.toDisplayValue(t.getVolume()), valueChanger.toDisplayValue(t.getModulatedVolume()), isVolume && this.isKnobTouched[i] ? t.getVolumeStr(8) : "", valueChanger.toDisplayValue(t.getPan()), valueChanger.toDisplayValue(t.getModulatedPan()), isPan && this.isKnobTouched[i] ? t.getPanStr(8) : "", vuL, vuR, t.isMute(), t.isSolo(), t.isRecArm(), t.isActivated(), crossfadeMode, t.isSelected() && cursorTrack.isPinned());
    }
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ICursorTrack(de.mossgrabers.framework.daw.data.ICursorTrack)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)121 ITrack (de.mossgrabers.framework.daw.data.ITrack)85 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)17 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 Modes (de.mossgrabers.framework.mode.Modes)15 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)10 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)10 ISend (de.mossgrabers.framework.daw.data.ISend)10 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)8 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)7 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 ITransport (de.mossgrabers.framework.daw.ITransport)5 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)5 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)5 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)4 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)3 IHost (de.mossgrabers.framework.daw.IHost)3