Search in sources :

Example 11 with ITrackBank

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

the class SendsView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final int ordinal = buttonID.ordinal();
    if (ordinal < ButtonID.SCENE1.ordinal() || ordinal > ButtonID.SCENE8.ordinal())
        return 0;
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (this.selectedSend == scene)
        return LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID;
    final ITrackBank tb = this.model.getTrackBank();
    if (tb.canEditSend(scene))
        return LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO;
    return LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK;
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 12 with ITrackBank

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

the class SendsView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
        return;
    this.selectedSend = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    final ITrackBank tb = this.model.getTrackBank();
    final String sendName = tb.getEditSendName(this.selectedSend);
    final String message = "Send " + (this.selectedSend + 1) + ": " + (sendName.isEmpty() ? "None" : sendName);
    this.surface.getTextDisplay().notify(message);
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 13 with ITrackBank

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

the class SessionView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (index >= 0 || index < 8) {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final ISceneBank sceneBank = tb.getSceneBank();
        final IScene s = sceneBank.getItem(index);
        if (s.doesExist())
            return DAWColor.getColorIndex(s.getColor());
    }
    return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 14 with ITrackBank

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

the class ModeMultiSelectCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(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 = this.modeIds.size() - 1;
            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 15 with ITrackBank

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

the class MVHelper method notifySelectedTrack.

/**
 * Display the name of the selected track.
 */
public void notifySelectedTrack() {
    this.delayDisplay(() -> {
        final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
        final Optional<ITrack> selectedTrack = currentTrackBank.getSelectedItem();
        if (selectedTrack.isEmpty())
            return SELECTED_TRACK_NONE;
        final ITrack t = selectedTrack.get();
        if (!t.doesExist())
            return SELECTED_TRACK_NONE;
        return t.getPosition() + 1 + ": " + t.getName();
    });
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

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