Search in sources :

Example 36 with ITrackBank

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

the class LaunchkeyMk3SendMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    final ICursorTrack cursorTrack = this.model.getCursorTrack();
    final String trackText = cursorTrack.doesExist() ? String.format("%d: %s", Integer.valueOf(cursorTrack.getPosition() + 1), cursorTrack.getName()) : "No sel. track";
    final ITrackBank tb = this.model.getCurrentTrackBank();
    if (this.areKnobs) {
        String sendName = tb.getEditSendName(this.sendIndex);
        sendName = StringUtils.optimizeName(sendName.isEmpty() ? "Send " + (this.sendIndex + 1) : sendName, 6);
        d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, sendName + this.formatPageRange(" %d - %d"));
        d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE + 1, 0, trackText);
    }
    final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
    // Format track names
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        final ISend s = t.getSendBank().getItem(this.sendIndex);
        final boolean exists = s.doesExist();
        final int offset = i * 2;
        d.setCell(row + offset, 0, exists ? String.format("%d: %s", Integer.valueOf(s.getPosition() + 1), s.getName()) : "No send");
        d.setCell(row + offset + 1, 0, exists ? "S-Vol: " + s.getDisplayedValue() : "");
    }
    // Add master fader
    if (!this.areKnobs) {
        final IMasterTrack masterTrack = this.model.getMasterTrack();
        d.setCell(row + 16, 0, "Master");
        d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
    }
    d.allDone();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ICursorTrack(de.mossgrabers.framework.daw.data.ICursorTrack) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISend(de.mossgrabers.framework.daw.data.ISend) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 37 with ITrackBank

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

the class SessionView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final boolean controlModeIsOff = this.padMode == null;
    this.rows = controlModeIsOff ? 2 : 1;
    super.drawGrid();
    if (controlModeIsOff)
        return;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final IPadGrid pads = this.surface.getPadGrid();
    for (int x = 0; x < this.columns; x++) {
        final ITrack track = tb.getItem(x);
        if (!track.doesExist()) {
            pads.lightEx(x, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK);
            continue;
        }
        switch(this.padMode) {
            case REC_ARM:
                pads.lightEx(x, 1, track.isRecArm() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_LO);
                break;
            case TRACK_SELECT:
                pads.lightEx(x, 1, track.isSelected() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO);
                break;
            case MUTE:
                pads.lightEx(x, 1, track.isMute() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_LO);
                break;
            case SOLO:
                pads.lightEx(x, 1, track.isSolo() ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_LO);
                break;
            case STOP_CLIP:
                pads.lightEx(x, 1, LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE);
                break;
            default:
                // Unused
                break;
        }
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 38 with ITrackBank

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

the class MaschinePanMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        String name = StringUtils.shortenAndFixASCII(t.getName(), 6);
        if (t.isSelected())
            name = ">" + name;
        d.setCell(0, i, name);
        d.setCell(1, i, t.getPanStr(6));
    }
    d.allDone();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 39 with ITrackBank

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

the class MaschineSendMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        final ISend send = t.getSendBank().getItem(this.sendIndex);
        String name = StringUtils.shortenAndFixASCII(t.getName(), 6);
        if (t.isSelected())
            name = ">" + name;
        d.setCell(0, i, name);
        d.setCell(1, i, send.getDisplayedValue(6));
    }
    d.allDone();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 40 with ITrackBank

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

the class MaschineVolumeMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        String name = StringUtils.shortenAndFixASCII(t.getName(), 6);
        if (t.isSelected())
            name = ">" + name;
        d.setCell(0, i, name);
        if (this.displayVU && !this.isKnobTouched[i] && !(this.isKnobTouched[8] && t.isSelected())) {
            final int steps = (int) Math.round(this.model.getValueChanger().toNormalizedValue(t.getVu()) * 6);
            d.setCell(1, i, StringUtils.pad("", steps, '>'));
        } else
            d.setCell(1, i, t.getVolumeStr(6));
    }
    d.allDone();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

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